From a89663b003387e8b206be38a39b7288e82ba72d6 Mon Sep 17 00:00:00 2001 From: imaqtkatt Date: Wed, 10 Apr 2024 09:22:05 -0300 Subject: [PATCH] Remove unused golden tests directory --- tests/golden_tests/examples/all_tree.hvm | 18 -------------- .../examples/alloc_small_tree.hvm | 18 -------------- tests/golden_tests/examples/fib.hvm | 11 --------- .../golden_tests/examples/gen_tree_kind2.hvm | 17 ------------- tests/golden_tests/examples/neg_fusion.hvm | 24 ------------------- 5 files changed, 88 deletions(-) delete mode 100644 tests/golden_tests/examples/all_tree.hvm delete mode 100644 tests/golden_tests/examples/alloc_small_tree.hvm delete mode 100644 tests/golden_tests/examples/fib.hvm delete mode 100644 tests/golden_tests/examples/gen_tree_kind2.hvm delete mode 100644 tests/golden_tests/examples/neg_fusion.hvm diff --git a/tests/golden_tests/examples/all_tree.hvm b/tests/golden_tests/examples/all_tree.hvm deleted file mode 100644 index de7909f9a..000000000 --- a/tests/golden_tests/examples/all_tree.hvm +++ /dev/null @@ -1,18 +0,0 @@ -data Bool = True | False - -data Tree - = (Node lft rgt) - | (Leaf val) - -and True True = True -and _ _ = False - -all (Node lft rgt) = (and (all lft) (all rgt)) -all (Leaf val) = val - -main = (all (gen 8)) - -gen = λn switch n { - 0: (Leaf True) - _: let tree = (gen n-1); (Node tree tree) -} diff --git a/tests/golden_tests/examples/alloc_small_tree.hvm b/tests/golden_tests/examples/alloc_small_tree.hvm deleted file mode 100644 index c3f473319..000000000 --- a/tests/golden_tests/examples/alloc_small_tree.hvm +++ /dev/null @@ -1,18 +0,0 @@ -T = λt λf t -F = λt λf f -And = λpλq (p q F) - -Z = λs λz (z) -S = λn λs λz (s n) - -Add = λa λb (a (S b)) -Mul = λa λb λf (a (b f)) -Pow = λa λb (a (Mul b) (S Z)) - -Node = λa λb λn λl (n a b) -Leaf = λn λl l - -Alloc = λn (n (λp (Node (Alloc p) (Alloc p))) Leaf) -Destroy = λt (t (λaλb (And (Destroy a) (Destroy b))) T) - -Main = (Destroy (Alloc (Pow (S (S Z)) (S (S (S (S Z))))))) diff --git a/tests/golden_tests/examples/fib.hvm b/tests/golden_tests/examples/fib.hvm deleted file mode 100644 index 25264e13f..000000000 --- a/tests/golden_tests/examples/fib.hvm +++ /dev/null @@ -1,11 +0,0 @@ -add = λa λb (+ a b) - -fib = λx switch x { - 0: 1 - _: let p = x-1; switch p { - 0: 1 - _: (+ (fib p) (fib p-1)) - } -} - -main = (fib 30) diff --git a/tests/golden_tests/examples/gen_tree_kind2.hvm b/tests/golden_tests/examples/gen_tree_kind2.hvm deleted file mode 100644 index 8d78ccac0..000000000 --- a/tests/golden_tests/examples/gen_tree_kind2.hvm +++ /dev/null @@ -1,17 +0,0 @@ -_Char = 0 -_List = λ_T 0 -_List.cons = λ_head λ_tail λ_P λ_cons λ_nil ((_cons _head) _tail) -_List.nil = λ_P λ_cons λ_nil _nil -_Nat = 0 -_Nat.succ = λ_n λ_P λ_succ λ_zero (_succ _n) -_Nat.zero = λ_P λ_succ λ_zero _zero -_String = (_List _Char) -_String.cons = λ_head λ_tail λ_P λ_cons λ_nil ((_cons _head) _tail) -_String.nil = λ_P λ_cons λ_nil _nil -_Tree = λ_A 0 -_Tree.gen = λ_n λ_x switch _n = _n { 0: _Tree.leaf _: let _n-1 = _n-1 (((_Tree.node _x) ((_Tree.gen _n-1) (+ (* _x 2) 1))) ((_Tree.gen _n-1) (+ (* _x 2) 2))) } -_Tree.leaf = λ_P λ_node λ_leaf _leaf -_Tree.node = λ_val λ_lft λ_rgt λ_P λ_node λ_leaf (((_node _val) _lft) _rgt) -_main = ((_Tree.gen 8) 2) - -main = _main diff --git a/tests/golden_tests/examples/neg_fusion.hvm b/tests/golden_tests/examples/neg_fusion.hvm deleted file mode 100644 index b7cdf538e..000000000 --- a/tests/golden_tests/examples/neg_fusion.hvm +++ /dev/null @@ -1,24 +0,0 @@ -// size = 1 << 8 - -Mul = λn λm λs (n (m s)) - -// Church nat -C2 = λf λx (f (f x)) - -// Church powers of two -P2 = (Mul C2 C2) // 4 -P3 = (Mul C2 P2) // 8 -P4 = (Mul C2 P3) // 16 -P5 = (Mul C2 P4) // 32 -P6 = (Mul C2 P5) // 64 -P7 = (Mul C2 P6) // 128 -P8 = (Mul C2 P7) // 256 - -// Booleans -True = λt λf t -False = λt λf f -Not = λb ((b False) True) -Neg = λb λt λf (b f t) - -// Negates 'true' 256 times: 'neg' is faster than 'not' because it fuses -Main = (P8 Neg True)