[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
question
Hi, here are some errors reported by TYPOL type-checking, I hope someone can
tell me why the incompatible types happened. I suppose types of IDENT and VALUE
are eventually strings. So, (string, SMALL::IDENT) should be compatible.
Error: The variable V is used with incompatible types (string, SMALL::IDENT).
Error: The variable N is used with incompatible types (string, SMALL::VALUE).
the errors came from the following typol rule:
judgement PAIR_S |- I, BOOL , B : PAIR_S ;
pair_s[] |- ident V, false, num N: pair_s[pair(V, false, N)] ;
the corresponding parts of those in METAL file are:
...
pair_s -> PAIR * ... ;
pair -> IDENT BOOL VALUE ;
...
PAIRS ::= pair_s ;
PAIR ::= pair ;
VALUE ::= num true false d_fun d_proc ;
...
<ident> ::= %ID ;
ident-atom(%ID)
<num> ::= %INT ;
num-atom(%INT)
...
ident -> implemented as IDENTIFIER;
num -> implemented as STRING;
IDENT ::= ident;
B ::= num;
...
Thank you.
---Rongliang