Skip to content
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

Fix data type hashing; fix 253 #254

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/scala/uclid/smt/SMTLanguage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ case object UndefinedType extends Type {

case class DataType(id : String, cstors : List[ConstructorType]) extends Type {
override val hashId = 111
override val hashCode = finalize(hashId, 0)
override val md5hashCode = computeMD5Hash
override val hashCode = computeHash(id, cstors)
override val md5hashCode = computeMD5Hash(id, cstors)
override def toString = "data " + cstors // TODO
override val typeNamePrefix = "data"
override def isUndefined = true
Expand Down
5 changes: 3 additions & 2 deletions src/test/scala/SMTLIB2Spec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,15 @@ class SMTLIB2Spec extends AnyFlatSpec {
"issue-187b.ucl" should "verify all assertions." in {
SMTLIB2Spec.expectedFails("./test/issue-187b.ucl", 0)
}
"issue-253.ucl" should "fail all 2 assertions." in {
SMTLIB2Spec.expectedFails("./test/issue-253.ucl", 2)
}
"issue-255.ucl" should "faill single assertion." in {
SMTLIB2Spec.expectedFails("./test/issue-255.ucl", 1)
}
"test-redundant-assign.ucl" should "verify all assertions." in {
SMTLIB2Spec.expectedFails("./test/test-redundant-assign.ucl", 0)
}


"test-history-1.ucl" should "verify all assertions." in {
SMTLIB2Spec.expectedFails("./test/test-history-1.ucl", 0)
}
Expand Down
19 changes: 19 additions & 0 deletions test/issue-253.ucl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module main {
datatype adt1 = A() | B();
datatype adt2 = C() | D();

var y: adt1;
var x: adt2;

init {
assert y == B();
assert x == C();
}


control {
bmc(0);
check;
print_results;
}
}
Loading