Added support for inequality tests.
There is a new event: not match(t1,t2) where t1,t2 are terms. They are implemented by using a special claim that simply stores the intended inequality. The pruning theorems (prune_theorems.c) ensure that these terms never become equal. If there are equal, the constraint is violated. As long as they are not equal, there exists a solution using groung terms such that their instantiation is not equal. Currently not very efficient implemented and the graph out output is also ugly for now. Conflicts: gui/Scyther/Trace.py src/compiler.c src/scanner.l
This commit is contained in:
12
src/parser.y
12
src/parser.y
@@ -58,6 +58,7 @@ int yylex(void);
|
||||
%token KNOWS
|
||||
%token TRUSTED
|
||||
%token MATCH
|
||||
%token NOT
|
||||
|
||||
%type <tac> spdlcomplete
|
||||
%type <tac> spdlrep
|
||||
@@ -204,6 +205,17 @@ event : READT label '(' termlist ')' ';'
|
||||
Tac t= tacCreate(TAC_MATCH);
|
||||
t->t1.tac = $3;
|
||||
t->t2.tac = $5;
|
||||
t->t3.value = true;
|
||||
$$ = t;
|
||||
}
|
||||
| NOT MATCH '(' term ',' term ')' ';'
|
||||
{
|
||||
/* first argument is pattern, second should be
|
||||
* ground term */
|
||||
Tac t= tacCreate(TAC_MATCH);
|
||||
t->t1.tac = $4;
|
||||
t->t2.tac = $6;
|
||||
t->t3.value = false;
|
||||
$$ = t;
|
||||
}
|
||||
| CLAIMT optlabel '(' termlist ')' ';'
|
||||
|
||||
Reference in New Issue
Block a user