diff options
author | Eduardo Julian | 2022-01-19 06:06:10 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-01-19 06:06:10 -0400 |
commit | f47fb7404bcbd9fac5df8697e57e08f03ec468ac (patch) | |
tree | 0e744df7371ffbfed6fac03911e4a1982f32a0ec /stdlib/source/test | |
parent | 4fb3c45f9d0e91cbfe5714c7de2189cddb0abad7 (diff) |
Fixes for the pure-Lux JVM compiler machinery. [Part 8]
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/data.lux | 44 | ||||
-rw-r--r-- | stdlib/source/test/lux/data/text/escape.lux | 62 | ||||
-rw-r--r-- | stdlib/source/test/lux/target/ruby.lux | 68 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool.lux | 9 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux | 439 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/language/lux/analysis/complex.lux (renamed from stdlib/source/test/lux/tool/compiler/language/lux/analysis/composite.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux | 4 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux | 108 |
8 files changed, 617 insertions, 121 deletions
diff --git a/stdlib/source/test/lux/data.lux b/stdlib/source/test/lux/data.lux index 40112aeb9..631a72b76 100644 --- a/stdlib/source/test/lux/data.lux +++ b/stdlib/source/test/lux/data.lux @@ -1,26 +1,26 @@ (.using - [library - [lux "*" - ["_" test {"+" Test}] - [abstract - [monad {"+" do}]] - [math - ["[0]" random]]]] - ["[0]" / "_" - ["[1][0]" binary] - ["[1][0]" bit] - ["[1][0]" color - ["[1]/[0]" named]] - ["[1][0]" identity] - ["[1][0]" product] - ["[1][0]" sum] - ["[1][0]" text] - ["[1][0]" format "_" - ["[1]/[0]" binary] - ["[1]/[0]" json] - ["[1]/[0]" tar] - ["[1]/[0]" xml]] - ["[1][0]" collection]]) + [library + [lux "*" + ["_" test {"+" Test}] + [abstract + [monad {"+" do}]] + [math + ["[0]" random]]]] + ["[0]" / "_" + ["[1][0]" binary] + ["[1][0]" bit] + ["[1][0]" color + ["[1]/[0]" named]] + ["[1][0]" identity] + ["[1][0]" product] + ["[1][0]" sum] + ["[1][0]" text] + ["[1][0]" format "_" + ["[1]/[0]" binary] + ["[1]/[0]" json] + ["[1]/[0]" tar] + ["[1]/[0]" xml]] + ["[1][0]" collection]]) ... TODO: Get rid of this ASAP (template: (!bundle body) diff --git a/stdlib/source/test/lux/data/text/escape.lux b/stdlib/source/test/lux/data/text/escape.lux index 7a55f2594..6abb32e94 100644 --- a/stdlib/source/test/lux/data/text/escape.lux +++ b/stdlib/source/test/lux/data/text/escape.lux @@ -1,35 +1,35 @@ (.using - [library - [lux "*" - ["_" test {"+" Test}] - ["[0]" debug] - ["[0]" meta] - [abstract - [monad {"+" do}]] - [control - ["[0]" try] - ["[0]" exception] - [parser - ["<[0]>" code]]] - [data - ["[0]" bit ("[1]#[0]" equivalence)] - ["[0]" text {"+" Char} ("[1]#[0]" equivalence) - ["%" format {"+" format}]] - [collection - ["[0]" set {"+" Set}]]] - [macro - [syntax {"+" syntax:}] - ["[0]" code] - ["[0]" template]] - [math - ["[0]" random {"+" Random}] - [number {"+" hex} - ["n" nat]]]]] - [\\library - ["[0]" / - [// - ["[0]" unicode "_" - ["[1]" set]]]]]) + [library + [lux "*" + ["_" test {"+" Test}] + ["[0]" debug] + ["[0]" meta] + [abstract + [monad {"+" do}]] + [control + ["[0]" try] + ["[0]" exception] + [parser + ["<[0]>" code]]] + [data + ["[0]" bit ("[1]#[0]" equivalence)] + ["[0]" text {"+" Char} ("[1]#[0]" equivalence) + ["%" format {"+" format}]] + [collection + ["[0]" set {"+" Set}]]] + [macro + [syntax {"+" syntax:}] + ["[0]" code] + ["[0]" template]] + [math + ["[0]" random {"+" Random}] + [number {"+" hex} + ["n" nat]]]]] + [\\library + ["[0]" / + [// + ["[0]" unicode "_" + ["[1]" set]]]]]) (def: (range max min) (-> Char Char (Random Char)) diff --git a/stdlib/source/test/lux/target/ruby.lux b/stdlib/source/test/lux/target/ruby.lux index 5e2cecbde..2a2f9667d 100644 --- a/stdlib/source/test/lux/target/ruby.lux +++ b/stdlib/source/test/lux/target/ruby.lux @@ -230,7 +230,21 @@ (do [! random.monad] [size (# ! each (|>> (n.% 10) ++) random.nat) index (# ! each (n.% size) random.nat) - items (random.list size random.safe_frac)] + items (random.list size random.safe_frac) + $class (# ! each (|>> %.nat (format "class_") /.local) + random.nat) + $method/0 (# ! each (|>> %.nat (format "method_") /.local) + random.nat) + $method/1 (|> random.nat + (# ! each (|>> %.nat (format "method_") /.local)) + (random.only (|>> (# /.equivalence = $method/0) not))) + $arg/0 (# ! each (|>> %.nat (format "arg_") /.local) + random.nat) + $state (# ! each (|>> %.nat (format "instance_") /.instance) + random.nat) + single random.safe_frac + .let [double (/.function $method/0 (list $arg/0) + (/.return (/.+ $arg/0 $arg/0)))]] ($_ _.and (_.cover [/.the] (expression (|>> (:as Int) (i.= (.int size))) @@ -243,6 +257,44 @@ (|>> (:as Frac) (f.= expected))) (|> (/.array (list#each /.float items)) (/.do "at" (list (/.int (.int index))) {.#None})))) + (_.cover [/.class] + (expression (|>> (:as Frac) (f.= (f.+ single single))) + (|> ($_ /.then + (/.set (list $class) (/.class [/.#parameters (list) + /.#body double])) + (/.return (|> $class + (/.new (list) {.#None}) + (/.do (/.code $method/0) (list (/.float single)) {.#None})))) + [(list)] (/.lambda {.#None}) + (/.apply_lambda/* (list))))) + (_.cover [/.new /.initialize] + (expression (|>> (:as Frac) (f.= single)) + (|> ($_ /.then + (/.set (list $class) (/.class [/.#parameters (list) + /.#body ($_ /.then + (/.function /.initialize (list $arg/0) + (/.set (list $state) $arg/0)) + (/.function $method/0 (list) + (/.return $state)) + )])) + (/.return (|> $class + (/.new (list (/.float single)) {.#None}) + (/.do (/.code $method/0) (list) {.#None})))) + [(list)] (/.lambda {.#None}) + (/.apply_lambda/* (list))))) + (_.cover [/.alias_method/2] + (expression (|>> (:as Frac) (f.= (f.+ single single))) + (|> ($_ /.then + (/.set (list $class) (/.class [/.#parameters (list) + /.#body ($_ /.then + double + (/.statement (/.alias_method/2 (/.string (/.code $method/1)) + (/.string (/.code $method/0)))))])) + (/.return (|> $class + (/.new (list) {.#None}) + (/.do (/.code $method/1) (list (/.float single)) {.#None})))) + [(list)] (/.lambda {.#None}) + (/.apply_lambda/* (list))))) ))) (def: test|computation @@ -306,6 +358,16 @@ ($_ _.and (<| (_.for [/.Var]) ($_ _.and + (_.cover [/.defined?/1] + (and (expression (|>> (:as Bit)) + (|> (/.defined?/1 $foreign) + (/.= /.nil))) + (expression (|>> (:as Text) (text#= "local-variable")) + (|> ($_ /.then + (/.set (list $foreign) (/.float float/0)) + (/.return (/.defined?/1 $foreign))) + [(list)] (/.lambda {.#None}) + (/.apply_lambda/* (list)))))) (_.cover [/.LVar /.local /.set] (expression (|>> (:as Frac) (f.= (f.+ float/0 float/0))) (|> ($_ /.then @@ -534,7 +596,7 @@ (/.statement (/.raise (/.string error))) (/.return (/.float dummy))) (list [(list) $ex (/.return ($_ /.and - (/.do "kind_of?" (list (/.local "Array")) {.#None} /.latest_error_location) + (/.do "kind_of?" (list (: /.CVar (/.manual "Array"))) {.#None} /.latest_error_location) (/.> (/.int +0) (/.the "length" /.latest_error_location))))])) [(list)] (/.lambda {.#None}) (/.apply_lambda/* (list)))))) @@ -652,7 +714,7 @@ [(list $arg/0 $arg/1)] (/.lambda {.#None}) (/.apply_lambda/* (list (/.float float/0) (/.float float/1)))))) (_.cover [/.require/1] - (let [$JSON (/.local "JSON")] + (let [$JSON (: /.CVar (/.manual "JSON"))] (expression (|>> (:as Text) (text#= expected)) (|> ($_ /.then (/.statement (/.require/1 (/.string "json"))) diff --git a/stdlib/source/test/lux/tool.lux b/stdlib/source/test/lux/tool.lux index 6dc3eabd9..635322a92 100644 --- a/stdlib/source/test/lux/tool.lux +++ b/stdlib/source/test/lux/tool.lux @@ -11,10 +11,7 @@ [language [lux ... ["[1][0]" syntax] - ["[1][0]" analysis "_" - ["[1]/[0]" simple] - ["[1]/[0]" composite] - ["[1]/[0]" pattern]] + ["[1][0]" analysis] ["[1][0]" phase "_" ["[1]/[0]" extension] ... ["[1]/[0]" analysis] @@ -35,9 +32,7 @@ /version.test /reference.test /phase.test - /analysis/simple.test - /analysis/composite.test - /analysis/pattern.test + /analysis.test /meta/archive/artifact.test /meta/archive/signature.test /meta/archive/key.test diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux new file mode 100644 index 000000000..210d6d29a --- /dev/null +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis.lux @@ -0,0 +1,439 @@ +(.using + [library + [lux "*" + ["_" test {"+" Test}] + ["[0]" static] + [abstract + [monad {"+" do}] + [\\specification + ["$[0]" equivalence]]] + [control + [pipe {"+" case>}] + ["[0]" maybe] + ["[0]" try] + ["[0]" exception {"+" exception:}]] + [data + ["[0]" bit ("[1]#[0]" equivalence)] + ["[0]" text ("[1]#[0]" equivalence)] + [collection + ["[0]" list]]] + [macro + ["[0]" template]] + [math + ["[0]" random {"+" Random} ("[1]#[0]" monad)] + [number + ["f" frac]]]]] + ["[0]" / "_" + ["[1][0]" simple] + ["[1][0]" complex] + ["[1][0]" pattern] + [//// + ["[1][0]" reference + ["[2][0]" variable]] + [/// + [meta + ["[1][0]" symbol] + ["[0]" location "_" + ["[2][1]" /] + ["[1]" \\library ("[1]#[0]" equivalence)]]]]]] + [\\library + ["[0]" / + [// + [phase + ["[0]" extension]] + [/// + ["[0]" phase] + ["[0]" version]]]]]) + +(def: (random_branch random) + (All (_ a) (-> (Random a) (Random (/.Branch' a)))) + ($_ random.and + /pattern.random + random + )) + +(def: (random_match multiplicity random) + (All (_ a) (-> Nat (Random a) (Random (/.Match' a)))) + ($_ random.and + (..random_branch random) + (random.list multiplicity (..random_branch random)) + )) + +(def: .public (random multiplicity) + (-> Nat (Random /.Analysis)) + (<| random.rec + (function (_ random)) + (let [random|case ($_ random.and + random + (..random_match multiplicity random) + ) + random|function ($_ random.and + (random.list multiplicity random) + random + ) + random|apply ($_ random.and + random + random + ) + random|extension ($_ random.and + (random.ascii/lower 1) + (random.list multiplicity random) + )]) + ($_ random.or + /simple.random + (/complex.random multiplicity random) + /reference.random + random|case + random|function + random|apply + random|extension + ))) + +(def: test|simple + Test + (do random.monad + [bit random.bit + nat random.nat + int random.int + rev random.rev + frac random.frac + text (random.ascii/lower 1)] + (`` ($_ _.and + (_.cover [/.unit] + (case (/.unit) + (^ (/.unit)) + true + + _ + false)) + (~~ (template [<tag> <expected>] + [(_.cover [<tag>] + (case (<tag> <expected>) + (^ (<tag> actual)) + (same? <expected> actual) + + _ + false))] + + [/.bit bit] + [/.nat nat] + [/.int int] + [/.rev rev] + [/.frac frac] + [/.text text])) + )))) + +(def: test|complex + Test + (do random.monad + [expected_left (..random 2) + expected_right (..random 2) + expected_lefts random.nat + expected_right? random.bit] + ($_ _.and + (_.cover [/.variant] + (let [expected (if expected_right? + expected_right + expected_left)] + (case (/.variant [expected_lefts expected_right? expected]) + (^ (/.variant [actual_lefts actual_right? actual])) + (and (same? expected_lefts actual_lefts) + (same? expected_right? actual_right?) + (same? expected actual)) + + _ + false))) + (_.cover [/.tuple] + (case (/.tuple (list expected_left expected_right)) + (^ (/.tuple (list actual_left actual_right))) + (and (same? expected_left actual_left) + (same? expected_right actual_right)) + + _ + false)) + ))) + +(def: test|reference + Test + (do random.monad + [expected_register random.nat + expected_constant (/symbol.random 1 1) + expected_variable /variable.random] + (`` ($_ _.and + (~~ (template [<tag> <expected>] + [(_.cover [<tag>] + (case (<tag> <expected>) + (^ (<tag> actual)) + (same? <expected> actual) + + _ + false))] + + [/.variable/local expected_register] + [/.variable/foreign expected_register] + [/.constant expected_constant] + [/.variable expected_variable] + )) + )))) + +(template: (tagged? <tag> <it>) + [(case <it> + {<tag> _} + true + + _ + false)]) + +(def: test|application + Test + (do random.monad + [expected_abstraction (random.only (|>> (..tagged? /.#Apply) not) + (..random 2)) + expected_parameter/0 (..random 2) + expected_parameter/1 (..random 2)] + ($_ _.and + (_.cover [/.apply /.application] + (case (|> [expected_abstraction (list expected_parameter/0 expected_parameter/1)] + /.apply + /.application) + (^ [actual_abstraction (list actual_parameter/0 actual_parameter/1)]) + (and (same? expected_abstraction actual_abstraction) + (same? expected_parameter/0 actual_parameter/0) + (same? expected_parameter/1 actual_parameter/1)) + + _ + false)) + (_.cover [/.no_op] + (case (/.no_op expected_parameter/0) + (^ (/.no_op actual)) + (same? expected_parameter/0 actual) + + _ + false)) + ))) + +(def: test|case + Test + (do random.monad + [expected_input (..random 2) + expected_match (random_match 2 (..random 2))] + ($_ _.and + (_.cover [/.case] + (case (/.case [expected_input expected_match]) + (^ (/.case [actual_input actual_match])) + (and (same? expected_input actual_input) + (same? expected_match actual_match)) + + _ + false)) + ))) + +(with_expansions [<id> (static.random_nat) + <exception> (template.symbol ["exception_" <id>])] + (exception: <exception>) + + (def: test|phase + Test + (do random.monad + [version random.nat + host (random.ascii/lower 5) + expected_error (random.ascii/lower 10) + location /location.random + .let [state (with@ .#location location + (/.state (/.info version host)))]] + ($_ _.and + (_.cover [/.failure] + (|> (/.failure expected_error) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (case> {try.#Failure actual_error} + (and (text.contains? expected_error actual_error) + (text.contains? (location.format location) actual_error)) + + _ + false))) + (_.cover [/.except] + (|> (/.except <exception> []) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (case> {try.#Failure actual_error} + (and (text.contains? (exception.error <exception> []) actual_error) + (text.contains? (location.format location) actual_error)) + + _ + false))) + (_.cover [/.assertion] + (and (|> (/.assertion <exception> [] false) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (case> {try.#Failure actual_error} + (and (text.contains? (exception.error <exception> []) actual_error) + (text.contains? (location.format location) actual_error)) + + _ + false)) + (|> (/.assertion <exception> [] true) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (case> {try.#Success _} + true + + _ + false)))) + )))) + +(def: test|state + Test + (do random.monad + [version random.nat + host (random.ascii/lower 5) + + expected_module (random.ascii/lower 10) + dummy_module (random.ascii/lower 11) + + location /location.random + + expected_file (random.ascii/lower 12) + expected_code (random.ascii/lower 13) + + .let [state (with@ .#location location + (/.state (/.info version host)))]] + ($_ _.and + (_.cover [/.info] + (let [it (/.info version host)] + (and (text#= (version.format version) + (value@ .#version it)) + (same? host + (value@ .#target it)) + (..tagged? .#Build (value@ .#mode it))))) + (_.cover [/.state] + (let [info (/.info version host) + it (/.state info)] + (and (same? info + (value@ .#info it)) + (same? location.dummy + (value@ .#location it)) + (..tagged? .#None (value@ .#current_module it)) + (..tagged? .#None (value@ .#expected it)) + (list.empty? (value@ .#modules it)) + (list.empty? (value@ .#scopes it)) + (list.empty? (value@ [.#type_context .#var_bindings] it)) + (case (value@ .#source it) + [location 0 ""] + (same? location.dummy location) + + _ + false)))) + (_.cover [/.set_current_module] + (|> (do phase.monad + [_ (/.set_current_module expected_module)] + (extension.read (|>> (value@ .#current_module) (maybe.else "")))) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (case> {try.#Success actual} + (same? expected_module actual) + + _ + false))) + (_.cover [/.with_current_module] + (let [current_module (extension.read (|>> (value@ .#current_module) (maybe.else "")))] + (|> (do phase.monad + [_ (/.set_current_module expected_module) + pre current_module + mid (/.with_current_module dummy_module + current_module) + post current_module] + (in (and (same? expected_module pre) + (same? dummy_module mid) + (same? expected_module post)))) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (try.else false)))) + (_.cover [/.location /.set_location] + (let [expected (/.location expected_file)] + (|> (do phase.monad + [_ (/.set_location expected)] + (extension.read (value@ .#location))) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (case> {try.#Success actual} + (same? expected actual) + + _ + false)))) + (_.cover [/.with_location] + (let [expected (/.location expected_file) + dummy (/.location expected_code) + location (extension.read (value@ .#location))] + (|> (do phase.monad + [_ (/.set_location expected) + pre location + mid (/.with_location dummy + location) + post location] + (in (and (same? expected pre) + (same? dummy mid) + (same? expected post)))) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (try.else false)))) + (_.cover [/.source /.set_source_code] + (let [expected (/.source expected_file expected_code)] + (|> (do phase.monad + [_ (/.set_source_code expected)] + (extension.read (value@ .#source))) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (case> {try.#Success actual} + (same? expected actual) + + _ + false)))) + (_.cover [/.with_source_code] + (let [expected (/.source expected_file expected_code) + dummy (/.source expected_code expected_file) + source (extension.read (value@ .#source))] + (|> (do phase.monad + [_ (/.set_source_code expected) + pre source + mid (/.with_source_code dummy + source) + post source] + (in (and (same? expected pre) + (same? dummy mid) + (same? expected post)))) + (phase.result [extension.#bundle extension.empty + extension.#state state]) + (try.else false)))) + ))) + +(def: .public test + Test + (<| (_.covering /._) + (_.for [/.Analysis]) + (do random.monad + [left (..random 2) + right (..random 2)] + ($_ _.and + (_.for [/.equivalence] + ($equivalence.spec /.equivalence (..random 2))) + + ..test|simple + ..test|complex + ..test|reference + (_.for [/.Application] + ..test|application) + (_.for [/.Branch /.Branch' /.Match /.Match'] + ..test|case) + (_.for [/.Operation /.Phase /.Handler /.Bundle] + ..test|phase) + (_.for [/.State+] + ..test|state) + (_.cover [/.format] + (bit#= (# /.equivalence = left right) + (text#= (/.format left) (/.format right)))) + + /simple.test + /complex.test + /pattern.test + )))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/composite.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/complex.lux index 8c74718b8..c6454b07f 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/composite.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/complex.lux @@ -44,7 +44,7 @@ (def: .public (random multiplicity it) (All (_ a) - (-> Nat (Random a) (Random (/.Composite a)))) + (-> Nat (Random a) (Random (/.Complex a)))) ($_ random.or ($_ random.and (random#each (n.% (-- multiplicity)) random.nat) @@ -57,7 +57,7 @@ Test (let [random (..random 3 random.nat)] (<| (_.covering /._) - (_.for [/.Composite /.Variant /.Tuple]) + (_.for [/.Complex /.Variant /.Tuple]) ($_ _.and (_.for [/.equivalence] ($equivalence.spec (/.equivalence n.equivalence) random)) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux index 7a1d4c66d..85a701185 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/analysis/pattern.lux @@ -17,7 +17,7 @@ ["[0]" /]] ["[0]" // "_" ["[1][0]" simple] - ["[1][0]" composite]]) + ["[1][0]" complex]]) (def: .public random (Random /.Pattern) @@ -25,7 +25,7 @@ (function (_ random) ($_ random.or //simple.random - (//composite.random 4 random) + (//complex.random 4 random) random.nat )))) diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux index 97cfd277b..beb9c4a34 100644 --- a/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/test/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -1,54 +1,54 @@ (.using - [lux "*" - ["_" test {"+" Test}] - [abstract - [hash {"+" Hash}] - ["[0]" monad {"+" do}]] - [control - [pipe {"+" case>}] - ["[0]" try ("[1]#[0]" functor)]] - [data - ["[0]" sum] - ["[0]" text - ["%" format {"+" format}]] - [number - ["n" nat] - ["[0]" int] - ["[0]" rev] - ["[0]" frac]] - [collection - ["[0]" list ("[1]#[0]" functor mix monoid)] - ["[0]" set]]] - [math - ["[0]" random {"+" Random}]]] - ["[0]" // "_" - ["[1][0]" primitive]] - [\\ - ["[0]" / - ["/[1]" // - ["/[1]" // "_" - [extension - ["[1][0]" bundle]] - ["/[1]" // - ["[0]" analysis {"+" Branch Match Analysis}] - ["[0]" synthesis {"+" Path Synthesis}] - [/// - ["[1][0]" reference - [variable {"+" Register}]] - ["[0]" phase] - [meta - ["[0]" archive]]]]]]]]) + [lux "*" + ["_" test {"+" Test}] + [abstract + [hash {"+" Hash}] + ["[0]" monad {"+" do}]] + [control + [pipe {"+" case>}] + ["[0]" try ("[1]#[0]" functor)]] + [data + ["[0]" sum] + ["[0]" text + ["%" format {"+" format}]] + [number + ["n" nat] + ["[0]" int] + ["[0]" rev] + ["[0]" frac]] + [collection + ["[0]" list ("[1]#[0]" functor mix monoid)] + ["[0]" set]]] + [math + ["[0]" random {"+" Random}]]] + ["[0]" // "_" + ["[1][0]" primitive]] + [\\ + ["[0]" / + ["/[1]" // + ["/[1]" // "_" + [extension + ["[1][0]" bundle]] + ["/[1]" // + ["[0]" analysis {"+" Branch Match Analysis}] + ["[0]" synthesis {"+" Path Synthesis}] + [/// + ["[1][0]" reference + [variable {"+" Register}]] + ["[0]" phase] + [meta + ["[0]" archive]]]]]]]]) (def: masking_test Test (do [! random.monad] [maskedA //primitive.primitive temp (|> random.nat (# ! each (n.% 100))) - .let [maskA (analysis.control/case - [maskedA - [[{analysis.#Bind temp} - {analysis.#Reference (////reference.local temp)}] - (list)]])]] + .let [maskA (analysis.case + [maskedA + [[{analysis.#Bind temp} + {analysis.#Reference (////reference.local temp)}] + (list)]])]] (_.cover [/.synthesize_masking] (|> maskA (//.phase archive.empty) @@ -62,11 +62,11 @@ [registerA random.nat inputA //primitive.primitive outputA //primitive.primitive - .let [letA (analysis.control/case - [inputA - [[{analysis.#Bind registerA} - outputA] - (list)]])]] + .let [letA (analysis.case + [inputA + [[{analysis.#Bind registerA} + outputA] + (list)]])]] (_.cover [/.synthesize_let] (|> letA (//.phase archive.empty) @@ -93,8 +93,8 @@ [{analysis.#Simple {analysis.#Bit false}} elseA]) ifA (if then|else - (analysis.control/case [inputA [thenB (list elseB)]]) - (analysis.control/case [inputA [elseB (list thenB)]]))]] + (analysis.case [inputA [thenB (list elseB)]]) + (analysis.case [inputA [elseB (list thenB)]]))]] (_.cover [/.synthesize_if] (|> ifA (//.phase archive.empty) @@ -151,9 +151,9 @@ (# ! each (|>> analysis.tuple))) pathA ..random_path [pattern @member] (get_pattern pathA) - .let [getA (analysis.control/case [recordA [[pattern - {analysis.#Reference (////reference.local @member)}] - (list)]])]] + .let [getA (analysis.case [recordA [[pattern + {analysis.#Reference (////reference.local @member)}] + (list)]])]] (_.cover [/.synthesize_get] (|> getA (//.phase archive.empty) |