Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
java-backend: support SMTLIB translation for KVar binders (#1237)
- Loading branch information
1 parent
fb3c282
commit 0ac45da
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DEF=a | ||
EXT=a | ||
KOMPILE_FLAGS=--syntax-module A | ||
KOMPILE_BACKEND?=java | ||
KPROVE_FLAGS= | ||
|
||
TESTDIR=. | ||
|
||
include ../../../include/ktest.mak |
13 changes: 13 additions & 0 deletions
13
k-distribution/tests/regression-new/smtlib-forall/a-spec.k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module A-SPEC | ||
|
||
imports A | ||
|
||
rule <k> foo(L) => 0 ... </k> | ||
requires forall(x, L, x >Int 10) | ||
ensures forall(x, L, x >Int 0) | ||
|
||
rule <k> bar(L1, L2) => 0 ... </k> | ||
requires forall(x, L1, forall(y, L2, x >Int y)) | ||
ensures forall(x, L2, forall(y, L1, x <Int y)) | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "substitution.k" | ||
|
||
module A | ||
|
||
imports INT | ||
imports SUBSTITUTION | ||
|
||
syntax Int ::= KVar | ||
syntax Bool ::= forall(KVar, IntList, Bool) [binder, function, smtlib((forall ((#1 Int)) (=> (inI #1 #2) #3)))] | ||
rule forall(X, V Vs, E) => E[V / X] andBool forall(X, Vs, E) | ||
rule forall(_, .IntList, _) => true | ||
|
||
syntax IntList ::= List{Int,""} | ||
syntax Bool ::= Int "inI" IntList [function, smtlib(inI)] | ||
|
||
syntax KItem ::= foo(IntList) | ||
rule foo(L) => 0 | ||
|
||
syntax KItem ::= bar(IntList, IntList) | ||
rule bar(L1, L2) => 0 | ||
|
||
syntax KVar ::= "x" [token] | ||
| "y" [token] | ||
|
||
endmodule |