diff options
author | Eduardo Julian | 2022-12-12 18:55:00 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-12-12 18:55:00 -0400 |
commit | 549cb9623c560fec165b9e88f112a406614f598e (patch) | |
tree | d085b6dddf0a7ff5078c19e0f13b48d82bee55d0 /stdlib/source/specification/lux/abstract/apply.lux | |
parent | fe9a58dfcd5732ef0c5e5c4b7e85370cdc0db45a (diff) |
Added accumulation/distribution oscillator.
Diffstat (limited to 'stdlib/source/specification/lux/abstract/apply.lux')
-rw-r--r-- | stdlib/source/specification/lux/abstract/apply.lux | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/stdlib/source/specification/lux/abstract/apply.lux b/stdlib/source/specification/lux/abstract/apply.lux deleted file mode 100644 index 1b9c0c941..000000000 --- a/stdlib/source/specification/lux/abstract/apply.lux +++ /dev/null @@ -1,68 +0,0 @@ -(.require - [library - [lux (.except) - [abstract - [monad (.only do)]] - [control - ["[0]" function]] - [math - ["[0]" random (.only Random)] - [number - ["n" nat]]] - [meta - ["[0]" type]] - [test - ["_" property (.only Test)]]]] - [\\library - ["[0]" / (.only Apply)]] - [// - ["[0]S" functor (.only Injection Comparison)]]) - -(def .public (spec injection comparison it) - (All (_ f) (-> (Injection f) (Comparison f) (Apply f) Test)) - (<| (_.for [/.Apply]) - (type.let [:$/1: (-> Nat Nat)]) - (do [! random.monad] - [sample random.nat - increase (is (Random :$/1:) - (of ! each n.+ random.nat)) - decrease (is (Random :$/1:) - (of ! each n.- random.nat))]) - (all _.and - (_.for [/.functor] - (functorS.spec injection comparison (the /.functor it))) - - (_.coverage [/.on] - (let [(open "/#[0]") it - - identity! - ((comparison n.=) - (/#on (injection sample) - (injection function.identity)) - (injection sample)) - - homomorphism! - ((comparison n.=) - (/#on (injection sample) (injection increase)) - (injection (increase sample))) - - interchange! - ((comparison n.=) (/#on (injection sample) (injection increase)) - (/#on (injection increase) (injection (is (-> (-> Nat Nat) Nat) - (function (_ f) (f sample)))))) - - composition! - ((comparison n.=) - (|> (injection (is (-> :$/1: :$/1: :$/1:) - function.composite)) - (/#on (injection increase)) - (/#on (injection decrease)) - (/#on (injection sample))) - (/#on (/#on (injection sample) - (injection increase)) - (injection decrease)))] - (and identity! - homomorphism! - interchange! - composition!))) - ))) |