-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from uclid-org/fix-242
Fix Type Checking + Type Declaration Bugs with ADTs
- Loading branch information
Showing
6 changed files
with
82 additions
and
11 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
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,17 @@ | ||
module main { | ||
type t = record {a: integer, b: integer}; | ||
datatype option_t = Some(value: t) | None(); | ||
|
||
var x: option_t; | ||
var y: t; | ||
|
||
init { | ||
assert x.value == y; | ||
} | ||
|
||
control { | ||
bmc(0); | ||
check; | ||
print_results; | ||
} | ||
} |
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,33 @@ | ||
|
||
|
||
module main { | ||
|
||
type e_t = enum {X, Y, Z}; | ||
|
||
datatype adt_t = | ||
A (a: e_t) | B (b : e_t, c: e_t); | ||
|
||
|
||
var adt1 : adt_t; | ||
var adt2 : adt_t; | ||
|
||
init { | ||
adt1 = A(Y); | ||
adt2 = B(Y, Y); | ||
} | ||
|
||
next { | ||
adt1' = A(adt2.b); | ||
adt2' = B(adt1.a, adt2.c); | ||
} | ||
|
||
property match: adt1.a == adt2.b; | ||
|
||
control { | ||
v = bmc(2); | ||
check; | ||
print_results; | ||
v.print_cex_json(); | ||
} | ||
|
||
} |