diff options
Diffstat (limited to 'new-luxc/test/test/luxc/lang/synthesis/loop.lux')
-rw-r--r-- | new-luxc/test/test/luxc/lang/synthesis/loop.lux | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/new-luxc/test/test/luxc/lang/synthesis/loop.lux b/new-luxc/test/test/luxc/lang/synthesis/loop.lux index 23641780f..af818255b 100644 --- a/new-luxc/test/test/luxc/lang/synthesis/loop.lux +++ b/new-luxc/test/test/luxc/lang/synthesis/loop.lux @@ -2,7 +2,7 @@ lux (lux [io] (control [monad #+ do]) - (data [bool "bool/" Eq<Bool>] + (data [bit "bit/" Eq<Bit>] [number] (coll [list "list/" Functor<List> Fold<List>] (set ["set" unordered])) @@ -18,7 +18,7 @@ (// common)) (def: (does-recursion? arity exprS) - (-> ls.Arity ls.Synthesis Bool) + (-> ls.Arity ls.Synthesis Bit) (loop [exprS exprS] (case exprS (^ [_ (#.Form (list [_ (#.Text "lux case")] inputS pathS))]) @@ -68,19 +68,19 @@ (wrap (` ("lux case" (~ inputA) (~ (code.record (list.zip2 tests bodies)))))))) (r.either (do r.Monad<Random> - [valueS r.bool + [valueS r.bit output' (gen-body (n/inc arity) output)] - (wrap (` ("lux case" (~ (code.bool valueS)) + (wrap (` ("lux case" (~ (code.bit valueS)) {("lux case bind" (~ (code.nat arity))) (~ output')})))) (do r.Monad<Random> - [valueS r.bool - then|else r.bool + [valueS r.bit + then|else r.bit output' (gen-body arity output) #let [thenA (if then|else output' (' [])) elseA (if (not then|else) output' (' []))]] - (wrap (` ("lux case" (~ (code.bool valueS)) - {(~ (code.bool then|else)) (~ thenA) - (~ (code.bool (not then|else))) (~ elseA)}))))) + (wrap (` ("lux case" (~ (code.bit valueS)) + {(~ (code.bit then|else)) (~ thenA) + (~ (code.bit (not then|else))) (~ elseA)}))))) )) (def: (make-function arity body) @@ -90,14 +90,14 @@ _ (` ("lux function" [] (~ (make-function (n/dec arity) body)))))) (def: gen-recursion - (r.Random [Bool Nat la.Analysis]) + (r.Random [Bit Nat la.Analysis]) (do r.Monad<Random> [arity (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) - recur? r.bool + recur? r.bit outputS (if recur? (wrap (la.apply (list.repeat arity (' [])) (la.var 0))) (do @ - [plus-or-minus? r.bool + [plus-or-minus? r.bit how-much (|> r.nat (:: @ map (|>> (n/% arity) (n/max +1)))) #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) (la.var 0))))) @@ -105,17 +105,17 @@ (wrap [recur? arity (make-function arity bodyS)]))) (def: gen-loop - (r.Random [Bool Nat la.Analysis]) + (r.Random [Bit Nat la.Analysis]) (do r.Monad<Random> [arity (|> r.nat (:: @ map (|>> (n/% +10) (n/max +1)))) - recur? r.bool - self-ref? r.bool + recur? r.bit + self-ref? r.bit #let [selfA (la.var 0) argA (if self-ref? selfA (' []))] outputS (if recur? (wrap (la.apply (list.repeat arity argA) selfA)) (do @ - [plus-or-minus? r.bool + [plus-or-minus? r.bit how-much (|> r.nat (:: @ map (|>> (n/% arity) (n/max +1)))) #let [shift (if plus-or-minus? n/+ n/-)]] (wrap (la.apply (list.repeat (shift how-much arity) (' [])) selfA)))) @@ -135,7 +135,7 @@ (^ [_ (#.Form (list [_ (#.Text "lux function")] [_ (#.Nat _arity)] [_ (#.Tuple _env)] _body))]) (|> _body (does-recursion? arity) - (bool/= prediction) + (bit/= prediction) (and (n/= arity _arity))) _ |