From 94e5802f594a73245fce0fbd885103b8bf210d57 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 2 Dec 2022 19:33:00 -0400 Subject: Added some simple time-series handling machinery. --- stdlib/source/specification/compositor/generation/case.lux | 8 ++++---- stdlib/source/specification/compositor/generation/common.lux | 6 +++--- stdlib/source/specification/compositor/generation/function.lux | 2 +- stdlib/source/specification/compositor/generation/reference.lux | 2 +- stdlib/source/specification/compositor/generation/structure.lux | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'stdlib/source/specification/compositor/generation') diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux index 8043bd2e0..5b36db339 100644 --- a/stdlib/source/specification/compositor/generation/case.lux +++ b/stdlib/source/specification/compositor/generation/case.lux @@ -34,7 +34,7 @@ (def size (Random Nat) - (|> r.nat (at r.monad each (|>> (n.% ..limit) (n.max 2))))) + (|> r.nat (of r.monad each (|>> (n.% ..limit) (n.max 2))))) (def (tail? size idx) (-> Nat Nat Bit) @@ -69,7 +69,7 @@ [(r.unicode 5) synthesis.text synthesis.path/text])) (do [! r.monad] [size ..size - idx (|> r.nat (at ! each (n.% size))) + idx (|> r.nat (of ! each (n.% size))) [subS subP] when .let [unitS (synthesis.text synthesis.unit) whenS (synthesis.tuple @@ -84,7 +84,7 @@ (in [whenS whenP])) (do [! r.monad] [size ..size - idx (|> r.nat (at ! each (n.% size))) + idx (|> r.nat (of ! each (n.% size))) [subS subP] when .let [right? (tail? size idx) whenS (synthesis.variant @@ -248,7 +248,7 @@ (_.test "===" (and (text#= (synthesis.%path special_path) (synthesis.%path special_pattern_path)) - (at synthesis.path_equivalence = special_path special_pattern_path))) + (of synthesis.path_equivalence = special_path special_pattern_path))) (_.test "CODE" (|> special_input (run "special_input") diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux index a0d202a2e..acb782c1f 100644 --- a/stdlib/source/specification/compositor/generation/common.lux +++ b/stdlib/source/specification/compositor/generation/common.lux @@ -126,7 +126,7 @@ (def simple_frac (Random Frac) - (|> r.nat (at r.monad each (|>> (n.% 1000) .int i.frac)))) + (|> r.nat (of r.monad each (|>> (n.% 1000) .int i.frac)))) (def (f64 run) (-> Runner Test) @@ -174,12 +174,12 @@ (def (text run) (-> Runner Test) (do [! r.monad] - [sample_size (|> r.nat (at ! each (|>> (n.% 10) (n.max 1)))) + [sample_size (|> r.nat (of ! each (|>> (n.% 10) (n.max 1)))) sample_lower (r.lower_case_alpha sample_size) sample_upper (r.upper_case_alpha sample_size) sample_alpha (|> (r.alphabetic sample_size) (r.only (|>> (text#= sample_upper) not))) - char_idx (|> r.nat (at ! each (n.% sample_size))) + char_idx (|> r.nat (of ! each (n.% sample_size))) .let [sample_lowerS (synthesis.text sample_lower) sample_upperS (synthesis.text sample_upper) sample_alphaS (synthesis.text sample_alpha) diff --git a/stdlib/source/specification/compositor/generation/function.lux b/stdlib/source/specification/compositor/generation/function.lux index 92d0bdaa2..63b025065 100644 --- a/stdlib/source/specification/compositor/generation/function.lux +++ b/stdlib/source/specification/compositor/generation/function.lux @@ -52,7 +52,7 @@ (-> Runner Test) (do [! r.monad] [[arity local functionS] ..function - partial_arity (|> r.nat (at ! each (|>> (n.% arity) (n.max 1)))) + partial_arity (|> r.nat (of ! each (|>> (n.% arity) (n.max 1)))) inputs (r.list arity r.safe_frac) .let [expectation (maybe.trusted (list.item (-- local) inputs)) inputsS (list#each (|>> synthesis.f64) inputs)]] diff --git a/stdlib/source/specification/compositor/generation/reference.lux b/stdlib/source/specification/compositor/generation/reference.lux index ce0d00d1a..74c556d80 100644 --- a/stdlib/source/specification/compositor/generation/reference.lux +++ b/stdlib/source/specification/compositor/generation/reference.lux @@ -43,7 +43,7 @@ (def (variable run) (-> Runner Test) (do [! r.monad] - [register (|> r.nat (at ! each (n.% 100))) + [register (|> r.nat (of ! each (n.% 100))) expected r.safe_frac] (_.test "Local variables." (|> (synthesis.branch/let [(synthesis.f64 expected) diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux index acf9888e8..b28648520 100644 --- a/stdlib/source/specification/compositor/generation/structure.lux +++ b/stdlib/source/specification/compositor/generation/structure.lux @@ -33,8 +33,8 @@ (def (variant run) (-> Runner Test) (do [! r.monad] - [num_tags (|> r.nat (at ! each (|>> (n.% 10) (n.max 2)))) - tag_in (|> r.nat (at ! each (n.% num_tags))) + [num_tags (|> r.nat (of ! each (|>> (n.% 10) (n.max 2)))) + tag_in (|> r.nat (of ! each (n.% num_tags))) .let [last?_in (|> num_tags -- (n.= tag_in))] value_in r.i64] (_.test (%.symbol (symbol synthesis.variant)) @@ -69,7 +69,7 @@ (def (tuple run) (-> Runner Test) (do [! r.monad] - [size (|> r.nat (at ! each (|>> (n.% 10) (n.max 2)))) + [size (|> r.nat (of ! each (|>> (n.% 10) (n.max 2)))) tuple_in (r.list size r.i64)] (_.test (%.symbol (symbol synthesis.tuple)) (|> (synthesis.tuple (list#each (|>> synthesis.i64) tuple_in)) -- cgit v1.2.3