Skip to content

Commit

Permalink
fix data type hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoAureliano committed Jul 4, 2024
1 parent 6f3f8da commit 512a640
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
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
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;
}
}

0 comments on commit 512a640

Please sign in to comment.