-
Notifications
You must be signed in to change notification settings - Fork 160
Update Dockerfiles to bump standard Z3 version to 4.8.11 #2225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7cc2c57
a3b7e50
60cb5fd
88e423b
16b8d4b
e59c15c
c6c3ba0
c7703fb
ed4339c
ec1577b
c314ad6
9623059
4305a07
7fb373c
9632d87
6a7b22c
0841791
4d09871
7e92f8c
eee0371
038f1a7
79329ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -909,6 +909,10 @@ You can: | |
|
|
||
| * Compute the bitwise complement `~Int` of an integer value in twos-complement. | ||
| * Compute the exponentiation `^Int` of two integers. | ||
| * As implemented above, the frontend will only send integer exponentiation to | ||
| Z3 if both the base and exponent are positive integers. This prevents the K | ||
| frontend from running afoul of the potentially undefined or inconsistent Z3 | ||
| behaviour in cases where `#1` or `#2` are non-positive. | ||
| * Compute the exponentiation of two integers modulo another integer (`^%Int`). | ||
| `A ^%Int B C` is equal in value to `(A ^Int B) %Int C`, but has a better | ||
| asymptotic complexity. | ||
|
|
@@ -930,7 +934,7 @@ You can: | |
| ```k | ||
| syntax Int ::= "~Int" Int [function, klabel(~Int_), symbol, functional, latex(\mathop{\sim_{\scriptstyle\it Int}}{#1}), hook(INT.not), smtlib(notInt)] | ||
| > left: | ||
| Int "^Int" Int [function, klabel(_^Int_), symbol, left, smt-hook(^), latex({#1}\mathrel{{\char`\^}_{\!\scriptstyle\it Int}}{#2}), hook(INT.pow)] | ||
| Int "^Int" Int [function, klabel(_^Int_), symbol, left, smt-hook((ite (and (< 0 #1) (< 0 #2)) 0 (to_int (^ #1 #2)))), latex({#1}\mathrel{{\char`\^}_{\!\scriptstyle\it Int}}{#2}), hook(INT.pow)] | ||
| | Int "^%Int" Int Int [function, klabel(_^%Int__), symbol, left, smt-hook((mod (^ #1 #2) #3)), hook(INT.powmod)] | ||
| > left: | ||
| Int "*Int" Int [function, functional, klabel(_*Int_), symbol, left, smt-hook(*), latex({#1}\mathrel{\ast_{\scriptstyle\it Int}}{#2}), hook(INT.mul)] | ||
|
|
@@ -1055,6 +1059,14 @@ module INT-SYMBOLIC [symbolic] | |
| rule X modInt N => X requires 0 <=Int X andBool X <Int N [simplification] | ||
| rule X %Int N => X requires 0 <=Int X andBool X <Int N [simplification] | ||
|
|
||
| rule 1 ^Int _ => 1 [simplification] | ||
| rule -1 ^Int N => 1 requires N %Int 2 ==Int 0 [simplification] | ||
| rule -1 ^Int N => -1 requires N %Int 2 =/=Int 0 [simplification] | ||
| rule 0 ^Int N => 0 requires N >Int 0 [simplification] | ||
| rule X ^Int N => 0 requires absInt(X) >Int 1 | ||
| andBool N <Int 0 [simplification] | ||
| rule X ^Int 0 => 1 requires X =/=Int 0 [simplification] | ||
|
Comment on lines
+1062
to
+1068
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we double-checked that I remember that |
||
|
|
||
| // Bit-shifts | ||
| rule X <<Int 0 => X [simplification] | ||
| rule 0 <<Int _ => 0 [simplification] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| DEF=test | ||
| EXT=test | ||
| KOMPILE_FLAGS=--syntax-module TEST | ||
| KOMPILE_BACKEND?=haskell | ||
| KPROVE_FLAGS= | ||
|
|
||
| TESTDIR=. | ||
|
|
||
| include ../../../include/kframework/ktest.mak |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| require "test.k" | ||
|
|
||
| module TEST-SPEC | ||
| imports TEST | ||
|
|
||
| claim <k> runLemma(3 ^Int X <=Int 3 ^Int Y) => doneLemma(true) ... </k> | ||
| requires 0 <Int X andBool 0 <Int Y | ||
| andBool X <=Int Y | ||
| endmodule |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| #Top |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| requires "domains.md" | ||
|
|
||
| module TEST | ||
| imports BOOL | ||
| imports INT-SYMBOLIC | ||
|
|
||
| syntax KItem ::= runLemma ( Bool ) | doneLemma ( Bool ) | ||
| // ------------------------------------------------------- | ||
| rule <k> runLemma(B) => doneLemma(B) ... </k> | ||
|
|
||
| rule N ^Int N' <=Int M ^Int M' => true | ||
| requires 0 <Int N andBool 0 <Int N' | ||
| andBool 0 <Int M andBool 0 <Int M' | ||
| andBool N <=Int M andBool N' <=Int M' | ||
| [simplification, smt-lemma] | ||
|
|
||
| endmodule |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,13 +10,13 @@ RUN apt-get update \ | |
| git \ | ||
| python | ||
|
|
||
| RUN git clone 'https://github.com/z3prover/z3' --branch=z3-4.8.6 \ | ||
| && cd z3 \ | ||
| && python scripts/mk_make.py \ | ||
| && cd build \ | ||
| && make -j8 \ | ||
| && make install \ | ||
| && cd ../.. \ | ||
| RUN git clone 'https://github.com/z3prover/z3' --branch=z3-4.8.11 \ | ||
| && cd z3 \ | ||
| && python scripts/mk_make.py \ | ||
| && cd build \ | ||
| && make -j8 \ | ||
|
Comment on lines
+13
to
+17
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we actually need to adjust the packgaing rules...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dwightguth how do we want to approach this? Should K bundle its own Z3, or we just have instructions for people that they must separately install the correct Z3. |
||
| && make install \ | ||
| && cd ../.. \ | ||
| && rm -rf z3 | ||
|
|
||
| COPY kframework_amd64_bionic.deb /kframework_amd64_bionic.deb | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you're trying to encode here. This encoding means
if (> #1 0) and (> #2 0), then 0, else (to_int (^ #1 #2)), which doesn't sound correct to me.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to do this?UPDATE: please ignore this. it doesn't work, type-error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if you have
(< 0 #2), you don't need to add(< 0 #1), right? I mean,X ^ Nwill be well-defined for all X, if N > 0, right?