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:
Cas Cremers
2012-11-21 13:40:15 +01:00
parent d4faeacd1e
commit fedd729ab2
7 changed files with 119 additions and 1 deletions

View File

@@ -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 ')' ';'