diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/specification/compositor/generation/structure.lux | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux index 355b98409..4cc4f0676 100644 --- a/stdlib/source/specification/compositor/generation/structure.lux +++ b/stdlib/source/specification/compositor/generation/structure.lux @@ -31,34 +31,34 @@ (def: (variant run) (-> Runner Test) (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))] - value-in r.i64] - (_.test (%.name (name-of synthesis.variant)) - (|> (synthesis.variant {#analysis.lefts (if last?-in - (dec tag-in) - tag-in) - #analysis.right? last?-in - #analysis.value (synthesis.i64 value-in)}) + [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))] + value_in r.i64] + (_.test (%.name (name_of synthesis.variant)) + (|> (synthesis.variant {#analysis.lefts (if last?_in + (dec tag_in) + tag_in) + #analysis.right? last?_in + #analysis.value (synthesis.i64 value_in)}) (run "variant") (case> (#try.Success valueT) (let [valueT (:as (Array Any) valueT)] (and (n.= 3 (array.size valueT)) - (let [tag-out (:as java/lang/Integer (maybe.assume (array.read 0 valueT))) - last?-out (array.read 1 valueT) - value-out (:as Any (maybe.assume (array.read 2 valueT))) - same-tag? (|> tag-out ffi.int-to-long (:as Nat) (n.= tag-in)) - same-flag? (case last?-out - (#.Some last?-out') - (and last?-in (text\= "" (:as Text last?-out'))) + (let [tag_out (:as java/lang/Integer (maybe.assume (array.read 0 valueT))) + last?_out (array.read 1 valueT) + value_out (:as Any (maybe.assume (array.read 2 valueT))) + same_tag? (|> tag_out ffi.int_to_long (:as Nat) (n.= tag_in)) + same_flag? (case last?_out + (#.Some last?_out') + (and last?_in (text\= "" (:as Text last?_out'))) #.None - (not last?-in)) - same-value? (|> value-out (:as Int) (i.= value-in))] - (and same-tag? - same-flag? - same-value?)))) + (not last?_in)) + same_value? (|> value_out (:as Int) (i.= value_in))] + (and same_tag? + same_flag? + same_value?)))) (#try.Failure _) false))))) @@ -67,16 +67,16 @@ (-> Runner Test) (do {! r.monad} [size (|> r.nat (\ ! map (|>> (n.% 10) (n.max 2)))) - tuple-in (r.list size r.i64)] - (_.test (%.name (name-of synthesis.tuple)) - (|> (synthesis.tuple (list\map (|>> synthesis.i64) tuple-in)) + tuple_in (r.list size r.i64)] + (_.test (%.name (name_of synthesis.tuple)) + (|> (synthesis.tuple (list\map (|>> synthesis.i64) tuple_in)) (run "tuple") - (case> (#try.Success tuple-out) - (let [tuple-out (:as (Array Any) tuple-out)] - (and (n.= size (array.size tuple-out)) + (case> (#try.Success tuple_out) + (let [tuple_out (:as (Array Any) tuple_out)] + (and (n.= size (array.size tuple_out)) (list.every? (function (_ [left right]) (i.= left (:as Int right))) - (list.zipped/2 tuple-in (array.to_list tuple-out))))) + (list.zipped/2 tuple_in (array.to_list tuple_out))))) (#try.Failure _) false))))) |