@higher.archi/boe 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/compilers/condition.compiler.d.ts +26 -0
- package/dist/core/compilers/condition.compiler.d.ts.map +1 -0
- package/dist/core/compilers/condition.compiler.js +159 -0
- package/dist/core/compilers/condition.compiler.js.map +1 -0
- package/dist/core/compilers/index.d.ts +5 -0
- package/dist/core/compilers/index.d.ts.map +1 -0
- package/dist/core/compilers/index.js +11 -0
- package/dist/core/compilers/index.js.map +1 -0
- package/dist/core/engine/engine.interface.d.ts +44 -0
- package/dist/core/engine/engine.interface.d.ts.map +1 -0
- package/dist/core/engine/engine.interface.js +10 -0
- package/dist/core/engine/engine.interface.js.map +1 -0
- package/dist/core/engine/index.d.ts +5 -0
- package/dist/core/engine/index.d.ts.map +1 -0
- package/dist/core/engine/index.js +6 -0
- package/dist/core/engine/index.js.map +1 -0
- package/dist/core/evaluation/condition.evaluator.d.ts +18 -0
- package/dist/core/evaluation/condition.evaluator.d.ts.map +1 -0
- package/dist/core/evaluation/condition.evaluator.js +179 -0
- package/dist/core/evaluation/condition.evaluator.js.map +1 -0
- package/dist/core/evaluation/index.d.ts +7 -0
- package/dist/core/evaluation/index.d.ts.map +1 -0
- package/dist/core/evaluation/index.js +19 -0
- package/dist/core/evaluation/index.js.map +1 -0
- package/dist/core/evaluation/temporal.d.ts +52 -0
- package/dist/core/evaluation/temporal.d.ts.map +1 -0
- package/dist/core/evaluation/temporal.js +166 -0
- package/dist/core/evaluation/temporal.js.map +1 -0
- package/dist/core/index.d.ts +25 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +73 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/matching/activation.types.d.ts +11 -0
- package/dist/core/matching/activation.types.d.ts.map +1 -0
- package/dist/core/matching/activation.types.js +6 -0
- package/dist/core/matching/activation.types.js.map +1 -0
- package/dist/core/matching/index.d.ts +6 -0
- package/dist/core/matching/index.d.ts.map +1 -0
- package/dist/core/matching/index.js +10 -0
- package/dist/core/matching/index.js.map +1 -0
- package/dist/core/matching/matcher.d.ts +17 -0
- package/dist/core/matching/matcher.d.ts.map +1 -0
- package/dist/core/matching/matcher.js +93 -0
- package/dist/core/matching/matcher.js.map +1 -0
- package/dist/core/memory/index.d.ts +6 -0
- package/dist/core/memory/index.d.ts.map +1 -0
- package/dist/core/memory/index.js +9 -0
- package/dist/core/memory/index.js.map +1 -0
- package/dist/core/memory/working-memory.d.ts +26 -0
- package/dist/core/memory/working-memory.d.ts.map +1 -0
- package/dist/core/memory/working-memory.interface.d.ts +84 -0
- package/dist/core/memory/working-memory.interface.d.ts.map +1 -0
- package/dist/core/memory/working-memory.interface.js +6 -0
- package/dist/core/memory/working-memory.interface.js.map +1 -0
- package/dist/core/memory/working-memory.js +102 -0
- package/dist/core/memory/working-memory.js.map +1 -0
- package/dist/core/operators/adapters/context.adapter.d.ts +32 -0
- package/dist/core/operators/adapters/context.adapter.d.ts.map +1 -0
- package/dist/core/operators/adapters/context.adapter.js +36 -0
- package/dist/core/operators/adapters/context.adapter.js.map +1 -0
- package/dist/core/operators/adapters/index.d.ts +9 -0
- package/dist/core/operators/adapters/index.d.ts.map +1 -0
- package/dist/core/operators/adapters/index.js +22 -0
- package/dist/core/operators/adapters/index.js.map +1 -0
- package/dist/core/operators/adapters/operator.adapter.d.ts +94 -0
- package/dist/core/operators/adapters/operator.adapter.d.ts.map +1 -0
- package/dist/core/operators/adapters/operator.adapter.js +156 -0
- package/dist/core/operators/adapters/operator.adapter.js.map +1 -0
- package/dist/core/operators/arithmetic/add.d.ts +17 -0
- package/dist/core/operators/arithmetic/add.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/add.js +35 -0
- package/dist/core/operators/arithmetic/add.js.map +1 -0
- package/dist/core/operators/arithmetic/average.d.ts +13 -0
- package/dist/core/operators/arithmetic/average.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/average.js +21 -0
- package/dist/core/operators/arithmetic/average.js.map +1 -0
- package/dist/core/operators/arithmetic/divide.d.ts +17 -0
- package/dist/core/operators/arithmetic/divide.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/divide.js +33 -0
- package/dist/core/operators/arithmetic/divide.js.map +1 -0
- package/dist/core/operators/arithmetic/index.d.ts +20 -0
- package/dist/core/operators/arithmetic/index.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/index.js +59 -0
- package/dist/core/operators/arithmetic/index.js.map +1 -0
- package/dist/core/operators/arithmetic/min-max.d.ts +25 -0
- package/dist/core/operators/arithmetic/min-max.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/min-max.js +51 -0
- package/dist/core/operators/arithmetic/min-max.js.map +1 -0
- package/dist/core/operators/arithmetic/multiply.d.ts +17 -0
- package/dist/core/operators/arithmetic/multiply.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/multiply.js +31 -0
- package/dist/core/operators/arithmetic/multiply.js.map +1 -0
- package/dist/core/operators/arithmetic/number-checks.d.ts +41 -0
- package/dist/core/operators/arithmetic/number-checks.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/number-checks.js +84 -0
- package/dist/core/operators/arithmetic/number-checks.js.map +1 -0
- package/dist/core/operators/arithmetic/power.d.ts +17 -0
- package/dist/core/operators/arithmetic/power.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/power.js +31 -0
- package/dist/core/operators/arithmetic/power.js.map +1 -0
- package/dist/core/operators/arithmetic/rounding.d.ts +29 -0
- package/dist/core/operators/arithmetic/rounding.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/rounding.js +59 -0
- package/dist/core/operators/arithmetic/rounding.js.map +1 -0
- package/dist/core/operators/arithmetic/subtract.d.ts +17 -0
- package/dist/core/operators/arithmetic/subtract.d.ts.map +1 -0
- package/dist/core/operators/arithmetic/subtract.js +32 -0
- package/dist/core/operators/arithmetic/subtract.js.map +1 -0
- package/dist/core/operators/array/contains.d.ts +29 -0
- package/dist/core/operators/array/contains.d.ts.map +1 -0
- package/dist/core/operators/array/contains.js +61 -0
- package/dist/core/operators/array/contains.js.map +1 -0
- package/dist/core/operators/array/index.d.ts +12 -0
- package/dist/core/operators/array/index.d.ts.map +1 -0
- package/dist/core/operators/array/index.js +35 -0
- package/dist/core/operators/array/index.js.map +1 -0
- package/dist/core/operators/comparison/approximately-equals.d.ts +17 -0
- package/dist/core/operators/comparison/approximately-equals.d.ts.map +1 -0
- package/dist/core/operators/comparison/approximately-equals.js +35 -0
- package/dist/core/operators/comparison/approximately-equals.js.map +1 -0
- package/dist/core/operators/comparison/equals.d.ts +18 -0
- package/dist/core/operators/comparison/equals.d.ts.map +1 -0
- package/dist/core/operators/comparison/equals.js +40 -0
- package/dist/core/operators/comparison/equals.js.map +1 -0
- package/dist/core/operators/comparison/greater-than.d.ts +18 -0
- package/dist/core/operators/comparison/greater-than.d.ts.map +1 -0
- package/dist/core/operators/comparison/greater-than.js +42 -0
- package/dist/core/operators/comparison/greater-than.js.map +1 -0
- package/dist/core/operators/comparison/index.d.ts +17 -0
- package/dist/core/operators/comparison/index.d.ts.map +1 -0
- package/dist/core/operators/comparison/index.js +50 -0
- package/dist/core/operators/comparison/index.js.map +1 -0
- package/dist/core/operators/comparison/less-than.d.ts +18 -0
- package/dist/core/operators/comparison/less-than.d.ts.map +1 -0
- package/dist/core/operators/comparison/less-than.js +42 -0
- package/dist/core/operators/comparison/less-than.js.map +1 -0
- package/dist/core/operators/comparison/not-equals.d.ts +18 -0
- package/dist/core/operators/comparison/not-equals.d.ts.map +1 -0
- package/dist/core/operators/comparison/not-equals.js +40 -0
- package/dist/core/operators/comparison/not-equals.js.map +1 -0
- package/dist/core/operators/comparison/nullish.d.ts +45 -0
- package/dist/core/operators/comparison/nullish.d.ts.map +1 -0
- package/dist/core/operators/comparison/nullish.js +110 -0
- package/dist/core/operators/comparison/nullish.js.map +1 -0
- package/dist/core/operators/date/arithmetic.d.ts +24 -0
- package/dist/core/operators/date/arithmetic.d.ts.map +1 -0
- package/dist/core/operators/date/arithmetic.js +170 -0
- package/dist/core/operators/date/arithmetic.js.map +1 -0
- package/dist/core/operators/date/boundaries.d.ts +18 -0
- package/dist/core/operators/date/boundaries.d.ts.map +1 -0
- package/dist/core/operators/date/boundaries.js +115 -0
- package/dist/core/operators/date/boundaries.js.map +1 -0
- package/dist/core/operators/date/checks.d.ts +16 -0
- package/dist/core/operators/date/checks.d.ts.map +1 -0
- package/dist/core/operators/date/checks.js +81 -0
- package/dist/core/operators/date/checks.js.map +1 -0
- package/dist/core/operators/date/comparisons.d.ts +16 -0
- package/dist/core/operators/date/comparisons.d.ts.map +1 -0
- package/dist/core/operators/date/comparisons.js +86 -0
- package/dist/core/operators/date/comparisons.js.map +1 -0
- package/dist/core/operators/date/constants.d.ts +38 -0
- package/dist/core/operators/date/constants.d.ts.map +1 -0
- package/dist/core/operators/date/constants.js +82 -0
- package/dist/core/operators/date/constants.js.map +1 -0
- package/dist/core/operators/date/differences.d.ts +18 -0
- package/dist/core/operators/date/differences.d.ts.map +1 -0
- package/dist/core/operators/date/differences.js +105 -0
- package/dist/core/operators/date/differences.js.map +1 -0
- package/dist/core/operators/date/extraction.d.ts +19 -0
- package/dist/core/operators/date/extraction.d.ts.map +1 -0
- package/dist/core/operators/date/extraction.js +98 -0
- package/dist/core/operators/date/extraction.js.map +1 -0
- package/dist/core/operators/date/generators.d.ts +24 -0
- package/dist/core/operators/date/generators.d.ts.map +1 -0
- package/dist/core/operators/date/generators.js +156 -0
- package/dist/core/operators/date/generators.js.map +1 -0
- package/dist/core/operators/date/index.d.ts +31 -0
- package/dist/core/operators/date/index.d.ts.map +1 -0
- package/dist/core/operators/date/index.js +80 -0
- package/dist/core/operators/date/index.js.map +1 -0
- package/dist/core/operators/date/range.d.ts +17 -0
- package/dist/core/operators/date/range.d.ts.map +1 -0
- package/dist/core/operators/date/range.js +34 -0
- package/dist/core/operators/date/range.js.map +1 -0
- package/dist/core/operators/evaluator.d.ts +71 -0
- package/dist/core/operators/evaluator.d.ts.map +1 -0
- package/dist/core/operators/evaluator.js +186 -0
- package/dist/core/operators/evaluator.js.map +1 -0
- package/dist/core/operators/examples.d.ts +8 -0
- package/dist/core/operators/examples.d.ts.map +1 -0
- package/dist/core/operators/examples.js +184 -0
- package/dist/core/operators/examples.js.map +1 -0
- package/dist/core/operators/index.d.ts +82 -0
- package/dist/core/operators/index.d.ts.map +1 -0
- package/dist/core/operators/index.js +142 -0
- package/dist/core/operators/index.js.map +1 -0
- package/dist/core/operators/logical/and.d.ts +13 -0
- package/dist/core/operators/logical/and.d.ts.map +1 -0
- package/dist/core/operators/logical/and.js +21 -0
- package/dist/core/operators/logical/and.js.map +1 -0
- package/dist/core/operators/logical/if.d.ts +19 -0
- package/dist/core/operators/logical/if.d.ts.map +1 -0
- package/dist/core/operators/logical/if.js +27 -0
- package/dist/core/operators/logical/if.js.map +1 -0
- package/dist/core/operators/logical/index.d.ts +16 -0
- package/dist/core/operators/logical/index.d.ts.map +1 -0
- package/dist/core/operators/logical/index.js +47 -0
- package/dist/core/operators/logical/index.js.map +1 -0
- package/dist/core/operators/logical/not.d.ts +13 -0
- package/dist/core/operators/logical/not.d.ts.map +1 -0
- package/dist/core/operators/logical/not.js +21 -0
- package/dist/core/operators/logical/not.js.map +1 -0
- package/dist/core/operators/logical/or.d.ts +13 -0
- package/dist/core/operators/logical/or.d.ts.map +1 -0
- package/dist/core/operators/logical/or.js +21 -0
- package/dist/core/operators/logical/or.js.map +1 -0
- package/dist/core/operators/logical/xor.d.ts +17 -0
- package/dist/core/operators/logical/xor.d.ts.map +1 -0
- package/dist/core/operators/logical/xor.js +31 -0
- package/dist/core/operators/logical/xor.js.map +1 -0
- package/dist/core/operators/operator.d.ts +171 -0
- package/dist/core/operators/operator.d.ts.map +1 -0
- package/dist/core/operators/operator.js +230 -0
- package/dist/core/operators/operator.js.map +1 -0
- package/dist/core/operators/phonetic/caverphone.d.ts +17 -0
- package/dist/core/operators/phonetic/caverphone.d.ts.map +1 -0
- package/dist/core/operators/phonetic/caverphone.js +31 -0
- package/dist/core/operators/phonetic/caverphone.js.map +1 -0
- package/dist/core/operators/phonetic/index.d.ts +14 -0
- package/dist/core/operators/phonetic/index.d.ts.map +1 -0
- package/dist/core/operators/phonetic/index.js +41 -0
- package/dist/core/operators/phonetic/index.js.map +1 -0
- package/dist/core/operators/phonetic/nysiis.d.ts +17 -0
- package/dist/core/operators/phonetic/nysiis.d.ts.map +1 -0
- package/dist/core/operators/phonetic/nysiis.js +31 -0
- package/dist/core/operators/phonetic/nysiis.js.map +1 -0
- package/dist/core/operators/phonetic/soundex.d.ts +17 -0
- package/dist/core/operators/phonetic/soundex.d.ts.map +1 -0
- package/dist/core/operators/phonetic/soundex.js +32 -0
- package/dist/core/operators/phonetic/soundex.js.map +1 -0
- package/dist/core/operators/registry.d.ts +89 -0
- package/dist/core/operators/registry.d.ts.map +1 -0
- package/dist/core/operators/registry.js +217 -0
- package/dist/core/operators/registry.js.map +1 -0
- package/dist/core/operators/similarity/cosine.d.ts +13 -0
- package/dist/core/operators/similarity/cosine.d.ts.map +1 -0
- package/dist/core/operators/similarity/cosine.js +23 -0
- package/dist/core/operators/similarity/cosine.js.map +1 -0
- package/dist/core/operators/similarity/index.d.ts +12 -0
- package/dist/core/operators/similarity/index.d.ts.map +1 -0
- package/dist/core/operators/similarity/index.js +35 -0
- package/dist/core/operators/similarity/index.js.map +1 -0
- package/dist/core/operators/string/contains.d.ts +17 -0
- package/dist/core/operators/string/contains.d.ts.map +1 -0
- package/dist/core/operators/string/contains.js +33 -0
- package/dist/core/operators/string/contains.js.map +1 -0
- package/dist/core/operators/string/empty.d.ts +21 -0
- package/dist/core/operators/string/empty.d.ts.map +1 -0
- package/dist/core/operators/string/empty.js +41 -0
- package/dist/core/operators/string/empty.js.map +1 -0
- package/dist/core/operators/string/ends-with.d.ts +17 -0
- package/dist/core/operators/string/ends-with.d.ts.map +1 -0
- package/dist/core/operators/string/ends-with.js +31 -0
- package/dist/core/operators/string/ends-with.js.map +1 -0
- package/dist/core/operators/string/index.d.ts +16 -0
- package/dist/core/operators/string/index.d.ts.map +1 -0
- package/dist/core/operators/string/index.js +47 -0
- package/dist/core/operators/string/index.js.map +1 -0
- package/dist/core/operators/string/regex.d.ts +17 -0
- package/dist/core/operators/string/regex.d.ts.map +1 -0
- package/dist/core/operators/string/regex.js +33 -0
- package/dist/core/operators/string/regex.js.map +1 -0
- package/dist/core/operators/string/starts-with.d.ts +17 -0
- package/dist/core/operators/string/starts-with.d.ts.map +1 -0
- package/dist/core/operators/string/starts-with.js +31 -0
- package/dist/core/operators/string/starts-with.js.map +1 -0
- package/dist/core/operators/transform/case.d.ts +25 -0
- package/dist/core/operators/transform/case.d.ts.map +1 -0
- package/dist/core/operators/transform/case.js +54 -0
- package/dist/core/operators/transform/case.js.map +1 -0
- package/dist/core/operators/transform/concat.d.ts +21 -0
- package/dist/core/operators/transform/concat.d.ts.map +1 -0
- package/dist/core/operators/transform/concat.js +40 -0
- package/dist/core/operators/transform/concat.js.map +1 -0
- package/dist/core/operators/transform/index.d.ts +18 -0
- package/dist/core/operators/transform/index.d.ts.map +1 -0
- package/dist/core/operators/transform/index.js +53 -0
- package/dist/core/operators/transform/index.js.map +1 -0
- package/dist/core/operators/transform/length.d.ts +17 -0
- package/dist/core/operators/transform/length.d.ts.map +1 -0
- package/dist/core/operators/transform/length.js +35 -0
- package/dist/core/operators/transform/length.js.map +1 -0
- package/dist/core/operators/transform/pad.d.ts +17 -0
- package/dist/core/operators/transform/pad.d.ts.map +1 -0
- package/dist/core/operators/transform/pad.js +31 -0
- package/dist/core/operators/transform/pad.js.map +1 -0
- package/dist/core/operators/transform/replace.d.ts +17 -0
- package/dist/core/operators/transform/replace.d.ts.map +1 -0
- package/dist/core/operators/transform/replace.js +29 -0
- package/dist/core/operators/transform/replace.js.map +1 -0
- package/dist/core/operators/transform/substring.d.ts +25 -0
- package/dist/core/operators/transform/substring.d.ts.map +1 -0
- package/dist/core/operators/transform/substring.js +50 -0
- package/dist/core/operators/transform/substring.js.map +1 -0
- package/dist/core/operators/transform/trim.d.ts +21 -0
- package/dist/core/operators/transform/trim.d.ts.map +1 -0
- package/dist/core/operators/transform/trim.js +40 -0
- package/dist/core/operators/transform/trim.js.map +1 -0
- package/dist/core/operators/types.d.ts +109 -0
- package/dist/core/operators/types.d.ts.map +1 -0
- package/dist/core/operators/types.js +9 -0
- package/dist/core/operators/types.js.map +1 -0
- package/dist/core/parser/errors.d.ts +50 -0
- package/dist/core/parser/errors.d.ts.map +1 -0
- package/dist/core/parser/errors.js +77 -0
- package/dist/core/parser/errors.js.map +1 -0
- package/dist/core/parser/index.d.ts +73 -0
- package/dist/core/parser/index.d.ts.map +1 -0
- package/dist/core/parser/index.js +120 -0
- package/dist/core/parser/index.js.map +1 -0
- package/dist/core/parser/operators/aliases.d.ts +50 -0
- package/dist/core/parser/operators/aliases.d.ts.map +1 -0
- package/dist/core/parser/operators/aliases.js +288 -0
- package/dist/core/parser/operators/aliases.js.map +1 -0
- package/dist/core/parser/operators/index.d.ts +17 -0
- package/dist/core/parser/operators/index.d.ts.map +1 -0
- package/dist/core/parser/operators/index.js +34 -0
- package/dist/core/parser/operators/index.js.map +1 -0
- package/dist/core/parser/operators/operator-table.d.ts +33 -0
- package/dist/core/parser/operators/operator-table.d.ts.map +1 -0
- package/dist/core/parser/operators/operator-table.js +91 -0
- package/dist/core/parser/operators/operator-table.js.map +1 -0
- package/dist/core/parser/operators/precedence.d.ts +58 -0
- package/dist/core/parser/operators/precedence.d.ts.map +1 -0
- package/dist/core/parser/operators/precedence.js +76 -0
- package/dist/core/parser/operators/precedence.js.map +1 -0
- package/dist/core/parser/parser/expression.parser.d.ts +34 -0
- package/dist/core/parser/parser/expression.parser.d.ts.map +1 -0
- package/dist/core/parser/parser/expression.parser.js +250 -0
- package/dist/core/parser/parser/expression.parser.js.map +1 -0
- package/dist/core/parser/parser/function.parser.d.ts +26 -0
- package/dist/core/parser/parser/function.parser.d.ts.map +1 -0
- package/dist/core/parser/parser/function.parser.js +86 -0
- package/dist/core/parser/parser/function.parser.js.map +1 -0
- package/dist/core/parser/parser/index.d.ts +19 -0
- package/dist/core/parser/parser/index.d.ts.map +1 -0
- package/dist/core/parser/parser/index.js +24 -0
- package/dist/core/parser/parser/index.js.map +1 -0
- package/dist/core/parser/parser/primary.parser.d.ts +17 -0
- package/dist/core/parser/parser/primary.parser.d.ts.map +1 -0
- package/dist/core/parser/parser/primary.parser.js +110 -0
- package/dist/core/parser/parser/primary.parser.js.map +1 -0
- package/dist/core/parser/parser/types.d.ts +36 -0
- package/dist/core/parser/parser/types.d.ts.map +1 -0
- package/dist/core/parser/parser/types.js +3 -0
- package/dist/core/parser/parser/types.js.map +1 -0
- package/dist/core/parser/tokenizer/index.d.ts +32 -0
- package/dist/core/parser/tokenizer/index.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/index.js +68 -0
- package/dist/core/parser/tokenizer/index.js.map +1 -0
- package/dist/core/parser/tokenizer/readers/identifier.reader.d.ts +30 -0
- package/dist/core/parser/tokenizer/readers/identifier.reader.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/readers/identifier.reader.js +109 -0
- package/dist/core/parser/tokenizer/readers/identifier.reader.js.map +1 -0
- package/dist/core/parser/tokenizer/readers/index.d.ts +20 -0
- package/dist/core/parser/tokenizer/readers/index.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/readers/index.js +29 -0
- package/dist/core/parser/tokenizer/readers/index.js.map +1 -0
- package/dist/core/parser/tokenizer/readers/number.reader.d.ts +43 -0
- package/dist/core/parser/tokenizer/readers/number.reader.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/readers/number.reader.js +115 -0
- package/dist/core/parser/tokenizer/readers/number.reader.js.map +1 -0
- package/dist/core/parser/tokenizer/readers/property-ref.reader.d.ts +20 -0
- package/dist/core/parser/tokenizer/readers/property-ref.reader.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/readers/property-ref.reader.js +114 -0
- package/dist/core/parser/tokenizer/readers/property-ref.reader.js.map +1 -0
- package/dist/core/parser/tokenizer/readers/string.reader.d.ts +22 -0
- package/dist/core/parser/tokenizer/readers/string.reader.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/readers/string.reader.js +93 -0
- package/dist/core/parser/tokenizer/readers/string.reader.js.map +1 -0
- package/dist/core/parser/tokenizer/readers/symbol.reader.d.ts +22 -0
- package/dist/core/parser/tokenizer/readers/symbol.reader.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/readers/symbol.reader.js +107 -0
- package/dist/core/parser/tokenizer/readers/symbol.reader.js.map +1 -0
- package/dist/core/parser/tokenizer/readers/whitespace.reader.d.ts +12 -0
- package/dist/core/parser/tokenizer/readers/whitespace.reader.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/readers/whitespace.reader.js +20 -0
- package/dist/core/parser/tokenizer/readers/whitespace.reader.js.map +1 -0
- package/dist/core/parser/tokenizer/scanner.d.ts +74 -0
- package/dist/core/parser/tokenizer/scanner.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/scanner.js +137 -0
- package/dist/core/parser/tokenizer/scanner.js.map +1 -0
- package/dist/core/parser/tokenizer/types.d.ts +55 -0
- package/dist/core/parser/tokenizer/types.d.ts.map +1 -0
- package/dist/core/parser/tokenizer/types.js +3 -0
- package/dist/core/parser/tokenizer/types.js.map +1 -0
- package/dist/core/parser/types.d.ts +83 -0
- package/dist/core/parser/types.d.ts.map +1 -0
- package/dist/core/parser/types.js +3 -0
- package/dist/core/parser/types.js.map +1 -0
- package/dist/core/refraction/index.d.ts +5 -0
- package/dist/core/refraction/index.d.ts.map +1 -0
- package/dist/core/refraction/index.js +9 -0
- package/dist/core/refraction/index.js.map +1 -0
- package/dist/core/refraction/refraction.d.ts +28 -0
- package/dist/core/refraction/refraction.d.ts.map +1 -0
- package/dist/core/refraction/refraction.js +62 -0
- package/dist/core/refraction/refraction.js.map +1 -0
- package/dist/core/resolution/conflict-resolver.d.ts +12 -0
- package/dist/core/resolution/conflict-resolver.d.ts.map +1 -0
- package/dist/core/resolution/conflict-resolver.js +57 -0
- package/dist/core/resolution/conflict-resolver.js.map +1 -0
- package/dist/core/resolution/index.d.ts +5 -0
- package/dist/core/resolution/index.d.ts.map +1 -0
- package/dist/core/resolution/index.js +10 -0
- package/dist/core/resolution/index.js.map +1 -0
- package/dist/core/shapes/index.d.ts +5 -0
- package/dist/core/shapes/index.d.ts.map +1 -0
- package/dist/core/shapes/index.js +9 -0
- package/dist/core/shapes/index.js.map +1 -0
- package/dist/core/shapes/shape.normalizer.d.ts +6 -0
- package/dist/core/shapes/shape.normalizer.d.ts.map +1 -0
- package/dist/core/shapes/shape.normalizer.js +61 -0
- package/dist/core/shapes/shape.normalizer.js.map +1 -0
- package/dist/core/types/condition.d.ts +87 -0
- package/dist/core/types/condition.d.ts.map +1 -0
- package/dist/core/types/condition.js +6 -0
- package/dist/core/types/condition.js.map +1 -0
- package/dist/core/types/fact.d.ts +23 -0
- package/dist/core/types/fact.d.ts.map +1 -0
- package/dist/core/types/fact.js +6 -0
- package/dist/core/types/fact.js.map +1 -0
- package/dist/core/types/index.d.ts +8 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/types/index.js +6 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/core/types/rule.d.ts +72 -0
- package/dist/core/types/rule.d.ts.map +1 -0
- package/dist/core/types/rule.js +8 -0
- package/dist/core/types/rule.js.map +1 -0
- package/dist/core/types/schema.d.ts +16 -0
- package/dist/core/types/schema.d.ts.map +1 -0
- package/dist/core/types/schema.js +6 -0
- package/dist/core/types/schema.js.map +1 -0
- package/dist/engines/backward/compiler.d.ts +7 -0
- package/dist/engines/backward/compiler.d.ts.map +1 -0
- package/dist/engines/backward/compiler.js +94 -0
- package/dist/engines/backward/compiler.js.map +1 -0
- package/dist/engines/backward/engine.d.ts +54 -0
- package/dist/engines/backward/engine.d.ts.map +1 -0
- package/dist/engines/backward/engine.js +96 -0
- package/dist/engines/backward/engine.js.map +1 -0
- package/dist/engines/backward/index.d.ts +12 -0
- package/dist/engines/backward/index.d.ts.map +1 -0
- package/dist/engines/backward/index.js +22 -0
- package/dist/engines/backward/index.js.map +1 -0
- package/dist/engines/backward/strategy.d.ts +37 -0
- package/dist/engines/backward/strategy.d.ts.map +1 -0
- package/dist/engines/backward/strategy.js +161 -0
- package/dist/engines/backward/strategy.js.map +1 -0
- package/dist/engines/backward/types.d.ts +97 -0
- package/dist/engines/backward/types.d.ts.map +1 -0
- package/dist/engines/backward/types.js +6 -0
- package/dist/engines/backward/types.js.map +1 -0
- package/dist/engines/bayesian/compiler.d.ts +22 -0
- package/dist/engines/bayesian/compiler.d.ts.map +1 -0
- package/dist/engines/bayesian/compiler.js +308 -0
- package/dist/engines/bayesian/compiler.js.map +1 -0
- package/dist/engines/bayesian/engine.d.ts +53 -0
- package/dist/engines/bayesian/engine.d.ts.map +1 -0
- package/dist/engines/bayesian/engine.js +95 -0
- package/dist/engines/bayesian/engine.js.map +1 -0
- package/dist/engines/bayesian/index.d.ts +11 -0
- package/dist/engines/bayesian/index.d.ts.map +1 -0
- package/dist/engines/bayesian/index.js +26 -0
- package/dist/engines/bayesian/index.js.map +1 -0
- package/dist/engines/bayesian/strategy.d.ts +13 -0
- package/dist/engines/bayesian/strategy.d.ts.map +1 -0
- package/dist/engines/bayesian/strategy.js +213 -0
- package/dist/engines/bayesian/strategy.js.map +1 -0
- package/dist/engines/bayesian/types.d.ts +145 -0
- package/dist/engines/bayesian/types.d.ts.map +1 -0
- package/dist/engines/bayesian/types.js +25 -0
- package/dist/engines/bayesian/types.js.map +1 -0
- package/dist/engines/constraint/compiler.d.ts +9 -0
- package/dist/engines/constraint/compiler.d.ts.map +1 -0
- package/dist/engines/constraint/compiler.js +188 -0
- package/dist/engines/constraint/compiler.js.map +1 -0
- package/dist/engines/constraint/engine.d.ts +95 -0
- package/dist/engines/constraint/engine.d.ts.map +1 -0
- package/dist/engines/constraint/engine.js +144 -0
- package/dist/engines/constraint/engine.js.map +1 -0
- package/dist/engines/constraint/index.d.ts +11 -0
- package/dist/engines/constraint/index.d.ts.map +1 -0
- package/dist/engines/constraint/index.js +36 -0
- package/dist/engines/constraint/index.js.map +1 -0
- package/dist/engines/constraint/strategy.d.ts +22 -0
- package/dist/engines/constraint/strategy.d.ts.map +1 -0
- package/dist/engines/constraint/strategy.js +529 -0
- package/dist/engines/constraint/strategy.js.map +1 -0
- package/dist/engines/constraint/types.d.ts +332 -0
- package/dist/engines/constraint/types.d.ts.map +1 -0
- package/dist/engines/constraint/types.js +26 -0
- package/dist/engines/constraint/types.js.map +1 -0
- package/dist/engines/defeasible/compiler.d.ts +34 -0
- package/dist/engines/defeasible/compiler.d.ts.map +1 -0
- package/dist/engines/defeasible/compiler.js +251 -0
- package/dist/engines/defeasible/compiler.js.map +1 -0
- package/dist/engines/defeasible/engine.d.ts +73 -0
- package/dist/engines/defeasible/engine.d.ts.map +1 -0
- package/dist/engines/defeasible/engine.js +115 -0
- package/dist/engines/defeasible/engine.js.map +1 -0
- package/dist/engines/defeasible/index.d.ts +10 -0
- package/dist/engines/defeasible/index.d.ts.map +1 -0
- package/dist/engines/defeasible/index.js +20 -0
- package/dist/engines/defeasible/index.js.map +1 -0
- package/dist/engines/defeasible/strategy.d.ts +25 -0
- package/dist/engines/defeasible/strategy.d.ts.map +1 -0
- package/dist/engines/defeasible/strategy.js +459 -0
- package/dist/engines/defeasible/strategy.js.map +1 -0
- package/dist/engines/defeasible/types.d.ts +316 -0
- package/dist/engines/defeasible/types.d.ts.map +1 -0
- package/dist/engines/defeasible/types.js +35 -0
- package/dist/engines/defeasible/types.js.map +1 -0
- package/dist/engines/expert/compiler.d.ts +16 -0
- package/dist/engines/expert/compiler.d.ts.map +1 -0
- package/dist/engines/expert/compiler.js +205 -0
- package/dist/engines/expert/compiler.js.map +1 -0
- package/dist/engines/expert/doc/expert-loan-approval.d.ts +17 -0
- package/dist/engines/expert/doc/expert-loan-approval.d.ts.map +1 -0
- package/dist/engines/expert/doc/expert-loan-approval.js +430 -0
- package/dist/engines/expert/doc/expert-loan-approval.js.map +1 -0
- package/dist/engines/expert/engine.d.ts +159 -0
- package/dist/engines/expert/engine.d.ts.map +1 -0
- package/dist/engines/expert/engine.js +201 -0
- package/dist/engines/expert/engine.js.map +1 -0
- package/dist/engines/expert/formatter.d.ts +56 -0
- package/dist/engines/expert/formatter.d.ts.map +1 -0
- package/dist/engines/expert/formatter.js +182 -0
- package/dist/engines/expert/formatter.js.map +1 -0
- package/dist/engines/expert/index.d.ts +37 -0
- package/dist/engines/expert/index.d.ts.map +1 -0
- package/dist/engines/expert/index.js +59 -0
- package/dist/engines/expert/index.js.map +1 -0
- package/dist/engines/expert/interpolation.d.ts +83 -0
- package/dist/engines/expert/interpolation.d.ts.map +1 -0
- package/dist/engines/expert/interpolation.js +218 -0
- package/dist/engines/expert/interpolation.js.map +1 -0
- package/dist/engines/expert/strategy.d.ts +13 -0
- package/dist/engines/expert/strategy.d.ts.map +1 -0
- package/dist/engines/expert/strategy.js +281 -0
- package/dist/engines/expert/strategy.js.map +1 -0
- package/dist/engines/expert/types.d.ts +346 -0
- package/dist/engines/expert/types.d.ts.map +1 -0
- package/dist/engines/expert/types.js +30 -0
- package/dist/engines/expert/types.js.map +1 -0
- package/dist/engines/forward/compiler.d.ts +7 -0
- package/dist/engines/forward/compiler.d.ts.map +1 -0
- package/dist/engines/forward/compiler.js +160 -0
- package/dist/engines/forward/compiler.js.map +1 -0
- package/dist/engines/forward/engine.d.ts +69 -0
- package/dist/engines/forward/engine.d.ts.map +1 -0
- package/dist/engines/forward/engine.js +111 -0
- package/dist/engines/forward/engine.js.map +1 -0
- package/dist/engines/forward/index.d.ts +12 -0
- package/dist/engines/forward/index.d.ts.map +1 -0
- package/dist/engines/forward/index.js +22 -0
- package/dist/engines/forward/index.js.map +1 -0
- package/dist/engines/forward/strategy.d.ts +15 -0
- package/dist/engines/forward/strategy.d.ts.map +1 -0
- package/dist/engines/forward/strategy.js +139 -0
- package/dist/engines/forward/strategy.js.map +1 -0
- package/dist/engines/forward/types.d.ts +152 -0
- package/dist/engines/forward/types.d.ts.map +1 -0
- package/dist/engines/forward/types.js +6 -0
- package/dist/engines/forward/types.js.map +1 -0
- package/dist/engines/fuzzy/compiler.d.ts +29 -0
- package/dist/engines/fuzzy/compiler.d.ts.map +1 -0
- package/dist/engines/fuzzy/compiler.js +136 -0
- package/dist/engines/fuzzy/compiler.js.map +1 -0
- package/dist/engines/fuzzy/defuzzify.d.ts +7 -0
- package/dist/engines/fuzzy/defuzzify.d.ts.map +1 -0
- package/dist/engines/fuzzy/defuzzify.js +34 -0
- package/dist/engines/fuzzy/defuzzify.js.map +1 -0
- package/dist/engines/fuzzy/engine.d.ts +55 -0
- package/dist/engines/fuzzy/engine.d.ts.map +1 -0
- package/dist/engines/fuzzy/engine.js +96 -0
- package/dist/engines/fuzzy/engine.js.map +1 -0
- package/dist/engines/fuzzy/fuzzy.defuzzify.d.ts +116 -0
- package/dist/engines/fuzzy/fuzzy.defuzzify.d.ts.map +1 -0
- package/dist/engines/fuzzy/fuzzy.defuzzify.js +454 -0
- package/dist/engines/fuzzy/fuzzy.defuzzify.js.map +1 -0
- package/dist/engines/fuzzy/fuzzy.membership.d.ts +162 -0
- package/dist/engines/fuzzy/fuzzy.membership.d.ts.map +1 -0
- package/dist/engines/fuzzy/fuzzy.membership.js +492 -0
- package/dist/engines/fuzzy/fuzzy.membership.js.map +1 -0
- package/dist/engines/fuzzy/fuzzy.types.d.ts +213 -0
- package/dist/engines/fuzzy/fuzzy.types.d.ts.map +1 -0
- package/dist/engines/fuzzy/fuzzy.types.js +71 -0
- package/dist/engines/fuzzy/fuzzy.types.js.map +1 -0
- package/dist/engines/fuzzy/index.d.ts +16 -0
- package/dist/engines/fuzzy/index.d.ts.map +1 -0
- package/dist/engines/fuzzy/index.js +46 -0
- package/dist/engines/fuzzy/index.js.map +1 -0
- package/dist/engines/fuzzy/membership.d.ts +7 -0
- package/dist/engines/fuzzy/membership.d.ts.map +1 -0
- package/dist/engines/fuzzy/membership.js +19 -0
- package/dist/engines/fuzzy/membership.js.map +1 -0
- package/dist/engines/fuzzy/strategy.d.ts +59 -0
- package/dist/engines/fuzzy/strategy.d.ts.map +1 -0
- package/dist/engines/fuzzy/strategy.js +255 -0
- package/dist/engines/fuzzy/strategy.js.map +1 -0
- package/dist/engines/fuzzy/types.d.ts +24 -0
- package/dist/engines/fuzzy/types.d.ts.map +1 -0
- package/dist/engines/fuzzy/types.js +17 -0
- package/dist/engines/fuzzy/types.js.map +1 -0
- package/dist/engines/index.d.ts +20 -0
- package/dist/engines/index.d.ts.map +1 -0
- package/dist/engines/index.js +49 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/monte-carlo/compiler.d.ts +12 -0
- package/dist/engines/monte-carlo/compiler.d.ts.map +1 -0
- package/dist/engines/monte-carlo/compiler.js +378 -0
- package/dist/engines/monte-carlo/compiler.js.map +1 -0
- package/dist/engines/monte-carlo/engine.d.ts +62 -0
- package/dist/engines/monte-carlo/engine.d.ts.map +1 -0
- package/dist/engines/monte-carlo/engine.js +106 -0
- package/dist/engines/monte-carlo/engine.js.map +1 -0
- package/dist/engines/monte-carlo/index.d.ts +12 -0
- package/dist/engines/monte-carlo/index.d.ts.map +1 -0
- package/dist/engines/monte-carlo/index.js +21 -0
- package/dist/engines/monte-carlo/index.js.map +1 -0
- package/dist/engines/monte-carlo/sobol.d.ts +39 -0
- package/dist/engines/monte-carlo/sobol.d.ts.map +1 -0
- package/dist/engines/monte-carlo/sobol.js +267 -0
- package/dist/engines/monte-carlo/sobol.js.map +1 -0
- package/dist/engines/monte-carlo/strategy.d.ts +20 -0
- package/dist/engines/monte-carlo/strategy.d.ts.map +1 -0
- package/dist/engines/monte-carlo/strategy.js +443 -0
- package/dist/engines/monte-carlo/strategy.js.map +1 -0
- package/dist/engines/monte-carlo/types.d.ts +230 -0
- package/dist/engines/monte-carlo/types.d.ts.map +1 -0
- package/dist/engines/monte-carlo/types.js +40 -0
- package/dist/engines/monte-carlo/types.js.map +1 -0
- package/dist/engines/pricing/calculator.d.ts +100 -0
- package/dist/engines/pricing/calculator.d.ts.map +1 -0
- package/dist/engines/pricing/calculator.js +210 -0
- package/dist/engines/pricing/calculator.js.map +1 -0
- package/dist/engines/pricing/compiler.d.ts +18 -0
- package/dist/engines/pricing/compiler.d.ts.map +1 -0
- package/dist/engines/pricing/compiler.js +275 -0
- package/dist/engines/pricing/compiler.js.map +1 -0
- package/dist/engines/pricing/engine.d.ts +102 -0
- package/dist/engines/pricing/engine.d.ts.map +1 -0
- package/dist/engines/pricing/engine.js +131 -0
- package/dist/engines/pricing/engine.js.map +1 -0
- package/dist/engines/pricing/index.d.ts +66 -0
- package/dist/engines/pricing/index.d.ts.map +1 -0
- package/dist/engines/pricing/index.js +89 -0
- package/dist/engines/pricing/index.js.map +1 -0
- package/dist/engines/pricing/strategy.d.ts +22 -0
- package/dist/engines/pricing/strategy.d.ts.map +1 -0
- package/dist/engines/pricing/strategy.js +517 -0
- package/dist/engines/pricing/strategy.js.map +1 -0
- package/dist/engines/pricing/types.d.ts +620 -0
- package/dist/engines/pricing/types.d.ts.map +1 -0
- package/dist/engines/pricing/types.js +68 -0
- package/dist/engines/pricing/types.js.map +1 -0
- package/dist/engines/scoring/compiler.d.ts +7 -0
- package/dist/engines/scoring/compiler.d.ts.map +1 -0
- package/dist/engines/scoring/compiler.js +113 -0
- package/dist/engines/scoring/compiler.js.map +1 -0
- package/dist/engines/scoring/engine.d.ts +52 -0
- package/dist/engines/scoring/engine.d.ts.map +1 -0
- package/dist/engines/scoring/engine.js +94 -0
- package/dist/engines/scoring/engine.js.map +1 -0
- package/dist/engines/scoring/index.d.ts +11 -0
- package/dist/engines/scoring/index.d.ts.map +1 -0
- package/dist/engines/scoring/index.js +21 -0
- package/dist/engines/scoring/index.js.map +1 -0
- package/dist/engines/scoring/strategy.d.ts +13 -0
- package/dist/engines/scoring/strategy.d.ts.map +1 -0
- package/dist/engines/scoring/strategy.js +158 -0
- package/dist/engines/scoring/strategy.js.map +1 -0
- package/dist/engines/scoring/types.d.ts +159 -0
- package/dist/engines/scoring/types.d.ts.map +1 -0
- package/dist/engines/scoring/types.js +6 -0
- package/dist/engines/scoring/types.js.map +1 -0
- package/dist/engines/sequential/compiler.d.ts +7 -0
- package/dist/engines/sequential/compiler.d.ts.map +1 -0
- package/dist/engines/sequential/compiler.js +156 -0
- package/dist/engines/sequential/compiler.js.map +1 -0
- package/dist/engines/sequential/engine.d.ts +55 -0
- package/dist/engines/sequential/engine.d.ts.map +1 -0
- package/dist/engines/sequential/engine.js +97 -0
- package/dist/engines/sequential/engine.js.map +1 -0
- package/dist/engines/sequential/index.d.ts +11 -0
- package/dist/engines/sequential/index.d.ts.map +1 -0
- package/dist/engines/sequential/index.js +21 -0
- package/dist/engines/sequential/index.js.map +1 -0
- package/dist/engines/sequential/strategy.d.ts +13 -0
- package/dist/engines/sequential/strategy.d.ts.map +1 -0
- package/dist/engines/sequential/strategy.js +96 -0
- package/dist/engines/sequential/strategy.js.map +1 -0
- package/dist/engines/sequential/types.d.ts +65 -0
- package/dist/engines/sequential/types.d.ts.map +1 -0
- package/dist/engines/sequential/types.js +6 -0
- package/dist/engines/sequential/types.js.map +1 -0
- package/dist/engines/state-machine/compiler.d.ts +12 -0
- package/dist/engines/state-machine/compiler.d.ts.map +1 -0
- package/dist/engines/state-machine/compiler.js +205 -0
- package/dist/engines/state-machine/compiler.js.map +1 -0
- package/dist/engines/state-machine/engine.d.ts +83 -0
- package/dist/engines/state-machine/engine.d.ts.map +1 -0
- package/dist/engines/state-machine/engine.js +107 -0
- package/dist/engines/state-machine/engine.js.map +1 -0
- package/dist/engines/state-machine/index.d.ts +11 -0
- package/dist/engines/state-machine/index.d.ts.map +1 -0
- package/dist/engines/state-machine/index.js +21 -0
- package/dist/engines/state-machine/index.js.map +1 -0
- package/dist/engines/state-machine/strategy.d.ts +19 -0
- package/dist/engines/state-machine/strategy.d.ts.map +1 -0
- package/dist/engines/state-machine/strategy.js +535 -0
- package/dist/engines/state-machine/strategy.js.map +1 -0
- package/dist/engines/state-machine/types.d.ts +229 -0
- package/dist/engines/state-machine/types.d.ts.map +1 -0
- package/dist/engines/state-machine/types.js +9 -0
- package/dist/engines/state-machine/types.js.map +1 -0
- package/dist/engines/utility/compiler.d.ts +7 -0
- package/dist/engines/utility/compiler.d.ts.map +1 -0
- package/dist/engines/utility/compiler.js +170 -0
- package/dist/engines/utility/compiler.js.map +1 -0
- package/dist/engines/utility/engine.d.ts +108 -0
- package/dist/engines/utility/engine.d.ts.map +1 -0
- package/dist/engines/utility/engine.js +152 -0
- package/dist/engines/utility/engine.js.map +1 -0
- package/dist/engines/utility/index.d.ts +17 -0
- package/dist/engines/utility/index.d.ts.map +1 -0
- package/dist/engines/utility/index.js +30 -0
- package/dist/engines/utility/index.js.map +1 -0
- package/dist/engines/utility/strategy.d.ts +30 -0
- package/dist/engines/utility/strategy.d.ts.map +1 -0
- package/dist/engines/utility/strategy.js +248 -0
- package/dist/engines/utility/strategy.js.map +1 -0
- package/dist/engines/utility/types.d.ts +176 -0
- package/dist/engines/utility/types.d.ts.map +1 -0
- package/dist/engines/utility/types.js +35 -0
- package/dist/engines/utility/types.js.map +1 -0
- package/dist/functions/index.d.ts +9 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/index.js +27 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/functions/phonetic/caverphone2.d.ts +36 -0
- package/dist/functions/phonetic/caverphone2.d.ts.map +1 -0
- package/dist/functions/phonetic/caverphone2.js +151 -0
- package/dist/functions/phonetic/caverphone2.js.map +1 -0
- package/dist/functions/phonetic/index.d.ts +9 -0
- package/dist/functions/phonetic/index.d.ts.map +1 -0
- package/dist/functions/phonetic/index.js +18 -0
- package/dist/functions/phonetic/index.js.map +1 -0
- package/dist/functions/phonetic/nysiis.d.ts +38 -0
- package/dist/functions/phonetic/nysiis.d.ts.map +1 -0
- package/dist/functions/phonetic/nysiis.js +162 -0
- package/dist/functions/phonetic/nysiis.js.map +1 -0
- package/dist/functions/phonetic/soundex.d.ts +48 -0
- package/dist/functions/phonetic/soundex.d.ts.map +1 -0
- package/dist/functions/phonetic/soundex.js +103 -0
- package/dist/functions/phonetic/soundex.js.map +1 -0
- package/dist/functions/similarity/cosine-similarity.d.ts +31 -0
- package/dist/functions/similarity/cosine-similarity.d.ts.map +1 -0
- package/dist/functions/similarity/cosine-similarity.js +75 -0
- package/dist/functions/similarity/cosine-similarity.js.map +1 -0
- package/dist/functions/similarity/index.d.ts +7 -0
- package/dist/functions/similarity/index.d.ts.map +1 -0
- package/dist/functions/similarity/index.js +11 -0
- package/dist/functions/similarity/index.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +172 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/index.d.ts +15 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +17 -0
- package/dist/runtime/index.js.map +1 -0
- package/package.json +41 -0
- package/src/core/compilers/condition.compiler.ts +176 -0
- package/src/core/compilers/index.ts +9 -0
- package/src/core/engine/engine.interface.ts +49 -0
- package/src/core/engine/index.ts +5 -0
- package/src/core/evaluation/condition.evaluator.ts +185 -0
- package/src/core/evaluation/index.ts +20 -0
- package/src/core/evaluation/temporal.ts +222 -0
- package/src/core/index.ts +75 -0
- package/src/core/matching/activation.types.ts +12 -0
- package/src/core/matching/index.ts +6 -0
- package/src/core/matching/matcher.ts +127 -0
- package/src/core/memory/index.ts +6 -0
- package/src/core/memory/working-memory.interface.ts +95 -0
- package/src/core/memory/working-memory.ts +123 -0
- package/src/core/operators/adapters/context.adapter.ts +53 -0
- package/src/core/operators/adapters/index.ts +25 -0
- package/src/core/operators/adapters/operator.adapter.ts +173 -0
- package/src/core/operators/arithmetic/add.ts +44 -0
- package/src/core/operators/arithmetic/average.ts +25 -0
- package/src/core/operators/arithmetic/divide.ts +42 -0
- package/src/core/operators/arithmetic/index.ts +42 -0
- package/src/core/operators/arithmetic/min-max.ts +70 -0
- package/src/core/operators/arithmetic/multiply.ts +40 -0
- package/src/core/operators/arithmetic/number-checks.ts +123 -0
- package/src/core/operators/arithmetic/power.ts +40 -0
- package/src/core/operators/arithmetic/rounding.ts +83 -0
- package/src/core/operators/arithmetic/subtract.ts +41 -0
- package/src/core/operators/array/contains.ts +85 -0
- package/src/core/operators/array/index.ts +18 -0
- package/src/core/operators/comparison/approximately-equals.ts +45 -0
- package/src/core/operators/comparison/equals.ts +49 -0
- package/src/core/operators/comparison/greater-than.ts +53 -0
- package/src/core/operators/comparison/index.ts +33 -0
- package/src/core/operators/comparison/less-than.ts +53 -0
- package/src/core/operators/comparison/not-equals.ts +49 -0
- package/src/core/operators/comparison/nullish.ts +155 -0
- package/src/core/operators/date/arithmetic.ts +246 -0
- package/src/core/operators/date/boundaries.ts +155 -0
- package/src/core/operators/date/checks.ts +116 -0
- package/src/core/operators/date/comparisons.ts +124 -0
- package/src/core/operators/date/constants.ts +102 -0
- package/src/core/operators/date/differences.ts +150 -0
- package/src/core/operators/date/extraction.ts +145 -0
- package/src/core/operators/date/generators.ts +232 -0
- package/src/core/operators/date/index.ts +63 -0
- package/src/core/operators/date/range.ts +39 -0
- package/src/core/operators/evaluator.ts +245 -0
- package/src/core/operators/examples.ts +233 -0
- package/src/core/operators/index.ts +135 -0
- package/src/core/operators/logical/and.ts +25 -0
- package/src/core/operators/logical/if.ts +31 -0
- package/src/core/operators/logical/index.ts +30 -0
- package/src/core/operators/logical/not.ts +25 -0
- package/src/core/operators/logical/or.ts +25 -0
- package/src/core/operators/logical/xor.ts +40 -0
- package/src/core/operators/operator.ts +338 -0
- package/src/core/operators/phonetic/caverphone.ts +40 -0
- package/src/core/operators/phonetic/index.ts +24 -0
- package/src/core/operators/phonetic/nysiis.ts +40 -0
- package/src/core/operators/phonetic/soundex.ts +41 -0
- package/src/core/operators/registry.ts +254 -0
- package/src/core/operators/similarity/cosine.ts +27 -0
- package/src/core/operators/similarity/index.ts +18 -0
- package/src/core/operators/string/contains.ts +42 -0
- package/src/core/operators/string/empty.ts +55 -0
- package/src/core/operators/string/ends-with.ts +40 -0
- package/src/core/operators/string/index.ts +30 -0
- package/src/core/operators/string/regex.ts +42 -0
- package/src/core/operators/string/starts-with.ts +40 -0
- package/src/core/operators/transform/case.ts +74 -0
- package/src/core/operators/transform/concat.ts +54 -0
- package/src/core/operators/transform/index.ts +36 -0
- package/src/core/operators/transform/length.ts +37 -0
- package/src/core/operators/transform/pad.ts +40 -0
- package/src/core/operators/transform/replace.ts +38 -0
- package/src/core/operators/transform/substring.ts +69 -0
- package/src/core/operators/transform/trim.ts +54 -0
- package/src/core/operators/types.ts +140 -0
- package/src/core/parser/errors.ts +77 -0
- package/src/core/parser/index.ts +133 -0
- package/src/core/parser/operators/aliases.ts +358 -0
- package/src/core/parser/operators/index.ts +35 -0
- package/src/core/parser/operators/operator-table.ts +107 -0
- package/src/core/parser/operators/precedence.ts +94 -0
- package/src/core/parser/parser/expression.parser.ts +308 -0
- package/src/core/parser/parser/function.parser.ts +113 -0
- package/src/core/parser/parser/index.ts +20 -0
- package/src/core/parser/parser/primary.parser.ts +149 -0
- package/src/core/parser/parser/types.ts +51 -0
- package/src/core/parser/tokenizer/index.ts +85 -0
- package/src/core/parser/tokenizer/readers/identifier.reader.ts +118 -0
- package/src/core/parser/tokenizer/readers/index.ts +20 -0
- package/src/core/parser/tokenizer/readers/number.reader.ts +132 -0
- package/src/core/parser/tokenizer/readers/property-ref.reader.ts +130 -0
- package/src/core/parser/tokenizer/readers/string.reader.ts +110 -0
- package/src/core/parser/tokenizer/readers/symbol.reader.ts +118 -0
- package/src/core/parser/tokenizer/readers/whitespace.reader.ts +18 -0
- package/src/core/parser/tokenizer/scanner.ts +137 -0
- package/src/core/parser/tokenizer/types.ts +63 -0
- package/src/core/parser/types.ts +102 -0
- package/src/core/refraction/index.ts +5 -0
- package/src/core/refraction/refraction.ts +71 -0
- package/src/core/resolution/conflict-resolver.ts +87 -0
- package/src/core/resolution/index.ts +10 -0
- package/src/core/shapes/index.ts +5 -0
- package/src/core/shapes/shape.normalizer.ts +68 -0
- package/src/core/types/condition.ts +185 -0
- package/src/core/types/fact.ts +26 -0
- package/src/core/types/index.ts +55 -0
- package/src/core/types/rule.ts +108 -0
- package/src/core/types/schema.ts +18 -0
- package/src/engines/backward/compiler.ts +118 -0
- package/src/engines/backward/engine.ts +123 -0
- package/src/engines/backward/index.ts +39 -0
- package/src/engines/backward/strategy.ts +229 -0
- package/src/engines/backward/types.ts +125 -0
- package/src/engines/bayesian/compiler.ts +402 -0
- package/src/engines/bayesian/engine.ts +122 -0
- package/src/engines/bayesian/index.ts +50 -0
- package/src/engines/bayesian/strategy.ts +273 -0
- package/src/engines/bayesian/types.ts +219 -0
- package/src/engines/constraint/compiler.ts +267 -0
- package/src/engines/constraint/engine.ts +175 -0
- package/src/engines/constraint/index.ts +18 -0
- package/src/engines/constraint/strategy.ts +725 -0
- package/src/engines/constraint/types.ts +415 -0
- package/src/engines/defeasible/compiler.ts +306 -0
- package/src/engines/defeasible/engine.ts +142 -0
- package/src/engines/defeasible/index.ts +48 -0
- package/src/engines/defeasible/strategy.ts +573 -0
- package/src/engines/defeasible/types.ts +409 -0
- package/src/engines/expert/README.md +343 -0
- package/src/engines/expert/compiler.ts +277 -0
- package/src/engines/expert/doc/expert-loan-approval.ts +458 -0
- package/src/engines/expert/engine.ts +228 -0
- package/src/engines/expert/formatter.ts +242 -0
- package/src/engines/expert/index.ts +85 -0
- package/src/engines/expert/interpolation.ts +278 -0
- package/src/engines/expert/strategy.ts +413 -0
- package/src/engines/expert/types.ts +442 -0
- package/src/engines/forward/compiler.ts +205 -0
- package/src/engines/forward/engine.ts +138 -0
- package/src/engines/forward/index.ts +51 -0
- package/src/engines/forward/strategy.ts +197 -0
- package/src/engines/forward/types.ts +205 -0
- package/src/engines/fuzzy/compiler.ts +182 -0
- package/src/engines/fuzzy/defuzzify.ts +39 -0
- package/src/engines/fuzzy/engine.ts +124 -0
- package/src/engines/fuzzy/fuzzy.defuzzify.ts +564 -0
- package/src/engines/fuzzy/fuzzy.membership.ts +604 -0
- package/src/engines/fuzzy/fuzzy.types.ts +357 -0
- package/src/engines/fuzzy/index.ts +38 -0
- package/src/engines/fuzzy/membership.ts +22 -0
- package/src/engines/fuzzy/strategy.ts +373 -0
- package/src/engines/fuzzy/types.ts +84 -0
- package/src/engines/index.ts +45 -0
- package/src/engines/monte-carlo/compiler.ts +459 -0
- package/src/engines/monte-carlo/engine.ts +134 -0
- package/src/engines/monte-carlo/index.ts +44 -0
- package/src/engines/monte-carlo/strategy.ts +565 -0
- package/src/engines/monte-carlo/types.ts +320 -0
- package/src/engines/pricing/calculator.ts +272 -0
- package/src/engines/pricing/compiler.ts +381 -0
- package/src/engines/pricing/engine.ts +152 -0
- package/src/engines/pricing/index.ts +156 -0
- package/src/engines/pricing/strategy.ts +736 -0
- package/src/engines/pricing/types.ts +782 -0
- package/src/engines/scoring/compiler.ts +139 -0
- package/src/engines/scoring/engine.ts +121 -0
- package/src/engines/scoring/index.ts +46 -0
- package/src/engines/scoring/strategy.ts +190 -0
- package/src/engines/scoring/types.ts +201 -0
- package/src/engines/sequential/compiler.ts +201 -0
- package/src/engines/sequential/engine.ts +124 -0
- package/src/engines/sequential/index.ts +38 -0
- package/src/engines/sequential/strategy.ts +125 -0
- package/src/engines/sequential/types.ts +101 -0
- package/src/engines/state-machine/compiler.ts +266 -0
- package/src/engines/state-machine/engine.ts +128 -0
- package/src/engines/state-machine/index.ts +45 -0
- package/src/engines/state-machine/strategy.ts +634 -0
- package/src/engines/state-machine/types.ts +254 -0
- package/src/engines/utility/compiler.ts +208 -0
- package/src/engines/utility/engine.ts +200 -0
- package/src/engines/utility/index.ts +53 -0
- package/src/engines/utility/strategy.ts +315 -0
- package/src/engines/utility/types.ts +225 -0
- package/src/functions/README.md +63 -0
- package/src/functions/index.ts +12 -0
- package/src/functions/phonetic/caverphone2.ts +172 -0
- package/src/functions/phonetic/index.ts +9 -0
- package/src/functions/phonetic/nysiis.ts +164 -0
- package/src/functions/phonetic/soundex.ts +111 -0
- package/src/functions/similarity/cosine-similarity.ts +83 -0
- package/src/functions/similarity/index.ts +7 -0
- package/src/index.ts +362 -0
- package/src/runtime/index.ts +16 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility/MCDM Engine Strategy
|
|
3
|
+
*
|
|
4
|
+
* Compares alternatives across weighted criteria using Multi-Criteria
|
|
5
|
+
* Decision Making (MCDM) methodology.
|
|
6
|
+
*
|
|
7
|
+
* Algorithm:
|
|
8
|
+
* 1. Identify all alternatives in working memory (by type)
|
|
9
|
+
* 2. For each alternative, evaluate all criterion rules to get raw scores
|
|
10
|
+
* 3. Normalize scores across alternatives (min-max or z-score)
|
|
11
|
+
* 4. Apply direction (flip scores for 'minimize' criteria)
|
|
12
|
+
* 5. Aggregate weighted scores per alternative
|
|
13
|
+
* 6. Rank alternatives by utility score
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
evaluateCondition
|
|
18
|
+
} from '../../core';
|
|
19
|
+
import { IWorkingMemory } from '../../core/memory';
|
|
20
|
+
import { Fact } from '../../core/types/fact';
|
|
21
|
+
|
|
22
|
+
import {
|
|
23
|
+
CompiledUtilityRuleSet,
|
|
24
|
+
CompiledUtilityCriterion,
|
|
25
|
+
UtilityOptions,
|
|
26
|
+
UtilityResult,
|
|
27
|
+
AlternativeResult,
|
|
28
|
+
SensitivityInfo
|
|
29
|
+
} from './types';
|
|
30
|
+
|
|
31
|
+
export class UtilityStrategy {
|
|
32
|
+
run(
|
|
33
|
+
ruleSet: CompiledUtilityRuleSet,
|
|
34
|
+
wm: IWorkingMemory,
|
|
35
|
+
alternativeType: string,
|
|
36
|
+
options: UtilityOptions = {}
|
|
37
|
+
): UtilityResult {
|
|
38
|
+
const startTime = performance.now();
|
|
39
|
+
const { onEvaluate, onScore, computeSensitivity = false } = options;
|
|
40
|
+
const config = ruleSet.config;
|
|
41
|
+
const criteria = ruleSet.criteria;
|
|
42
|
+
|
|
43
|
+
// Get all alternatives of the specified type
|
|
44
|
+
const alternatives = wm.getByType(alternativeType);
|
|
45
|
+
|
|
46
|
+
if (alternatives.length === 0) {
|
|
47
|
+
const executionTimeMs = Math.round((performance.now() - startTime) * 100) / 100;
|
|
48
|
+
return {
|
|
49
|
+
alternatives: [],
|
|
50
|
+
ranking: [],
|
|
51
|
+
winner: null,
|
|
52
|
+
executionTimeMs
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Phase 1: Compute raw scores for each alternative-criterion pair
|
|
57
|
+
const rawScores: Map<string, Record<string, number>> = new Map();
|
|
58
|
+
|
|
59
|
+
for (const alt of alternatives) {
|
|
60
|
+
const altId = alt.id;
|
|
61
|
+
const scores: Record<string, number> = {};
|
|
62
|
+
|
|
63
|
+
for (const criterion of criteria) {
|
|
64
|
+
// Find rules that compute this criterion
|
|
65
|
+
const criterionRules = ruleSet.rules.filter(r => r.criterion === criterion.id);
|
|
66
|
+
|
|
67
|
+
for (const rule of criterionRules) {
|
|
68
|
+
// Create a temporary working memory with just this alternative
|
|
69
|
+
// to match against the rule
|
|
70
|
+
const activations = this.matchAlternative(rule, alt, wm);
|
|
71
|
+
|
|
72
|
+
for (const activation of activations) {
|
|
73
|
+
// Evaluate the compute expression
|
|
74
|
+
const result = evaluateCondition(rule.compute as any, activation.facts);
|
|
75
|
+
const value = typeof result === 'number' ? result : 0;
|
|
76
|
+
|
|
77
|
+
// Store the score (last one wins if multiple rules match)
|
|
78
|
+
scores[criterion.id] = value;
|
|
79
|
+
|
|
80
|
+
if (onEvaluate) {
|
|
81
|
+
onEvaluate(altId, criterion.id, value);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Default to 0 if no rule matched
|
|
87
|
+
if (scores[criterion.id] === undefined) {
|
|
88
|
+
scores[criterion.id] = 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
rawScores.set(altId, scores);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Phase 2: Normalize scores across alternatives
|
|
96
|
+
const normalizedScores: Map<string, Record<string, number>> = new Map();
|
|
97
|
+
|
|
98
|
+
for (const criterion of criteria) {
|
|
99
|
+
const allValues = alternatives.map(alt => rawScores.get(alt.id)![criterion.id]);
|
|
100
|
+
|
|
101
|
+
if (config.normalization === 'min-max') {
|
|
102
|
+
const min = Math.min(...allValues);
|
|
103
|
+
const max = Math.max(...allValues);
|
|
104
|
+
const range = max - min;
|
|
105
|
+
|
|
106
|
+
for (const alt of alternatives) {
|
|
107
|
+
if (!normalizedScores.has(alt.id)) {
|
|
108
|
+
normalizedScores.set(alt.id, {});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const raw = rawScores.get(alt.id)![criterion.id];
|
|
112
|
+
let normalized = range > 0 ? (raw - min) / range : 0.5;
|
|
113
|
+
|
|
114
|
+
// Flip for minimize criteria (lower raw = higher normalized)
|
|
115
|
+
if (criterion.direction === 'minimize') {
|
|
116
|
+
normalized = 1 - normalized;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
normalizedScores.get(alt.id)![criterion.id] = normalized;
|
|
120
|
+
}
|
|
121
|
+
} else if (config.normalization === 'z-score') {
|
|
122
|
+
const mean = allValues.reduce((a, b) => a + b, 0) / allValues.length;
|
|
123
|
+
const variance = allValues.reduce((sum, v) => sum + Math.pow(v - mean, 2), 0) / allValues.length;
|
|
124
|
+
const stdDev = Math.sqrt(variance);
|
|
125
|
+
|
|
126
|
+
for (const alt of alternatives) {
|
|
127
|
+
if (!normalizedScores.has(alt.id)) {
|
|
128
|
+
normalizedScores.set(alt.id, {});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const raw = rawScores.get(alt.id)![criterion.id];
|
|
132
|
+
let normalized = stdDev > 0 ? (raw - mean) / stdDev : 0;
|
|
133
|
+
|
|
134
|
+
// Convert z-score to 0-1 range (approximately)
|
|
135
|
+
// Using sigmoid-like transformation
|
|
136
|
+
normalized = 1 / (1 + Math.exp(-normalized));
|
|
137
|
+
|
|
138
|
+
// Flip for minimize criteria
|
|
139
|
+
if (criterion.direction === 'minimize') {
|
|
140
|
+
normalized = 1 - normalized;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
normalizedScores.get(alt.id)![criterion.id] = normalized;
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
// No normalization - just copy raw scores (and flip for minimize)
|
|
147
|
+
for (const alt of alternatives) {
|
|
148
|
+
if (!normalizedScores.has(alt.id)) {
|
|
149
|
+
normalizedScores.set(alt.id, {});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
let value = rawScores.get(alt.id)![criterion.id];
|
|
153
|
+
|
|
154
|
+
if (criterion.direction === 'minimize') {
|
|
155
|
+
// For no normalization with minimize, invert the value
|
|
156
|
+
value = value !== 0 ? 1 / value : Infinity;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
normalizedScores.get(alt.id)![criterion.id] = value;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Phase 3: Compute weighted scores and aggregate
|
|
165
|
+
const results: AlternativeResult[] = [];
|
|
166
|
+
|
|
167
|
+
for (const alt of alternatives) {
|
|
168
|
+
const normalized = normalizedScores.get(alt.id)!;
|
|
169
|
+
const weighted: Record<string, number> = {};
|
|
170
|
+
let utilityScore: number;
|
|
171
|
+
|
|
172
|
+
if (config.aggregation === 'weighted-sum') {
|
|
173
|
+
utilityScore = 0;
|
|
174
|
+
for (const criterion of criteria) {
|
|
175
|
+
const weightedValue = normalized[criterion.id] * criterion.weight;
|
|
176
|
+
weighted[criterion.id] = weightedValue;
|
|
177
|
+
utilityScore += weightedValue;
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
// weighted-product
|
|
181
|
+
utilityScore = 1;
|
|
182
|
+
for (const criterion of criteria) {
|
|
183
|
+
const weightedValue = Math.pow(normalized[criterion.id], criterion.weight);
|
|
184
|
+
weighted[criterion.id] = weightedValue;
|
|
185
|
+
utilityScore *= weightedValue;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const result: AlternativeResult = {
|
|
190
|
+
id: alt.id,
|
|
191
|
+
name: alt.data.name || alt.id,
|
|
192
|
+
rawScores: rawScores.get(alt.id)!,
|
|
193
|
+
normalizedScores: normalized,
|
|
194
|
+
weightedScores: weighted,
|
|
195
|
+
utilityScore
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
results.push(result);
|
|
199
|
+
|
|
200
|
+
if (onScore) {
|
|
201
|
+
onScore(result);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Phase 4: Rank by utility score (descending)
|
|
206
|
+
const ranking = [...results].sort((a, b) => b.utilityScore - a.utilityScore);
|
|
207
|
+
const winner = ranking.length > 0 ? ranking[0] : null;
|
|
208
|
+
|
|
209
|
+
// Phase 5: Sensitivity analysis (optional)
|
|
210
|
+
let sensitivity: Record<string, SensitivityInfo> | undefined;
|
|
211
|
+
|
|
212
|
+
if (computeSensitivity && winner && ranking.length > 1) {
|
|
213
|
+
sensitivity = this.computeSensitivity(ranking, criteria);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const executionTimeMs = Math.round((performance.now() - startTime) * 100) / 100;
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
alternatives: results,
|
|
220
|
+
ranking,
|
|
221
|
+
winner,
|
|
222
|
+
sensitivity,
|
|
223
|
+
executionTimeMs
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Match a rule against a single alternative fact
|
|
229
|
+
*/
|
|
230
|
+
private matchAlternative(rule: any, alternative: Fact, wm: IWorkingMemory): Array<{ facts: Record<string, any> }> {
|
|
231
|
+
// Simple matching: if the rule's first input type matches the alternative type
|
|
232
|
+
const firstInput = rule.inputs[0];
|
|
233
|
+
if (!firstInput) return [];
|
|
234
|
+
|
|
235
|
+
if (firstInput.type !== alternative.type) {
|
|
236
|
+
return [];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Build bindings with fact-like objects (condition evaluator expects { data: ... })
|
|
240
|
+
const bindings: Record<string, any> = {
|
|
241
|
+
[firstInput.name]: { data: alternative.data }
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
// Handle additional inputs (join with other facts in working memory)
|
|
245
|
+
for (let i = 1; i < rule.inputs.length; i++) {
|
|
246
|
+
const input = rule.inputs[i];
|
|
247
|
+
const facts = wm.getByType(input.type);
|
|
248
|
+
|
|
249
|
+
if (facts.length === 0) {
|
|
250
|
+
return []; // Required input type not found
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// For simplicity, take the first matching fact
|
|
254
|
+
// A more sophisticated implementation would handle all combinations
|
|
255
|
+
const fact = facts[0];
|
|
256
|
+
bindings[input.name] = { data: fact.data };
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Check when condition
|
|
260
|
+
if (rule.when) {
|
|
261
|
+
const result = evaluateCondition(rule.when, bindings);
|
|
262
|
+
if (!result) {
|
|
263
|
+
return [];
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return [{ facts: bindings }];
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Compute sensitivity analysis: how much would weights need to change
|
|
272
|
+
* for the ranking to change?
|
|
273
|
+
*/
|
|
274
|
+
private computeSensitivity(
|
|
275
|
+
ranking: AlternativeResult[],
|
|
276
|
+
criteria: CompiledUtilityCriterion[]
|
|
277
|
+
): Record<string, SensitivityInfo> {
|
|
278
|
+
const winner = ranking[0];
|
|
279
|
+
const runnerUp = ranking[1];
|
|
280
|
+
const sensitivity: Record<string, SensitivityInfo> = {};
|
|
281
|
+
|
|
282
|
+
for (const criterion of criteria) {
|
|
283
|
+
const info: SensitivityInfo = {
|
|
284
|
+
currentTop: winner.name
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
// Calculate the weight change needed to flip the ranking
|
|
288
|
+
const winnerNorm = winner.normalizedScores[criterion.id];
|
|
289
|
+
const runnerNorm = runnerUp.normalizedScores[criterion.id];
|
|
290
|
+
|
|
291
|
+
// Only interesting if runner-up scores better on this criterion
|
|
292
|
+
if (runnerNorm > winnerNorm) {
|
|
293
|
+
// Simplified sensitivity: would need significant weight increase
|
|
294
|
+
// to flip (actual calculation is more complex)
|
|
295
|
+
const gap = winner.utilityScore - runnerUp.utilityScore;
|
|
296
|
+
const scoreDiff = runnerNorm - winnerNorm;
|
|
297
|
+
|
|
298
|
+
if (scoreDiff > 0) {
|
|
299
|
+
const weightNeeded = gap / scoreDiff + criterion.weight;
|
|
300
|
+
if (weightNeeded <= 1) {
|
|
301
|
+
info.topChangeAt = weightNeeded;
|
|
302
|
+
info.wouldBecome = runnerUp.name;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
sensitivity[criterion.id] = info;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
return sensitivity;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Export a singleton instance for convenience
|
|
315
|
+
export const utilityStrategy = new UtilityStrategy();
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility/MCDM Engine Types
|
|
3
|
+
*
|
|
4
|
+
* Multi-Criteria Decision Making engine for comparing alternatives
|
|
5
|
+
* across weighted criteria. Unlike Scoring (which evaluates one item),
|
|
6
|
+
* MCDM explicitly models trade-offs between multiple options.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
BaseRule,
|
|
11
|
+
BaseRuleSet,
|
|
12
|
+
CompiledBaseRule,
|
|
13
|
+
CompiledBaseRuleSet,
|
|
14
|
+
CompiledCondition,
|
|
15
|
+
Expression
|
|
16
|
+
} from '../../core';
|
|
17
|
+
|
|
18
|
+
// ========================================
|
|
19
|
+
// Semantic Priority Types
|
|
20
|
+
// ========================================
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Semantic priority levels for expressing criterion importance in human-readable terms.
|
|
24
|
+
* The compiler converts these to numeric weights and auto-normalizes.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* {
|
|
29
|
+
* id: 'low-fees',
|
|
30
|
+
* name: 'Low Agency Fees',
|
|
31
|
+
* weight: 'critical', // Instead of 0.25
|
|
32
|
+
* direction: 'maximize'
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export type SemanticPriority = 'critical' | 'high' | 'medium' | 'low' | 'not-important';
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Base numeric values for semantic priorities (before normalization).
|
|
40
|
+
* These are relative weights that get normalized to sum to 1.0.
|
|
41
|
+
*
|
|
42
|
+
* - critical: 5 (highest priority)
|
|
43
|
+
* - high: 3
|
|
44
|
+
* - medium: 2
|
|
45
|
+
* - low: 1
|
|
46
|
+
* - not-important: 0 (excluded from calculation)
|
|
47
|
+
*/
|
|
48
|
+
export const SEMANTIC_PRIORITY_VALUES: Record<SemanticPriority, number> = {
|
|
49
|
+
'critical': 5,
|
|
50
|
+
'high': 3,
|
|
51
|
+
'medium': 2,
|
|
52
|
+
'low': 1,
|
|
53
|
+
'not-important': 0
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Check if a value is a semantic priority string
|
|
58
|
+
*/
|
|
59
|
+
export function isSemanticPriority(value: unknown): value is SemanticPriority {
|
|
60
|
+
return typeof value === 'string' && value in SEMANTIC_PRIORITY_VALUES;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ========================================
|
|
64
|
+
// Criterion Types
|
|
65
|
+
// ========================================
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A criterion (dimension) for evaluating alternatives.
|
|
69
|
+
*
|
|
70
|
+
* Weight can be specified as:
|
|
71
|
+
* - A number (0-1): Traditional numeric weight, all weights should sum to 1
|
|
72
|
+
* - A SemanticPriority: Human-readable priority that gets auto-normalized
|
|
73
|
+
*
|
|
74
|
+
* @example Numeric weight
|
|
75
|
+
* ```typescript
|
|
76
|
+
* {
|
|
77
|
+
* id: 'compensation',
|
|
78
|
+
* name: 'Total Compensation',
|
|
79
|
+
* weight: 0.30,
|
|
80
|
+
* direction: 'maximize'
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @example Semantic weight (auto-normalized)
|
|
85
|
+
* ```typescript
|
|
86
|
+
* {
|
|
87
|
+
* id: 'low-fees',
|
|
88
|
+
* name: 'Low Agency Fees',
|
|
89
|
+
* weight: 'critical',
|
|
90
|
+
* direction: 'maximize'
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export type UtilityCriterion = {
|
|
95
|
+
id: string;
|
|
96
|
+
name?: string;
|
|
97
|
+
weight: number | SemanticPriority; // Numeric (0-1) or semantic priority
|
|
98
|
+
direction: 'maximize' | 'minimize';
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Compiled criterion with validated weight
|
|
103
|
+
*/
|
|
104
|
+
export type CompiledUtilityCriterion = {
|
|
105
|
+
id: string;
|
|
106
|
+
name?: string;
|
|
107
|
+
weight: number;
|
|
108
|
+
direction: 'maximize' | 'minimize';
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// ========================================
|
|
112
|
+
// Source Types (User-Defined)
|
|
113
|
+
// ========================================
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Utility rule - computes a criterion value for an alternative
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* {
|
|
121
|
+
* id: 'calc-compensation',
|
|
122
|
+
* criterion: 'compensation',
|
|
123
|
+
* inputs: [{ name: 'offer', type: 'JobOffer' }],
|
|
124
|
+
* compute: ['add', '$offer.baseSalary', '$offer.bonus']
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export type UtilityRule = BaseRule & {
|
|
129
|
+
criterion: string; // ID of the criterion this rule computes
|
|
130
|
+
compute: Expression; // Expression to calculate the raw value
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Utility ruleset configuration
|
|
135
|
+
*/
|
|
136
|
+
export type UtilityConfig = {
|
|
137
|
+
mode: 'utility';
|
|
138
|
+
normalization: 'min-max' | 'z-score' | 'none';
|
|
139
|
+
aggregation: 'weighted-sum' | 'weighted-product';
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Utility ruleset
|
|
144
|
+
*/
|
|
145
|
+
export type UtilityRuleSet = BaseRuleSet & {
|
|
146
|
+
mode: 'utility';
|
|
147
|
+
criteria: UtilityCriterion[];
|
|
148
|
+
rules: UtilityRule[];
|
|
149
|
+
config?: Partial<Omit<UtilityConfig, 'mode'>>;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// ========================================
|
|
153
|
+
// Compiled Types
|
|
154
|
+
// ========================================
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Compiled utility rule
|
|
158
|
+
*/
|
|
159
|
+
export type CompiledUtilityRule = CompiledBaseRule & {
|
|
160
|
+
criterion: string;
|
|
161
|
+
compute: CompiledCondition;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Compiled utility ruleset
|
|
166
|
+
*/
|
|
167
|
+
export type CompiledUtilityRuleSet = CompiledBaseRuleSet & {
|
|
168
|
+
mode: 'utility';
|
|
169
|
+
criteria: CompiledUtilityCriterion[];
|
|
170
|
+
rules: CompiledUtilityRule[];
|
|
171
|
+
config: UtilityConfig;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// ========================================
|
|
175
|
+
// Runtime Types
|
|
176
|
+
// ========================================
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Result for a single alternative
|
|
180
|
+
*/
|
|
181
|
+
export type AlternativeResult = {
|
|
182
|
+
id: string;
|
|
183
|
+
name: string;
|
|
184
|
+
rawScores: Record<string, number>; // Criterion ID -> raw value
|
|
185
|
+
normalizedScores: Record<string, number>; // Criterion ID -> 0-1 normalized
|
|
186
|
+
weightedScores: Record<string, number>; // Criterion ID -> weighted contribution
|
|
187
|
+
utilityScore: number; // Final aggregated score
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Sensitivity analysis for a criterion
|
|
192
|
+
*/
|
|
193
|
+
export type SensitivityInfo = {
|
|
194
|
+
currentTop: string; // Current top alternative
|
|
195
|
+
topChangeAt?: number; // Weight at which top would change
|
|
196
|
+
wouldBecome?: string; // Alternative that would become top
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Runtime options for utility execution
|
|
201
|
+
*/
|
|
202
|
+
export type UtilityOptions = {
|
|
203
|
+
/** Callback when evaluating a criterion for an alternative */
|
|
204
|
+
onEvaluate?: (alternativeId: string, criterion: string, rawValue: number) => void;
|
|
205
|
+
/** Callback when an alternative is fully scored */
|
|
206
|
+
onScore?: (alternative: AlternativeResult) => void;
|
|
207
|
+
/** Whether to compute sensitivity analysis (default: false) */
|
|
208
|
+
computeSensitivity?: boolean;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Execution result
|
|
213
|
+
*/
|
|
214
|
+
export type UtilityResult = {
|
|
215
|
+
/** All alternatives with their scores */
|
|
216
|
+
alternatives: AlternativeResult[];
|
|
217
|
+
/** Alternatives sorted by utility score (descending) */
|
|
218
|
+
ranking: AlternativeResult[];
|
|
219
|
+
/** Winner (highest utility) */
|
|
220
|
+
winner: AlternativeResult | null;
|
|
221
|
+
/** Sensitivity analysis per criterion (if requested) */
|
|
222
|
+
sensitivity?: Record<string, SensitivityInfo>;
|
|
223
|
+
/** Processing time in milliseconds */
|
|
224
|
+
executionTimeMs: number;
|
|
225
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Functions Library
|
|
2
|
+
|
|
3
|
+
Specialized functions for use in rule engine expressions.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
src/functions/
|
|
9
|
+
├── phonetic/ # Phonetic encoding algorithms
|
|
10
|
+
│ ├── soundex.ts # Classic Soundex (4-char codes)
|
|
11
|
+
│ ├── nysiis.ts # NYSIIS (6-char codes)
|
|
12
|
+
│ └── caverphone2.ts # Caverphone2 (10-char codes)
|
|
13
|
+
├── similarity/ # Text similarity measures
|
|
14
|
+
│ └── cosine-similarity.ts # Cosine similarity (0-1 score)
|
|
15
|
+
└── index.ts # Main exports
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { soundex, nysiis, caverphone2, cosineSimilarity } from '../src/functions';
|
|
22
|
+
|
|
23
|
+
// Phonetic matching
|
|
24
|
+
soundex('Smith'); // "S530"
|
|
25
|
+
nysiis('Schmidt'); // "SNAD"
|
|
26
|
+
caverphone2('Peter'); // "PT11111111"
|
|
27
|
+
|
|
28
|
+
// Text similarity
|
|
29
|
+
cosineSimilarity('hello world', 'hello there'); // 0.50
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Categories
|
|
33
|
+
|
|
34
|
+
### Phonetic Encoding
|
|
35
|
+
|
|
36
|
+
Functions that encode names into phonetic codes for matching similar-sounding names:
|
|
37
|
+
|
|
38
|
+
- **Soundex** - Classic algorithm, widely used, 4-character codes
|
|
39
|
+
- **NYSIIS** - More accurate than Soundex, handles spelling variations, 6-character codes
|
|
40
|
+
- **Caverphone2** - Complex algorithm optimized for NZ/Australian accents, 10-character codes
|
|
41
|
+
|
|
42
|
+
### Text Similarity
|
|
43
|
+
|
|
44
|
+
Functions that measure similarity between text strings:
|
|
45
|
+
|
|
46
|
+
- **Cosine Similarity** - Vector-based text similarity measure (0-1 score)
|
|
47
|
+
|
|
48
|
+
## Adding New Functions
|
|
49
|
+
|
|
50
|
+
When adding new functions:
|
|
51
|
+
|
|
52
|
+
1. Create the function in the appropriate category folder (or create a new category)
|
|
53
|
+
2. Export from the category's `index.ts`
|
|
54
|
+
3. The main `src/functions/index.ts` will re-export automatically via `export *`
|
|
55
|
+
4. Add examples to `examples/` directory
|
|
56
|
+
|
|
57
|
+
### Suggested Future Categories
|
|
58
|
+
|
|
59
|
+
- `distance/` - String distance metrics (Levenshtein, Hamming, Jaro-Winkler)
|
|
60
|
+
- `math/` - Mathematical functions (statistics, financial calculations)
|
|
61
|
+
- `datetime/` - Date/time utilities
|
|
62
|
+
- `validation/` - Validation functions (email, phone, credit card)
|
|
63
|
+
- `crypto/` - Cryptographic functions (hashing, encryption)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Niche Functions for Rule Engine
|
|
3
|
+
*
|
|
4
|
+
* Collection of specialized functions for use in rule expressions.
|
|
5
|
+
* Organized by category for easy discovery and maintenance.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Text Similarity Functions
|
|
9
|
+
export * from './similarity';
|
|
10
|
+
|
|
11
|
+
// Phonetic Encoding Functions
|
|
12
|
+
export * from './phonetic';
|