chore: fill in machine todos and cost model for case and constr

This allows for several more tests to pass
**Had to remove case-7 since it was incorrectly passing before**
This commit is contained in:
microproofs
2023-11-17 19:52:03 -05:00
parent 0382e5ce12
commit 1567e42875
24 changed files with 60 additions and 12 deletions

View File

@@ -0,0 +1,4 @@
-- select first branch
(program 1.1.0
(case (constr 0 (con integer 0)) (lam x (con integer 1)) (lam x (con integer 2)))
)

View File

@@ -0,0 +1 @@
(program 1.1.0 (con integer 1))

View File

@@ -0,0 +1,4 @@
-- select second branch
(program 1.1.0
(case (constr 1 (con integer 0)) (lam x (con integer 1)) (lam x (con integer 2)))
)

View File

@@ -0,0 +1 @@
(program 1.1.0 (con integer 2))

View File

@@ -0,0 +1,4 @@
-- select first branch and do computation with the args
(program 1.1.0
(case (constr 0 (con integer 3) (con integer 2)) (lam x (lam y [(builtin addInteger) x y])) (lam x (lam y [(builtin subtractInteger) x y])))
)

View File

@@ -0,0 +1 @@
(program 1.1.0 (con integer 5))

View File

@@ -0,0 +1,4 @@
-- select second branch and do computation with the args
(program 1.1.0
(case (constr 1 (con integer 3) (con integer 2)) (lam x (lam y [(builtin addInteger) x y])) (lam x (lam y [(builtin subtractInteger) x y])))
)

View File

@@ -0,0 +1 @@
(program 1.1.0 (con integer 1))

View File

@@ -0,0 +1,4 @@
-- case of non-constr
(program 1.1.0
(case (con integer 1) (lam x x) (lam x x))
)

View File

@@ -0,0 +1 @@
evaluation failure

View File

@@ -1,4 +0,0 @@
-- case can't be used before 1.1.0
(program 1.0.0
(case (con integer 1))
)

View File

@@ -0,0 +1,4 @@
-- nullary case
(program 1.1.0
(case (constr 0) (con integer 1) (con integer 2))
)

View File

@@ -0,0 +1 @@
(program 1.1.0 (con integer 1))

View File

@@ -0,0 +1,4 @@
-- empty case, aka -XEmptyCase
(program 1.1.0
(case (constr 0))
)

View File

@@ -0,0 +1 @@
evaluation failure

View File

@@ -0,0 +1,4 @@
-- empty constr
(program 1.1.0
(constr 0 )
)

View File

@@ -0,0 +1 @@
(program 1.1.0 (constr 0))

View File

@@ -0,0 +1,4 @@
-- constr with an argument
(program 1.1.0
(constr 0 (con integer 1))
)

View File

@@ -0,0 +1 @@
(program 1.1.0 (constr 0 (con integer 1)))