diff options
author | Eduardo Julian | 2021-08-18 03:29:15 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-08-18 03:29:15 -0400 |
commit | e00ba096c8837abe85d366e0c1293c09dbe84d81 (patch) | |
tree | dc1f0955d4461ae30bb4945cddd74c462f1aee98 /stdlib/source/specification/compositor/generation | |
parent | 3289b9dcf9d5d1c1e5c380e3185065c8fd32535f (diff) |
Some bug fixes.
Diffstat (limited to '')
3 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux index 371a89162..8508220ed 100644 --- a/stdlib/source/specification/compositor/generation/case.lux +++ b/stdlib/source/specification/compositor/generation/case.lux @@ -36,7 +36,7 @@ (def: (tail? size idx) (-> Nat Nat Bit) - (n.= (dec size) idx)) + (n.= (-- size) idx)) (def: .public (verify expected) (-> Frac (Try Any) Bit) @@ -70,9 +70,9 @@ [subS subP] case .let [unitS (synthesis.text synthesis.unit) caseS (synthesis.tuple - (list.joined (list (list.repeated idx unitS) - (list subS) - (list.repeated (|> size dec (n.- idx)) unitS)))) + (list.together (list (list.repeated idx unitS) + (list subS) + (list.repeated (|> size -- (n.- idx)) unitS)))) caseP ($_ synthesis.path/seq (if (tail? size idx) (synthesis.member/right idx) diff --git a/stdlib/source/specification/compositor/generation/function.lux b/stdlib/source/specification/compositor/generation/function.lux index c3143b958..8a090094f 100644 --- a/stdlib/source/specification/compositor/generation/function.lux +++ b/stdlib/source/specification/compositor/generation/function.lux @@ -34,7 +34,7 @@ (def: (local arity) (-> Arity (Random Register)) - (|> r.nat (r\map (|>> (n.% arity) inc)))) + (|> r.nat (r\map (|>> (n.% arity) ++)))) (def: function (Random [Arity Register Synthesis]) @@ -53,7 +53,7 @@ [[arity local functionS] ..function partial_arity (|> r.nat (\ ! map (|>> (n.% arity) (n.max 1)))) inputs (r.list arity r.safe_frac) - .let [expectation (maybe.trusted (list.item (dec local) inputs)) + .let [expectation (maybe.trusted (list.item (-- local) inputs)) inputsS (list\map (|>> synthesis.f64) inputs)]] ($_ _.and (_.test "Can read arguments." @@ -77,7 +77,7 @@ (enum.range n.enum 1) (list\map (|>> #reference.Local))) variableS (if (n.<= partial_arity local) - (synthesis.variable/foreign (dec local)) + (synthesis.variable/foreign (-- local)) (synthesis.variable/local (|> local (n.- partial_arity)))) inner_arity (n.- partial_arity arity) innerS (synthesis.function/abstraction diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux index b1f0e5666..de61ed882 100644 --- a/stdlib/source/specification/compositor/generation/structure.lux +++ b/stdlib/source/specification/compositor/generation/structure.lux @@ -33,11 +33,11 @@ (do {! r.monad} [num_tags (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2)))) tag_in (|> r.nat (\ ! map (n.% num_tags))) - .let [last?_in (|> num_tags dec (n.= tag_in))] + .let [last?_in (|> num_tags -- (n.= tag_in))] value_in r.i64] (_.test (%.name (name_of synthesis.variant)) (|> (synthesis.variant {#analysis.lefts (if last?_in - (dec tag_in) + (-- tag_in) tag_in) #analysis.right? last?_in #analysis.value (synthesis.i64 value_in)}) |