Skip to content

Commit

Permalink
add testcase with both cyclic and acyclic constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
K9-guardian committed Jan 30, 2024
1 parent f7ec60b commit 07321ac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Language/Fixpoint/Horn/Transformations.hs
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ substPred su (Var k xs) = Var k $ upd <$> xs
-- (and (forall ((x int) (x > 0)) (and (forall ((y int) (y > x + 100)) (forall ((v int) (v == x + y)) ((true)))) (forall ((y int) (y > x + 100)) (forall ((v int) (v == x + y)) (forall ((z int) (z == v)) (forall ((v int) (v == x + z)) ((v > 100)))))))))
-- >>> elim defConfig . fst <$> parseFromFile hornP "tests/horn/pos/test03.smt2"
-- (and (and (forall ((x int) (x > 0)) (forall ((v int) (v == x)) (($k0 v)))) (forall ((y int) ($k0 y)) (forall ((v int) (v == y + 1)) (($k0 v)))) (forall ((z int) ($k0 z)) ((z > 0)))))
-- >>> elim defConfig . fst <$> parseFromFile hornP "tests/horn/pos/test04.smt2"
-- (and (forall ((x int) (x > 0)) (forall ((v int) (v == x)) (($k0 v)))) (forall ((y int) ($k0 y)) (forall ((yyy int) (true)) (forall ((vvv int) (vvv == yyy + 1)) (forall ((v int) (and (v == vvv) (y == yyy))) (($k0 v)))))) (forall ((z int) ($k0 z)) ((z > 0))))
------------------------------------------------------------------------------
elim :: (F.PPrint a) => F.Config -> Query a -> Cstr a
------------------------------------------------------------------------------
Expand Down
20 changes: 20 additions & 0 deletions tests/horn/pos/test04.smt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// TODO move to actual SMTLIB format

(var $k0 ((Int)))
(var $k1 ((int) (int)))

(qualif Foo ((v Int)) ((v > 0)))

(constraint
(and
(forall ((yyy Int) (true))
(forall ((vvv Int) (vvv = yyy + 1))
(($k1 vvv yyy))))
(forall ((x Int) (x > 0))
(forall ((v Int) (v = x))
(($k0 v))))
(forall ((y Int) ($k0 y))
(forall ((v Int) ($k1 v y))
(($k0 v))))
(forall ((z Int) ($k0 z))
((z > 0)))))

0 comments on commit 07321ac

Please sign in to comment.