diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/math/logic/fuzzy.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/test/lux/math/logic/fuzzy.lux b/stdlib/source/test/lux/math/logic/fuzzy.lux index 64051ffd9..3d21a1f21 100644 --- a/stdlib/source/test/lux/math/logic/fuzzy.lux +++ b/stdlib/source/test/lux/math/logic/fuzzy.lux @@ -1,6 +1,6 @@ (.module: [lux #* - data/text/format + ["%" data/text/format (#+ format)] [abstract/monad (#+ do)] ["r" math/random (#+ Random)] ["_" test (#+ Test)] @@ -20,7 +20,7 @@ (template [<name> <desc> <hash> <gen> <triangle> <lt> <lte> <gt> <gte>] [(def: <name> Test - (<| (_.context (%name (name-of <triangle>))) + (<| (_.context (%.name (name-of <triangle>))) (do r.monad [values (r.set <hash> 3 <gen>) #let [[x y z] (case (set.to-list values) @@ -59,7 +59,7 @@ (template [<name> <desc> <hash> <gen> <trapezoid> <lt> <lte> <gt> <gte>] [(def: <name> Test - (<| (_.context (%name (name-of <trapezoid>))) + (<| (_.context (%.name (name-of <trapezoid>))) (do r.monad [values (r.set <hash> 4 <gen>) #let [[w x y z] (case (set.to-list values) @@ -116,24 +116,24 @@ right ..triangle sample r.rev] ($_ _.and - (_.test (%name (name-of /.union)) + (_.test (%.name (name-of /.union)) (let [combined (/.union left right) combined-membership (/.membership sample combined)] (and (r/>= (/.membership sample left) combined-membership) (r/>= (/.membership sample right) combined-membership)))) - (_.test (%name (name-of /.intersection)) + (_.test (%.name (name-of /.intersection)) (let [combined (/.intersection left right) combined-membership (/.membership sample combined)] (and (r/<= (/.membership sample left) combined-membership) (r/<= (/.membership sample right) combined-membership)))) - (_.test (%name (name-of /.complement)) + (_.test (%.name (name-of /.complement)) (r/= (/.membership sample left) (//.not (/.membership sample (/.complement left))))) - (_.test (%name (name-of /.difference)) + (_.test (%.name (name-of /.difference)) (r/<= (/.membership sample right) (/.membership sample (/.difference left right)))) )))) @@ -144,10 +144,10 @@ [#let [set-10 (set.from-list nat.hash (list.n/range 0 10))] sample (|> r.nat (:: @ map (n/% 20)))] ($_ _.and - (_.test (%name (name-of /.from-predicate)) + (_.test (%.name (name-of /.from-predicate)) (bit@= (r/= //.true (/.membership sample (/.from-predicate n/even?))) (n/even? sample))) - (_.test (%name (name-of /.from-set)) + (_.test (%.name (name-of /.from-set)) (bit@= (r/= //.true (/.membership sample (/.from-set set-10))) (set.member? set-10 sample))) ))) @@ -160,7 +160,7 @@ threshold r.rev #let [vip-fuzzy (/.cut threshold fuzzy) member? (/.to-predicate threshold fuzzy)]] - (<| (_.context (%name (name-of /.cut))) + (<| (_.context (%.name (name-of /.cut))) ($_ _.and (_.test "Can increase the threshold of membership of a fuzzy set." (bit@= (r/> //.false (/.membership sample vip-fuzzy)) @@ -172,7 +172,7 @@ (def: #export test Test - (<| (_.context (%name (name-of /._))) + (<| (_.context (%.name (name-of /._))) ($_ _.and ..rev-triangles ..rev-trapezoids |