Skip to content

Commit

Permalink
Regression
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreynol committed Oct 30, 2024
1 parent 8a2d988 commit 4e54736
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ set(ethos_test_file_list
simple-lra-reference.eo
left-cons.eo
overload-standalone.eo
datatypes-split-rule.eo
)

if(ENABLE_ORACLES)
Expand Down
23 changes: 23 additions & 0 deletions tests/datatypes-split-rule.eo
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(declare-type Int ())
(declare-datatypes ((Lst 0)) (((cons (head Int) (tail Lst)) (nil))))


(declare-const is (-> (! Type :var C :implicit) (! Type :var D :implicit) C D Bool))
(declare-const or (-> Bool Bool Bool) :right-assoc-nil false)

(program $mk_split ((D Type) (x D) (T Type) (c T) (xs eo::List :list))
(eo::List D) Bool
(
(($mk_split eo::List::nil x) false)
(($mk_split (eo::List::cons c xs) x) (eo::cons or (is c x) ($mk_split xs x)))
)
)

(declare-rule dt-split ((D Type) (x D))
:args (x)
:conclusion ($mk_split (eo::defof (eo::typeof x)) x)
)

(declare-const x Lst)

(step @p0 (or (is cons x) (is nil x)) :rule dt-split :args (x))

0 comments on commit 4e54736

Please sign in to comment.