-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bind
it
even when no counterexample/sat is available; add tests
Similar to what @weaversa requested in #66, we bind `it` to `False` when we can't find a sat assignment, and `it` to `True` when we've proved a theorem. Also adds some simple tests for the sat/prove result binding, and let binding at the repl.
- Loading branch information
Adam C. Foltzer
committed
Aug 20, 2014
1 parent
5a3c01a
commit b78062e
Showing
7 changed files
with
74 additions
and
3 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
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,5 @@ | ||
f : [32] -> [32] | ||
f x = x + 2 | ||
|
||
g : [32] -> [32] | ||
g x = f x + 1 |
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,7 @@ | ||
:l issue006.cry | ||
g 5 | ||
let f x = 0 | ||
g 5 | ||
(f : [32] -> [32]) 5 | ||
let f x = if (x : [32]) == 0 then 1 else x * (f (x - 1)) | ||
f 5 |
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,7 @@ | ||
Loading module Cryptol | ||
Loading module Cryptol | ||
Loading module Main | ||
8 | ||
8 | ||
0 | ||
120 |
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,22 @@ | ||
let f x = (x : [4]) == x | ||
:prove f | ||
:t it | ||
it | ||
let f x = (x : [4]) == 3 | ||
:prove f | ||
:t it | ||
it | ||
:sat f | ||
:t it | ||
it | ||
let f x = (x : [4]) == 3 && x == 2 | ||
:sat f | ||
:t it | ||
it | ||
let g p = (p : { x : [32], y : [32]}).x == p.y | ||
:prove g | ||
:t it | ||
it | ||
:sat g | ||
:t it | ||
it |
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,19 @@ | ||
Loading module Cryptol | ||
Q.E.D. | ||
it : Bit | ||
True | ||
f 0 = False | ||
it : [4] | ||
0 | ||
f 3 = True | ||
it : [4] | ||
3 | ||
Unsatisfiable. | ||
it : Bit | ||
False | ||
g {x = 0, y = 1} = False | ||
it : {x : [32], y : [32]} | ||
{x = 0, y = 1} | ||
g {x = 0, y = 0} = True | ||
it : {x : [32], y : [32]} | ||
{x = 0, y = 0} |