diff options
Diffstat (limited to 'stdlib/source/library/lux/math/logic')
-rw-r--r-- | stdlib/source/library/lux/math/logic/continuous.lux | 14 | ||||
-rw-r--r-- | stdlib/source/library/lux/math/logic/fuzzy.lux | 34 |
2 files changed, 24 insertions, 24 deletions
diff --git a/stdlib/source/library/lux/math/logic/continuous.lux b/stdlib/source/library/lux/math/logic/continuous.lux index e68527938..691890917 100644 --- a/stdlib/source/library/lux/math/logic/continuous.lux +++ b/stdlib/source/library/lux/math/logic/continuous.lux @@ -11,15 +11,15 @@ [number ["/" rev ("#\." interval)]]]]]) -(def: #export false Rev /\bottom) -(def: #export true Rev /\top) +(def: .public false Rev /\bottom) +(def: .public true Rev /\top) (template [<name> <chooser> <monoid> <identity>] - [(def: #export <name> + [(def: .public <name> (-> Rev Rev Rev) <chooser>) - (implementation: #export <monoid> + (implementation: .public <monoid> (Monoid Rev) (def: identity <identity>) @@ -29,16 +29,16 @@ [and /.min conjunction ..true] ) -(def: #export (not input) +(def: .public (not input) (-> Rev Rev) (/.- input ..true)) -(def: #export (implies consequent antecedent) +(def: .public (implies consequent antecedent) (-> Rev Rev Rev) (or (not antecedent) consequent)) -(def: #export (= left right) +(def: .public (= left right) (-> Rev Rev Rev) (and (or (not left) right) (or left (not right)))) diff --git a/stdlib/source/library/lux/math/logic/fuzzy.lux b/stdlib/source/library/lux/math/logic/fuzzy.lux index a449f1ca6..d36b7cfd2 100644 --- a/stdlib/source/library/lux/math/logic/fuzzy.lux +++ b/stdlib/source/library/lux/math/logic/fuzzy.lux @@ -17,18 +17,18 @@ ["." // #_ ["#" continuous]]) -(type: #export (Fuzzy a) +(type: .public (Fuzzy a) {#.doc (doc "A fuzzy set.")} (-> a Rev)) -(implementation: #export functor +(implementation: .public functor (contravariant.Functor Fuzzy) (def: (map f fb) (|>> f fb))) (template [<name> <verdict>] - [(def: #export <name> + [(def: .public <name> Fuzzy (function (_ _) <verdict>))] @@ -37,12 +37,12 @@ [full //.true] ) -(def: #export (membership set elem) +(def: .public (membership set elem) (All [a] (-> (Fuzzy a) a Rev)) (set elem)) (template [<set_composition> <membership_composition>] - [(def: #export (<set_composition> left right) + [(def: .public (<set_composition> left right) (All [a] (-> (Fuzzy a) (Fuzzy a) (Fuzzy a))) (function (_ elem) (<membership_composition> (left elem) @@ -52,27 +52,27 @@ [intersection //.and] ) -(def: #export (complement set) +(def: .public (complement set) (All [a] (-> (Fuzzy a) (Fuzzy a))) (|>> set //.not)) -(def: #export (difference sub base) +(def: .public (difference sub base) (All [a] (-> (Fuzzy a) (Fuzzy a) (Fuzzy a))) (..intersection (..complement sub) base)) -(def: #export (of_predicate predicate) +(def: .public (of_predicate predicate) (All [a] (-> (Predicate a) (Fuzzy a))) (function (_ elem) (if (predicate elem) //.true //.false))) -(def: #export (predicate treshold set) +(def: .public (predicate treshold set) (All [a] (-> Rev (Fuzzy a) (Predicate a))) (function (_ elem) (/.> treshold (set elem)))) -(def: #export of_set +(def: .public of_set (All [a] (-> (Set a) (Fuzzy a))) (|>> set.member? ..of_predicate)) @@ -97,18 +97,18 @@ (-> Rev Rev (Fuzzy Rev)) (..complement (..ascending from to))) -(def: #export (gradient from to) +(def: .public (gradient from to) (-> Rev Rev (Fuzzy Rev)) (if (/.< to from) (..ascending from to) (..descending from to))) (template: (!sort_2 <low> <high>) - (if (/.> <low> <high>) - [<low> <high>] - [<high> <low>])) + [(if (/.> <low> <high>) + [<low> <high>] + [<high> <low>])]) -(def: #export (triangle bottom middle top) +(def: .public (triangle bottom middle top) (-> Rev Rev Rev (Fuzzy Rev)) (let [[low_0 high_0] (!sort_2 bottom middle) [bottom' high_1] (!sort_2 low_0 top) @@ -116,7 +116,7 @@ (..intersection (..ascending bottom' middle') (..descending middle' top')))) -(def: #export (trapezoid bottom middle_bottom middle_top top) +(def: .public (trapezoid bottom middle_bottom middle_top top) (-> Rev Rev Rev Rev (Fuzzy Rev)) (let [[low_0 high_0] (!sort_2 bottom middle_bottom) [low_1 high_1] (!sort_2 middle_top top) @@ -126,7 +126,7 @@ (..intersection (..ascending bottom' middle_bottom') (..descending middle_top' top')))) -(def: #export (cut treshold set) +(def: .public (cut treshold set) (All [a] (-> Rev (Fuzzy a) (Fuzzy a))) (function (_ elem) (let [membership (set elem)] |