Skip to content

Commit 3d0139a

Browse files
==Int simplification (#2129)
* Add test * Pedantic * Remove comments
1 parent a29d02f commit 3d0139a

File tree

1 file changed

+24
-0
lines changed
  • kore/test/Test/Kore/Builtin

1 file changed

+24
-0
lines changed

kore/test/Test/Kore/Builtin/Int.hs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,30 @@ test_unifyIntEq =
587587
& Condition.fromPredicate
588588
& simplifyCondition'
589589
assertEqual "" [expect { term = () }] actual
590+
, testCase "\\equals(X +Int 1 ==Int Y +Int 1, false)" $ do
591+
let term1 =
592+
eqInt
593+
(addInt (mkElemVar x) (asInternal 1))
594+
(addInt (mkElemVar y) (asInternal 1))
595+
term2 = Test.Bool.asInternal False
596+
expect =
597+
makeEqualsPredicate_
598+
(addInt (mkElemVar x) (asInternal 1))
599+
(addInt (mkElemVar y) (asInternal 1))
600+
& makeNotPredicate
601+
& Condition.fromPredicate
602+
& Pattern.fromCondition_
603+
-- unit test
604+
do
605+
actual <- unifyIntEq term1 term2
606+
assertEqual "" [Just expect] actual
607+
-- integration test
608+
do
609+
actual <-
610+
makeEqualsPredicate_ term1 term2
611+
& Condition.fromPredicate
612+
& simplifyCondition'
613+
assertEqual "" [expect { term = () }] actual
590614
]
591615
where
592616
x, y :: ElementVariable VariableName

0 commit comments

Comments
 (0)