aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/tool/compiler/language
diff options
context:
space:
mode:
authorEduardo Julian2022-02-27 04:53:04 -0400
committerEduardo Julian2022-02-27 04:53:04 -0400
commit4167849041d7635a0fc2e81fc2bebae3fa0bb3d9 (patch)
tree5bbe3fc5efb146e709820d2b00a2bcbbf8b4827a /stdlib/source/test/lux/tool/compiler/language
parent08518ba37d9094c5cc8683fc404c349e534b8dc9 (diff)
Fixed directive extensions for Lux/Lua.
Diffstat (limited to '')
-rw-r--r--stdlib/source/test/lux/tool/compiler/language/lux/synthesis/simple.lux45
1 files changed, 45 insertions, 0 deletions
diff --git a/stdlib/source/test/lux/tool/compiler/language/lux/synthesis/simple.lux b/stdlib/source/test/lux/tool/compiler/language/lux/synthesis/simple.lux
new file mode 100644
index 000000000..568788a0e
--- /dev/null
+++ b/stdlib/source/test/lux/tool/compiler/language/lux/synthesis/simple.lux
@@ -0,0 +1,45 @@
+(.using
+ [library
+ [lux "*"
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]
+ [\\specification
+ ["$[0]" equivalence]
+ ["$[0]" hash]]]
+ [data
+ ["[0]" bit ("[1]#[0]" equivalence)]
+ ["[0]" text ("[1]#[0]" equivalence)]]
+ [math
+ ["[0]" random {"+" Random}]
+ [number
+ ["n" nat]]]]]
+ [\\library
+ ["[0]" /]])
+
+(def: .public random
+ (Random /.Simple)
+ ($_ random.or
+ random.bit
+ random.i64
+ random.frac
+ (random.ascii/lower 1)
+ ))
+
+(def: .public test
+ Test
+ (<| (_.covering /._)
+ (_.for [/.Simple])
+ (do [! random.monad]
+ [left ..random
+ right ..random]
+ ($_ _.and
+ (_.for [/.equivalence]
+ ($equivalence.spec /.equivalence ..random))
+ (_.for [/.hash]
+ ($hash.spec /.hash ..random))
+
+ (_.cover [/.format]
+ (bit#= (text#= (/.format left) (/.format right))
+ (# /.equivalence = left right)))
+ ))))