eyeling 1.32.0 → 1.33.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/README.md +123 -18
- package/bin/eyeling.cjs +56 -4
- package/browser.d.ts +63 -0
- package/dist/browser/eyeling.browser.js +298 -14
- package/examples/eyelang/INTEGRATION.md +13 -0
- package/examples/eyelang/README.md +628 -0
- package/examples/eyelang/SPEC.md +684 -0
- package/examples/eyelang/access-control-policy.pl +52 -0
- package/examples/eyelang/ackermann.pl +46 -0
- package/examples/eyelang/age.pl +28 -0
- package/examples/eyelang/aliases-and-namespaces.pl +22 -0
- package/examples/eyelang/alignment-demo.pl +44 -0
- package/examples/eyelang/allen-interval-calculus.pl +64 -0
- package/examples/eyelang/ancestor.pl +21 -0
- package/examples/eyelang/animal.pl +21 -0
- package/examples/eyelang/annotation-rdf12.ttl +12 -0
- package/examples/eyelang/annotation.pl +34 -0
- package/examples/eyelang/auroracare.pl +309 -0
- package/examples/eyelang/backward.pl +12 -0
- package/examples/eyelang/basic-monadic.pl +10018 -0
- package/examples/eyelang/bayes-diagnosis.pl +108 -0
- package/examples/eyelang/bayes-therapy.pl +182 -0
- package/examples/eyelang/beam-deflection.pl +50 -0
- package/examples/eyelang/blocks-world-planning.pl +75 -0
- package/examples/eyelang/bmi.pl +232 -0
- package/examples/eyelang/braking-safety-worlds.pl +69 -0
- package/examples/eyelang/buck-converter-design.pl +78 -0
- package/examples/eyelang/cache-performance.pl +54 -0
- package/examples/eyelang/canary-release.pl +49 -0
- package/examples/eyelang/cat-koko.pl +24 -0
- package/examples/eyelang/clinical-trial-screening.pl +92 -0
- package/examples/eyelang/collatz-1000.pl +14 -0
- package/examples/eyelang/combinatorics-findall-sort.pl +37 -0
- package/examples/eyelang/competitive-enzyme-kinetics.pl +78 -0
- package/examples/eyelang/complex-matrix-stability.pl +45 -0
- package/examples/eyelang/complex.pl +121 -0
- package/examples/eyelang/composition-of-injective-functions-is-injective.pl +50 -0
- package/examples/eyelang/context-association.pl +53 -0
- package/examples/eyelang/control-system.pl +72 -0
- package/examples/eyelang/cryptarithmetic-send-more-money.pl +49 -0
- package/examples/eyelang/cyclic-path.pl +16 -0
- package/examples/eyelang/d3-group.pl +100 -0
- package/examples/eyelang/dairy-energy-balance.pl +65 -0
- package/examples/eyelang/data-negotiation.pl +39 -0
- package/examples/eyelang/deep-taxonomy-10.pl +115 -0
- package/examples/eyelang/deep-taxonomy-100.pl +385 -0
- package/examples/eyelang/deep-taxonomy-1000.pl +3085 -0
- package/examples/eyelang/deep-taxonomy-10000.pl +30094 -0
- package/examples/eyelang/deep-taxonomy-100000.pl +300184 -0
- package/examples/eyelang/delfour.pl +281 -0
- package/examples/eyelang/dense-hamiltonian-cycle.pl +92 -0
- package/examples/eyelang/deontic-logic.pl +52 -0
- package/examples/eyelang/derived-backward-rule.pl +30 -0
- package/examples/eyelang/derived-rule.pl +27 -0
- package/examples/eyelang/diamond-property.pl +38 -0
- package/examples/eyelang/dijkstra-findall-sort.pl +44 -0
- package/examples/eyelang/dijkstra-risk-path.pl +86 -0
- package/examples/eyelang/dijkstra.pl +46 -0
- package/examples/eyelang/dining-philosophers.pl +140 -0
- package/examples/eyelang/directional-language.ttl +9 -0
- package/examples/eyelang/dog.pl +25 -0
- package/examples/eyelang/drone-corridor-planner.pl +51 -0
- package/examples/eyelang/easter-computus.pl +89 -0
- package/examples/eyelang/electrical-rc-filter.pl +36 -0
- package/examples/eyelang/epidemic-policy.pl +67 -0
- package/examples/eyelang/equivalence-classes-overlap-implies-same-class.pl +27 -0
- package/examples/eyelang/eulerian-path.pl +85 -0
- package/examples/eyelang/ev-range-worlds.pl +82 -0
- package/examples/eyelang/exact-cover-sudoku.pl +113 -0
- package/examples/eyelang/existential-rule.pl +18 -0
- package/examples/eyelang/exoplanet-validation-worlds.pl +88 -0
- package/examples/eyelang/expression-eval.pl +43 -0
- package/examples/eyelang/eyeling-ackermann.n3 +41 -0
- package/examples/eyelang/eyeling-age-threshold.n3 +12 -0
- package/examples/eyelang/eyeling-alignment-demo.n3 +11 -0
- package/examples/eyelang/eyeling-allen-interval-calculus-small.n3 +13 -0
- package/examples/eyelang/eyeling-backward-recursion.n3 +11 -0
- package/examples/eyelang/eyeling-backward.n3 +10 -0
- package/examples/eyelang/eyeling-basic-monadic-small.n3 +11 -0
- package/examples/eyelang/eyeling-bmi.n3 +10 -0
- package/examples/eyelang/eyeling-cat-koko.n3 +15 -0
- package/examples/eyelang/eyeling-collatz-small.n3 +11 -0
- package/examples/eyelang/eyeling-collection.n3 +11 -0
- package/examples/eyelang/eyeling-complex-arithmetic.n3 +10 -0
- package/examples/eyelang/eyeling-context-association.n3 +11 -0
- package/examples/eyelang/eyeling-control-system-small.n3 +11 -0
- package/examples/eyelang/eyeling-crypto-builtins-extra.n3 +10 -0
- package/examples/eyelang/eyeling-crypto-builtins.n3 +8 -0
- package/examples/eyelang/eyeling-deep-taxonomy-10.n3 +18 -0
- package/examples/eyelang/eyeling-derived-backward-rule-flat.n3 +10 -0
- package/examples/eyelang/eyeling-derived-rule-flat.n3 +9 -0
- package/examples/eyelang/eyeling-digital-product-passport-small.n3 +11 -0
- package/examples/eyelang/eyeling-dijkstra-tiny.n3 +14 -0
- package/examples/eyelang/eyeling-dog-license.n3 +13 -0
- package/examples/eyelang/eyeling-drone-corridor-planner-small.n3 +13 -0
- package/examples/eyelang/eyeling-equals.n3 +8 -0
- package/examples/eyelang/eyeling-equivalence-classes.n3 +11 -0
- package/examples/eyelang/eyeling-euler-identity.n3 +9 -0
- package/examples/eyelang/eyeling-existential-rule.n3 +9 -0
- package/examples/eyelang/eyeling-expression-eval.n3 +11 -0
- package/examples/eyelang/eyeling-family-cousins-extended.n3 +12 -0
- package/examples/eyelang/eyeling-fastpow.n3 +10 -0
- package/examples/eyelang/eyeling-fibonacci.n3 +44 -0
- package/examples/eyelang/eyeling-french-cities-reachability.n3 +22 -0
- package/examples/eyelang/eyeling-goldbach-small.n3 +22 -0
- package/examples/eyelang/eyeling-good-cobbler.n3 +9 -0
- package/examples/eyelang/eyeling-list-builtins.n3 +10 -0
- package/examples/eyelang/eyeling-list-collection-extra.n3 +9 -0
- package/examples/eyelang/eyeling-math-builtins.n3 +9 -0
- package/examples/eyelang/eyeling-string-builtins-extra.n3 +9 -0
- package/examples/eyelang/eyeling-string-builtins.n3 +10 -0
- package/examples/eyelang/eyeling-time-builtins.n3 +11 -0
- package/examples/eyelang/eyeling-time-components-extra.n3 +10 -0
- package/examples/eyelang/eyeling-witch.n3 +10 -0
- package/examples/eyelang/family-cousins.n3 +17 -0
- package/examples/eyelang/family-cousins.pl +65 -0
- package/examples/eyelang/fastpow.pl +53 -0
- package/examples/eyelang/fft8-numeric.pl +83 -0
- package/examples/eyelang/fibonacci.pl +53 -0
- package/examples/eyelang/field-nitrogen-balance.pl +70 -0
- package/examples/eyelang/flandor.pl +296 -0
- package/examples/eyelang/floating-point.pl +23 -0
- package/examples/eyelang/four-color-map.pl +127 -0
- package/examples/eyelang/fundamental-theorem-arithmetic.pl +113 -0
- package/examples/eyelang/gcd-bezout-identity.pl +48 -0
- package/examples/eyelang/gd-step-certified.pl +158 -0
- package/examples/eyelang/gdpr-compliance.pl +69 -0
- package/examples/eyelang/goldbach-1000.pl +185 -0
- package/examples/eyelang/good-cobbler.pl +14 -0
- package/examples/eyelang/gps.pl +152 -0
- package/examples/eyelang/graph-reachability.pl +36 -0
- package/examples/eyelang/gray-code-counter.pl +48 -0
- package/examples/eyelang/greatest-lower-bound-uniqueness.pl +28 -0
- package/examples/eyelang/group-inverse-uniqueness.pl +34 -0
- package/examples/eyelang/hamiltonian-cycle.pl +55 -0
- package/examples/eyelang/hamiltonian-path.pl +49 -0
- package/examples/eyelang/hamming-code.pl +105 -0
- package/examples/eyelang/hanoi.pl +20 -0
- package/examples/eyelang/heat-loss.pl +51 -0
- package/examples/eyelang/heron-theorem.pl +36 -0
- package/examples/eyelang/ideal-gas-law.pl +37 -0
- package/examples/eyelang/illegitimate-reasoning.pl +88 -0
- package/examples/eyelang/kaprekar.pl +32 -0
- package/examples/eyelang/law-of-cosines.pl +31 -0
- package/examples/eyelang/least-squares-regression.pl +81 -0
- package/examples/eyelang/list-collection.pl +33 -0
- package/examples/eyelang/lldm.pl +78 -0
- package/examples/eyelang/manufacturing-quality-control.pl +73 -0
- package/examples/eyelang/matrix.pl +296 -0
- package/examples/eyelang/microgrid-dispatch.pl +85 -0
- package/examples/eyelang/monkey-bananas.pl +45 -0
- package/examples/eyelang/n-queens.pl +23 -0
- package/examples/eyelang/n3-builtins.n3 +28 -0
- package/examples/eyelang/network-sla.pl +48 -0
- package/examples/eyelang/newton-raphson.pl +49 -0
- package/examples/eyelang/nixon-diamond.pl +37 -0
- package/examples/eyelang/odrl-dpv-healthcare-risk-ranked.pl +266 -0
- package/examples/eyelang/odrl-dpv-risk-ranked.pl +320 -0
- package/examples/eyelang/orbital-transfer-design.pl +113 -0
- package/examples/eyelang/output/access-control-policy.pl +2 -0
- package/examples/eyelang/output/ackermann.pl +12 -0
- package/examples/eyelang/output/age.pl +2 -0
- package/examples/eyelang/output/aliases-and-namespaces.pl +5 -0
- package/examples/eyelang/output/alignment-demo.pl +32 -0
- package/examples/eyelang/output/allen-interval-calculus.pl +154 -0
- package/examples/eyelang/output/ancestor.pl +6 -0
- package/examples/eyelang/output/animal.pl +4 -0
- package/examples/eyelang/output/annotation-rdf12.ttl +1 -0
- package/examples/eyelang/output/annotation.pl +4 -0
- package/examples/eyelang/output/auroracare.pl +117 -0
- package/examples/eyelang/output/backward.pl +1 -0
- package/examples/eyelang/output/basic-monadic.pl +1518 -0
- package/examples/eyelang/output/bayes-diagnosis.pl +13 -0
- package/examples/eyelang/output/bayes-therapy.pl +23 -0
- package/examples/eyelang/output/beam-deflection.pl +5 -0
- package/examples/eyelang/output/blocks-world-planning.pl +4 -0
- package/examples/eyelang/output/bmi.pl +32 -0
- package/examples/eyelang/output/braking-safety-worlds.pl +18 -0
- package/examples/eyelang/output/buck-converter-design.pl +6 -0
- package/examples/eyelang/output/cache-performance.pl +4 -0
- package/examples/eyelang/output/canary-release.pl +5 -0
- package/examples/eyelang/output/cat-koko.pl +3 -0
- package/examples/eyelang/output/clinical-trial-screening.pl +9 -0
- package/examples/eyelang/output/collatz-1000.pl +1000 -0
- package/examples/eyelang/output/combinatorics-findall-sort.pl +2 -0
- package/examples/eyelang/output/competitive-enzyme-kinetics.pl +6 -0
- package/examples/eyelang/output/complex-matrix-stability.pl +5 -0
- package/examples/eyelang/output/complex.pl +1 -0
- package/examples/eyelang/output/composition-of-injective-functions-is-injective.pl +2 -0
- package/examples/eyelang/output/context-association.pl +3 -0
- package/examples/eyelang/output/control-system.pl +6 -0
- package/examples/eyelang/output/cryptarithmetic-send-more-money.pl +6 -0
- package/examples/eyelang/output/cyclic-path.pl +16 -0
- package/examples/eyelang/output/d3-group.pl +2 -0
- package/examples/eyelang/output/dairy-energy-balance.pl +13 -0
- package/examples/eyelang/output/data-negotiation.pl +1 -0
- package/examples/eyelang/output/deep-taxonomy-10.pl +16 -0
- package/examples/eyelang/output/deep-taxonomy-100.pl +16 -0
- package/examples/eyelang/output/deep-taxonomy-1000.pl +16 -0
- package/examples/eyelang/output/deep-taxonomy-10000.pl +16 -0
- package/examples/eyelang/output/deep-taxonomy-100000.pl +16 -0
- package/examples/eyelang/output/delfour.pl +31 -0
- package/examples/eyelang/output/dense-hamiltonian-cycle.pl +4 -0
- package/examples/eyelang/output/deontic-logic.pl +4 -0
- package/examples/eyelang/output/derived-backward-rule.pl +3 -0
- package/examples/eyelang/output/derived-rule.pl +2 -0
- package/examples/eyelang/output/diamond-property.pl +4 -0
- package/examples/eyelang/output/dijkstra-findall-sort.pl +2 -0
- package/examples/eyelang/output/dijkstra-risk-path.pl +29 -0
- package/examples/eyelang/output/dijkstra.pl +16 -0
- package/examples/eyelang/output/dining-philosophers.pl +350 -0
- package/examples/eyelang/output/directional-language.ttl +1 -0
- package/examples/eyelang/output/dog.pl +1 -0
- package/examples/eyelang/output/drone-corridor-planner.pl +17 -0
- package/examples/eyelang/output/easter-computus.pl +30 -0
- package/examples/eyelang/output/electrical-rc-filter.pl +3 -0
- package/examples/eyelang/output/epidemic-policy.pl +14 -0
- package/examples/eyelang/output/equivalence-classes-overlap-implies-same-class.pl +18 -0
- package/examples/eyelang/output/eulerian-path.pl +3 -0
- package/examples/eyelang/output/ev-range-worlds.pl +19 -0
- package/examples/eyelang/output/exact-cover-sudoku.pl +3 -0
- package/examples/eyelang/output/existential-rule.pl +2 -0
- package/examples/eyelang/output/exoplanet-validation-worlds.pl +22 -0
- package/examples/eyelang/output/expression-eval.pl +1 -0
- package/examples/eyelang/output/eyeling-ackermann.n3 +12 -0
- package/examples/eyelang/output/eyeling-age-threshold.n3 +4 -0
- package/examples/eyelang/output/eyeling-alignment-demo.n3 +1 -0
- package/examples/eyelang/output/eyeling-allen-interval-calculus-small.n3 +3 -0
- package/examples/eyelang/output/eyeling-backward-recursion.n3 +9 -0
- package/examples/eyelang/output/eyeling-backward.n3 +1 -0
- package/examples/eyelang/output/eyeling-basic-monadic-small.n3 +8 -0
- package/examples/eyelang/output/eyeling-bmi.n3 +2 -0
- package/examples/eyelang/output/eyeling-cat-koko.n3 +3 -0
- package/examples/eyelang/output/eyeling-collatz-small.n3 +3 -0
- package/examples/eyelang/output/eyeling-collection.n3 +1 -0
- package/examples/eyelang/output/eyeling-complex-arithmetic.n3 +5 -0
- package/examples/eyelang/output/eyeling-context-association.n3 +4 -0
- package/examples/eyelang/output/eyeling-control-system-small.n3 +4 -0
- package/examples/eyelang/output/eyeling-crypto-builtins-extra.n3 +3 -0
- package/examples/eyelang/output/eyeling-crypto-builtins.n3 +2 -0
- package/examples/eyelang/output/eyeling-deep-taxonomy-10.n3 +32 -0
- package/examples/eyelang/output/eyeling-derived-backward-rule-flat.n3 +4 -0
- package/examples/eyelang/output/eyeling-derived-rule-flat.n3 +2 -0
- package/examples/eyelang/output/eyeling-digital-product-passport-small.n3 +3 -0
- package/examples/eyelang/output/eyeling-dijkstra-tiny.n3 +9 -0
- package/examples/eyelang/output/eyeling-dog-license.n3 +1 -0
- package/examples/eyelang/output/eyeling-drone-corridor-planner-small.n3 +5 -0
- package/examples/eyelang/output/eyeling-equals.n3 +1 -0
- package/examples/eyelang/output/eyeling-equivalence-classes.n3 +2 -0
- package/examples/eyelang/output/eyeling-euler-identity.n3 +3 -0
- package/examples/eyelang/output/eyeling-existential-rule.n3 +4 -0
- package/examples/eyelang/output/eyeling-expression-eval.n3 +3 -0
- package/examples/eyelang/output/eyeling-family-cousins-extended.n3 +6 -0
- package/examples/eyelang/output/eyeling-fastpow.n3 +4 -0
- package/examples/eyelang/output/eyeling-fibonacci.n3 +6 -0
- package/examples/eyelang/output/eyeling-french-cities-reachability.n3 +25 -0
- package/examples/eyelang/output/eyeling-goldbach-small.n3 +2 -0
- package/examples/eyelang/output/eyeling-good-cobbler.n3 +2 -0
- package/examples/eyelang/output/eyeling-list-builtins.n3 +6 -0
- package/examples/eyelang/output/eyeling-list-collection-extra.n3 +5 -0
- package/examples/eyelang/output/eyeling-math-builtins.n3 +5 -0
- package/examples/eyelang/output/eyeling-string-builtins-extra.n3 +3 -0
- package/examples/eyelang/output/eyeling-string-builtins.n3 +4 -0
- package/examples/eyelang/output/eyeling-time-builtins.n3 +4 -0
- package/examples/eyelang/output/eyeling-time-components-extra.n3 +5 -0
- package/examples/eyelang/output/eyeling-witch.n3 +2 -0
- package/examples/eyelang/output/family-cousins.n3 +8 -0
- package/examples/eyelang/output/family-cousins.pl +28 -0
- package/examples/eyelang/output/fastpow.pl +6 -0
- package/examples/eyelang/output/fft8-numeric.pl +4 -0
- package/examples/eyelang/output/fibonacci.pl +6 -0
- package/examples/eyelang/output/field-nitrogen-balance.pl +21 -0
- package/examples/eyelang/output/flandor.pl +43 -0
- package/examples/eyelang/output/floating-point.pl +9 -0
- package/examples/eyelang/output/four-color-map.pl +3 -0
- package/examples/eyelang/output/fundamental-theorem-arithmetic.pl +9 -0
- package/examples/eyelang/output/gcd-bezout-identity.pl +36 -0
- package/examples/eyelang/output/gd-step-certified.pl +79 -0
- package/examples/eyelang/output/gdpr-compliance.pl +6 -0
- package/examples/eyelang/output/goldbach-1000.pl +667 -0
- package/examples/eyelang/output/good-cobbler.pl +1 -0
- package/examples/eyelang/output/gps.pl +21 -0
- package/examples/eyelang/output/graph-reachability.pl +3 -0
- package/examples/eyelang/output/gray-code-counter.pl +1 -0
- package/examples/eyelang/output/greatest-lower-bound-uniqueness.pl +2 -0
- package/examples/eyelang/output/group-inverse-uniqueness.pl +2 -0
- package/examples/eyelang/output/hamiltonian-cycle.pl +4 -0
- package/examples/eyelang/output/hamiltonian-path.pl +121 -0
- package/examples/eyelang/output/hamming-code.pl +6 -0
- package/examples/eyelang/output/hanoi.pl +1 -0
- package/examples/eyelang/output/heat-loss.pl +5 -0
- package/examples/eyelang/output/heron-theorem.pl +4 -0
- package/examples/eyelang/output/ideal-gas-law.pl +3 -0
- package/examples/eyelang/output/illegitimate-reasoning.pl +15 -0
- package/examples/eyelang/output/kaprekar.pl +8 -0
- package/examples/eyelang/output/law-of-cosines.pl +3 -0
- package/examples/eyelang/output/least-squares-regression.pl +5 -0
- package/examples/eyelang/output/list-collection.pl +3 -0
- package/examples/eyelang/output/lldm.pl +6 -0
- package/examples/eyelang/output/manufacturing-quality-control.pl +6 -0
- package/examples/eyelang/output/matrix.pl +10 -0
- package/examples/eyelang/output/microgrid-dispatch.pl +6 -0
- package/examples/eyelang/output/monkey-bananas.pl +5 -0
- package/examples/eyelang/output/n-queens.pl +93 -0
- package/examples/eyelang/output/n3-builtins.n3 +6 -0
- package/examples/eyelang/output/network-sla.pl +4 -0
- package/examples/eyelang/output/newton-raphson.pl +3 -0
- package/examples/eyelang/output/nixon-diamond.pl +5 -0
- package/examples/eyelang/output/odrl-dpv-healthcare-risk-ranked.pl +42 -0
- package/examples/eyelang/output/odrl-dpv-risk-ranked.pl +120 -0
- package/examples/eyelang/output/orbital-transfer-design.pl +7 -0
- package/examples/eyelang/output/path-discovery.pl +3 -0
- package/examples/eyelang/output/peano-arithmetic.pl +3 -0
- package/examples/eyelang/output/peasant.pl +10 -0
- package/examples/eyelang/output/pendulum-period.pl +4 -0
- package/examples/eyelang/output/polynomial.pl +14 -0
- package/examples/eyelang/output/project-portfolio-optimization.pl +6 -0
- package/examples/eyelang/output/proof-contrapositive.pl +3 -0
- package/examples/eyelang/output/quadratic-formula.pl +6 -0
- package/examples/eyelang/output/quine-mccluskey.pl +3 -0
- package/examples/eyelang/output/radioactive-decay.pl +5 -0
- package/examples/eyelang/output/resilient-city-orchestration.pl +67 -0
- package/examples/eyelang/output/riemann-hypothesis.pl +12 -0
- package/examples/eyelang/output/sat-dpll.pl +5 -0
- package/examples/eyelang/output/security-incident-correlation.pl +3 -0
- package/examples/eyelang/output/service-impact.pl +11 -0
- package/examples/eyelang/output/sieve.pl +1 -0
- package/examples/eyelang/output/skolem-functions.pl +16 -0
- package/examples/eyelang/output/socket-age.pl +1 -0
- package/examples/eyelang/output/socket-family.pl +3 -0
- package/examples/eyelang/output/socrates.n3 +1 -0
- package/examples/eyelang/output/socrates.pl +2 -0
- package/examples/eyelang/output/statistics-summary.pl +4 -0
- package/examples/eyelang/output/sudoku.pl +2 -0
- package/examples/eyelang/output/superdense-coding.pl +6 -0
- package/examples/eyelang/output/traveling-salesman.pl +1 -0
- package/examples/eyelang/output/triple-term.n3 +2 -0
- package/examples/eyelang/output/turing.pl +12 -0
- package/examples/eyelang/output/vector-similarity.pl +4 -0
- package/examples/eyelang/output/witch.pl +7 -0
- package/examples/eyelang/output/wolf-goat-cabbage.pl +3 -0
- package/examples/eyelang/output/zebra.pl +3 -0
- package/examples/eyelang/path-discovery.pl +44998 -0
- package/examples/eyelang/peano-arithmetic.pl +31 -0
- package/examples/eyelang/peasant.pl +30 -0
- package/examples/eyelang/pendulum-period.pl +50 -0
- package/examples/eyelang/polynomial.pl +124 -0
- package/examples/eyelang/project-portfolio-optimization.pl +101 -0
- package/examples/eyelang/proof/age.pl +71 -0
- package/examples/eyelang/proof/aliases-and-namespaces.pl +78 -0
- package/examples/eyelang/proof/ancestor.pl +140 -0
- package/examples/eyelang/proof/animal.pl +68 -0
- package/examples/eyelang/proof/annotation.pl +80 -0
- package/examples/eyelang/proof/backward.pl +22 -0
- package/examples/eyelang/proof/cat-koko.pl +86 -0
- package/examples/eyelang/proof/data-negotiation.pl +76 -0
- package/examples/eyelang/proof/derived-rule.pl +43 -0
- package/examples/eyelang/proof/dog.pl +31 -0
- package/examples/eyelang/proof/electrical-rc-filter.pl +105 -0
- package/examples/eyelang/proof/existential-rule.pl +40 -0
- package/examples/eyelang/proof/floating-point.pl +160 -0
- package/examples/eyelang/proof/good-cobbler.pl +16 -0
- package/examples/eyelang/proof/group-inverse-uniqueness.pl +84 -0
- package/examples/eyelang/proof/list-collection.pl +52 -0
- package/examples/eyelang/proof/proof-contrapositive.pl +78 -0
- package/examples/eyelang/proof/socket-age.pl +32 -0
- package/examples/eyelang/proof/socket-family.pl +59 -0
- package/examples/eyelang/proof/socrates.pl +38 -0
- package/examples/eyelang/proof-contrapositive.pl +27 -0
- package/examples/eyelang/quadratic-formula.pl +54 -0
- package/examples/eyelang/quine-mccluskey.pl +143 -0
- package/examples/eyelang/radioactive-decay.pl +56 -0
- package/examples/eyelang/resilient-city-orchestration.pl +303 -0
- package/examples/eyelang/riemann-hypothesis.pl +110 -0
- package/examples/eyelang/sat-dpll.pl +80 -0
- package/examples/eyelang/security-incident-correlation.pl +69 -0
- package/examples/eyelang/service-impact.pl +41 -0
- package/examples/eyelang/sieve.pl +20 -0
- package/examples/eyelang/skolem-functions.pl +52 -0
- package/examples/eyelang/socket-age.pl +39 -0
- package/examples/eyelang/socket-family.pl +28 -0
- package/examples/eyelang/socrates.n3 +11 -0
- package/examples/eyelang/socrates.pl +19 -0
- package/examples/eyelang/statistics-summary.pl +54 -0
- package/examples/eyelang/sudoku.pl +20 -0
- package/examples/eyelang/superdense-coding.pl +84 -0
- package/examples/eyelang/traveling-salesman.pl +64 -0
- package/examples/eyelang/triple-term.n3 +9 -0
- package/examples/eyelang/turing.pl +67 -0
- package/examples/eyelang/vector-similarity.pl +56 -0
- package/examples/eyelang/witch.pl +38 -0
- package/examples/eyelang/wolf-goat-cabbage.pl +56 -0
- package/examples/eyelang/zebra.pl +44 -0
- package/eyelang.d.ts +92 -0
- package/eyeling-builtins.ttl +3 -3
- package/eyeling.js +298 -14
- package/index.d.ts +290 -283
- package/index.js +95 -1
- package/lib/builtins.js +297 -14
- package/lib/cli.js +1 -0
- package/lib/eyelang/bin.js +7 -0
- package/lib/eyelang/builtins/aggregation.mjs +81 -0
- package/lib/eyelang/builtins/alphametic.mjs +144 -0
- package/lib/eyelang/builtins/arithmetic.mjs +197 -0
- package/lib/eyelang/builtins/control.mjs +22 -0
- package/lib/eyelang/builtins/core.mjs +78 -0
- package/lib/eyelang/builtins/formula.mjs +42 -0
- package/lib/eyelang/builtins/lists.mjs +149 -0
- package/lib/eyelang/builtins/matrix.mjs +226 -0
- package/lib/eyelang/builtins/n3.mjs +483 -0
- package/lib/eyelang/builtins/number-theory.mjs +114 -0
- package/lib/eyelang/builtins/portfolio.mjs +73 -0
- package/lib/eyelang/builtins/registry.mjs +54 -0
- package/lib/eyelang/builtins/search.mjs +579 -0
- package/lib/eyelang/builtins/strings.mjs +41 -0
- package/lib/eyelang/builtins/sudoku.mjs +141 -0
- package/lib/eyelang/cli.mjs +192 -0
- package/lib/eyelang/explain.mjs +324 -0
- package/lib/eyelang/hash.mjs +294 -0
- package/lib/eyelang/index.mjs +48 -0
- package/lib/eyelang/parser.mjs +428 -0
- package/lib/eyelang/program.mjs +244 -0
- package/lib/eyelang/rdf.mjs +747 -0
- package/lib/eyelang/solver.mjs +237 -0
- package/lib/eyelang/term.mjs +328 -0
- package/package.json +15 -5
- package/test/builtins.test.js +49 -1
- package/test/eyelang/conformance/README.md +45 -0
- package/test/eyelang/conformance/cases/core/001_fact_output.pl +4 -0
- package/test/eyelang/conformance/cases/core/001_fact_query.query +1 -0
- package/test/eyelang/conformance/cases/core/002_rule_recursion.pl +7 -0
- package/test/eyelang/conformance/cases/core/002_rule_recursion.query +1 -0
- package/test/eyelang/conformance/cases/core/003_terms_and_readback.pl +16 -0
- package/test/eyelang/conformance/cases/core/003_terms_and_readback.query +1 -0
- package/test/eyelang/conformance/cases/core/004_conjunction_and_parentheses.pl +5 -0
- package/test/eyelang/conformance/cases/core/004_conjunction_and_parentheses.query +1 -0
- package/test/eyelang/conformance/cases/core/005_list_deconstruction.pl +6 -0
- package/test/eyelang/conformance/cases/core/005_list_deconstruction.query +1 -0
- package/test/eyelang/conformance/cases/core/006_comma_formula_data.pl +4 -0
- package/test/eyelang/conformance/cases/core/006_comma_formula_data.query +1 -0
- package/test/eyelang/conformance/cases/core/007_anonymous_variables.pl +5 -0
- package/test/eyelang/conformance/cases/core/007_anonymous_variables.query +1 -0
- package/test/eyelang/conformance/cases/core/008_graphic_atoms.pl +6 -0
- package/test/eyelang/conformance/cases/core/008_graphic_atoms.query +1 -0
- package/test/eyelang/conformance/cases/core/009_comments_and_whitespace.pl +5 -0
- package/test/eyelang/conformance/cases/core/009_comments_and_whitespace.query +1 -0
- package/test/eyelang/conformance/cases/core/010_variable_scope_and_reuse.pl +8 -0
- package/test/eyelang/conformance/cases/core/010_variable_scope_and_reuse.query +1 -0
- package/test/eyelang/conformance/cases/core/011_predicate_arity.pl +6 -0
- package/test/eyelang/conformance/cases/core/011_predicate_arity.query +1 -0
- package/test/eyelang/conformance/cases/core/012_nested_compound_unification.pl +5 -0
- package/test/eyelang/conformance/cases/core/012_nested_compound_unification.query +1 -0
- package/test/eyelang/conformance/cases/core/013_multiple_clauses_order.pl +6 -0
- package/test/eyelang/conformance/cases/core/013_multiple_clauses_order.query +1 -0
- package/test/eyelang/conformance/cases/core/014_failure_filters_answers.pl +7 -0
- package/test/eyelang/conformance/cases/core/014_failure_filters_answers.query +1 -0
- package/test/eyelang/conformance/cases/core/015_improper_list_unification.pl +6 -0
- package/test/eyelang/conformance/cases/core/015_improper_list_unification.query +1 -0
- package/test/eyelang/conformance/cases/core/016_zero_arity_compound.pl +4 -0
- package/test/eyelang/conformance/cases/core/016_zero_arity_compound.query +1 -0
- package/test/eyelang/conformance/cases/core/017_three_step_recursion.pl +8 -0
- package/test/eyelang/conformance/cases/core/017_three_step_recursion.query +1 -0
- package/test/eyelang/conformance/cases/core/018_quoted_atom_readback.pl +6 -0
- package/test/eyelang/conformance/cases/core/018_quoted_atom_readback.query +1 -0
- package/test/eyelang/conformance/cases/core/019_parenthesized_three_conjuncts.pl +7 -0
- package/test/eyelang/conformance/cases/core/019_parenthesized_three_conjuncts.query +1 -0
- package/test/eyelang/conformance/cases/core/020_nested_list_terms.pl +5 -0
- package/test/eyelang/conformance/cases/core/020_nested_list_terms.query +1 -0
- package/test/eyelang/conformance/cases/core/021_repeated_variable_head.pl +7 -0
- package/test/eyelang/conformance/cases/core/022_rule_head_structure.pl +5 -0
- package/test/eyelang/conformance/cases/core/023_quoted_escapes_readback.pl +5 -0
- package/test/eyelang/conformance/cases/core/024_numeric_literal_readback.pl +6 -0
- package/test/eyelang/conformance/cases/core/025_body_parentheses_with_formula_data.pl +5 -0
- package/test/eyelang/conformance/cases/core/026_underscore_named_variable_reuse.pl +5 -0
- package/test/eyelang/conformance/cases/extension/001_default_derived_output.pl +5 -0
- package/test/eyelang/conformance/cases/extension/002_materialize_focus.pl +5 -0
- package/test/eyelang/conformance/cases/extension/003_arithmetic_and_comparison.pl +12 -0
- package/test/eyelang/conformance/cases/extension/003_arithmetic_and_comparison.query +1 -0
- package/test/eyelang/conformance/cases/extension/004_strings_and_atoms.pl +6 -0
- package/test/eyelang/conformance/cases/extension/004_strings_and_atoms.query +1 -0
- package/test/eyelang/conformance/cases/extension/005_lists_aggregation_ordering.pl +10 -0
- package/test/eyelang/conformance/cases/extension/005_lists_aggregation_ordering.query +1 -0
- package/test/eyelang/conformance/cases/extension/006_formula_terms.pl +5 -0
- package/test/eyelang/conformance/cases/extension/006_formula_terms.query +1 -0
- package/test/eyelang/conformance/cases/extension/007_negation_once_generators.pl +7 -0
- package/test/eyelang/conformance/cases/extension/007_negation_once_generators.query +1 -0
- package/test/eyelang/conformance/cases/extension/008_equality_and_inequality.pl +6 -0
- package/test/eyelang/conformance/cases/extension/008_equality_and_inequality.query +1 -0
- package/test/eyelang/conformance/cases/extension/009_list_relations.pl +6 -0
- package/test/eyelang/conformance/cases/extension/009_list_relations.query +1 -0
- package/test/eyelang/conformance/cases/extension/010_append_splits.pl +3 -0
- package/test/eyelang/conformance/cases/extension/010_append_splits.query +1 -0
- package/test/eyelang/conformance/cases/extension/011_matching_and_comparison.pl +7 -0
- package/test/eyelang/conformance/cases/extension/011_matching_and_comparison.query +1 -0
- package/test/eyelang/conformance/cases/extension/012_memoize_declaration.pl +8 -0
- package/test/eyelang/conformance/cases/extension/012_memoize_declaration.query +1 -0
- package/test/eyelang/conformance/cases/extension/013_numeric_functions.pl +9 -0
- package/test/eyelang/conformance/cases/extension/013_numeric_functions.query +1 -0
- package/test/eyelang/conformance/cases/extension/014_between_enumeration.pl +3 -0
- package/test/eyelang/conformance/cases/extension/014_between_enumeration.query +1 -0
- package/test/eyelang/conformance/cases/extension/015_smallest_divisor.pl +3 -0
- package/test/eyelang/conformance/cases/extension/015_smallest_divisor.query +1 -0
- package/test/eyelang/conformance/cases/extension/016_negation_filter.pl +7 -0
- package/test/eyelang/conformance/cases/extension/016_negation_filter.query +1 -0
- package/test/eyelang/conformance/cases/extension/017_once_user_predicate.pl +5 -0
- package/test/eyelang/conformance/cases/extension/017_once_user_predicate.query +1 -0
- package/test/eyelang/conformance/cases/extension/018_findall_user_goal.pl +6 -0
- package/test/eyelang/conformance/cases/extension/018_findall_user_goal.query +1 -0
- package/test/eyelang/conformance/cases/extension/019_sort_deduplicates_atoms.pl +3 -0
- package/test/eyelang/conformance/cases/extension/019_sort_deduplicates_atoms.query +1 -0
- package/test/eyelang/conformance/cases/extension/020_append_bound_prefix_suffix.pl +4 -0
- package/test/eyelang/conformance/cases/extension/020_append_bound_prefix_suffix.query +1 -0
- package/test/eyelang/conformance/cases/extension/021_nth0_index_generation.pl +3 -0
- package/test/eyelang/conformance/cases/extension/021_nth0_index_generation.query +1 -0
- package/test/eyelang/conformance/cases/extension/022_set_nth0_edges.pl +4 -0
- package/test/eyelang/conformance/cases/extension/022_set_nth0_edges.query +1 -0
- package/test/eyelang/conformance/cases/extension/023_select_duplicate_occurrences.pl +3 -0
- package/test/eyelang/conformance/cases/extension/023_select_duplicate_occurrences.query +1 -0
- package/test/eyelang/conformance/cases/extension/024_not_member_filter.pl +6 -0
- package/test/eyelang/conformance/cases/extension/024_not_member_filter.query +1 -0
- package/test/eyelang/conformance/cases/extension/025_is_list_filter.pl +5 -0
- package/test/eyelang/conformance/cases/extension/025_is_list_filter.query +1 -0
- package/test/eyelang/conformance/cases/extension/026_nested_formula_terms.pl +5 -0
- package/test/eyelang/conformance/cases/extension/026_nested_formula_terms.query +1 -0
- package/test/eyelang/conformance/cases/extension/027_materialize_excludes_source_fact.pl +6 -0
- package/test/eyelang/conformance/cases/extension/028_numeric_and_lexical_comparison.pl +5 -0
- package/test/eyelang/conformance/cases/extension/028_numeric_and_lexical_comparison.query +1 -0
- package/test/eyelang/conformance/cases/extension/029_string_matching_filters.pl +6 -0
- package/test/eyelang/conformance/cases/extension/029_string_matching_filters.query +1 -0
- package/test/eyelang/conformance/cases/extension/030_string_and_atom_concat.pl +4 -0
- package/test/eyelang/conformance/cases/extension/030_string_and_atom_concat.query +1 -0
- package/test/eyelang/conformance/cases/extension/031_countall_empty_and_nonempty.pl +4 -0
- package/test/eyelang/conformance/cases/extension/031_countall_empty_and_nonempty.query +1 -0
- package/test/eyelang/conformance/cases/extension/032_sumall_numeric_template.pl +5 -0
- package/test/eyelang/conformance/cases/extension/032_sumall_numeric_template.query +1 -0
- package/test/eyelang/conformance/cases/extension/033_aggregate_min_template.pl +5 -0
- package/test/eyelang/conformance/cases/extension/033_aggregate_min_template.query +1 -0
- package/test/eyelang/conformance/cases/extension/034_aggregate_max_compound_key.pl +5 -0
- package/test/eyelang/conformance/cases/extension/034_aggregate_max_compound_key.query +1 -0
- package/test/eyelang/conformance/cases/extension/035_date_difference.pl +4 -0
- package/test/eyelang/conformance/cases/extension/036_extended_gcd.pl +3 -0
- package/test/eyelang/conformance/cases/extension/037_collatz_trajectory.pl +3 -0
- package/test/eyelang/conformance/cases/extension/038_kaprekar_steps.pl +3 -0
- package/test/eyelang/conformance/cases/extension/039_goldbach_pair.pl +3 -0
- package/test/eyelang/conformance/cases/extension/040_matrix_operations.pl +5 -0
- package/test/eyelang/conformance/cases/extension/041_atom_range_generators.pl +5 -0
- package/test/eyelang/conformance/cases/extension/042_n_queens_small.pl +3 -0
- package/test/eyelang/conformance/cases/extension/043_cnf_model.pl +3 -0
- package/test/eyelang/conformance/cases/extension/044_cover9_filter.pl +6 -0
- package/test/eyelang/conformance/cases/extension/045_alphametic_sum_small.pl +3 -0
- package/test/eyelang/conformance/cases/extension/046_bounded_subset.pl +4 -0
- package/test/eyelang/conformance/expected/core/001_fact_output.out +1 -0
- package/test/eyelang/conformance/expected/core/002_rule_recursion.out +2 -0
- package/test/eyelang/conformance/expected/core/003_terms_and_readback.out +13 -0
- package/test/eyelang/conformance/expected/core/004_conjunction_and_parentheses.out +1 -0
- package/test/eyelang/conformance/expected/core/005_list_deconstruction.out +2 -0
- package/test/eyelang/conformance/expected/core/006_comma_formula_data.out +1 -0
- package/test/eyelang/conformance/expected/core/007_anonymous_variables.out +1 -0
- package/test/eyelang/conformance/expected/core/008_graphic_atoms.out +3 -0
- package/test/eyelang/conformance/expected/core/009_comments_and_whitespace.out +2 -0
- package/test/eyelang/conformance/expected/core/010_variable_scope_and_reuse.out +2 -0
- package/test/eyelang/conformance/expected/core/011_predicate_arity.out +2 -0
- package/test/eyelang/conformance/expected/core/012_nested_compound_unification.out +2 -0
- package/test/eyelang/conformance/expected/core/013_multiple_clauses_order.out +2 -0
- package/test/eyelang/conformance/expected/core/014_failure_filters_answers.out +1 -0
- package/test/eyelang/conformance/expected/core/015_improper_list_unification.out +3 -0
- package/test/eyelang/conformance/expected/core/016_zero_arity_compound.out +1 -0
- package/test/eyelang/conformance/expected/core/017_three_step_recursion.out +3 -0
- package/test/eyelang/conformance/expected/core/018_quoted_atom_readback.out +3 -0
- package/test/eyelang/conformance/expected/core/019_parenthesized_three_conjuncts.out +1 -0
- package/test/eyelang/conformance/expected/core/020_nested_list_terms.out +2 -0
- package/test/eyelang/conformance/expected/core/021_repeated_variable_head.out +2 -0
- package/test/eyelang/conformance/expected/core/022_rule_head_structure.out +2 -0
- package/test/eyelang/conformance/expected/core/023_quoted_escapes_readback.out +2 -0
- package/test/eyelang/conformance/expected/core/024_numeric_literal_readback.out +3 -0
- package/test/eyelang/conformance/expected/core/025_body_parentheses_with_formula_data.out +1 -0
- package/test/eyelang/conformance/expected/core/026_underscore_named_variable_reuse.out +1 -0
- package/test/eyelang/conformance/expected/extension/001_default_derived_output.out +3 -0
- package/test/eyelang/conformance/expected/extension/002_materialize_focus.out +1 -0
- package/test/eyelang/conformance/expected/extension/003_arithmetic_and_comparison.out +10 -0
- package/test/eyelang/conformance/expected/extension/004_strings_and_atoms.out +4 -0
- package/test/eyelang/conformance/expected/extension/005_lists_aggregation_ordering.out +9 -0
- package/test/eyelang/conformance/expected/extension/006_formula_terms.out +4 -0
- package/test/eyelang/conformance/expected/extension/007_negation_once_generators.out +2 -0
- package/test/eyelang/conformance/expected/extension/008_equality_and_inequality.out +4 -0
- package/test/eyelang/conformance/expected/extension/009_list_relations.out +5 -0
- package/test/eyelang/conformance/expected/extension/010_append_splits.out +3 -0
- package/test/eyelang/conformance/expected/extension/011_matching_and_comparison.out +5 -0
- package/test/eyelang/conformance/expected/extension/012_memoize_declaration.out +2 -0
- package/test/eyelang/conformance/expected/extension/013_numeric_functions.out +7 -0
- package/test/eyelang/conformance/expected/extension/014_between_enumeration.out +3 -0
- package/test/eyelang/conformance/expected/extension/015_smallest_divisor.out +1 -0
- package/test/eyelang/conformance/expected/extension/016_negation_filter.out +2 -0
- package/test/eyelang/conformance/expected/extension/017_once_user_predicate.out +1 -0
- package/test/eyelang/conformance/expected/extension/018_findall_user_goal.out +1 -0
- package/test/eyelang/conformance/expected/extension/019_sort_deduplicates_atoms.out +1 -0
- package/test/eyelang/conformance/expected/extension/020_append_bound_prefix_suffix.out +2 -0
- package/test/eyelang/conformance/expected/extension/021_nth0_index_generation.out +1 -0
- package/test/eyelang/conformance/expected/extension/022_set_nth0_edges.out +2 -0
- package/test/eyelang/conformance/expected/extension/023_select_duplicate_occurrences.out +2 -0
- package/test/eyelang/conformance/expected/extension/024_not_member_filter.out +1 -0
- package/test/eyelang/conformance/expected/extension/025_is_list_filter.out +1 -0
- package/test/eyelang/conformance/expected/extension/026_nested_formula_terms.out +6 -0
- package/test/eyelang/conformance/expected/extension/027_materialize_excludes_source_fact.out +1 -0
- package/test/eyelang/conformance/expected/extension/028_numeric_and_lexical_comparison.out +3 -0
- package/test/eyelang/conformance/expected/extension/029_string_matching_filters.out +2 -0
- package/test/eyelang/conformance/expected/extension/030_string_and_atom_concat.out +2 -0
- package/test/eyelang/conformance/expected/extension/031_countall_empty_and_nonempty.out +1 -0
- package/test/eyelang/conformance/expected/extension/032_sumall_numeric_template.out +1 -0
- package/test/eyelang/conformance/expected/extension/033_aggregate_min_template.out +1 -0
- package/test/eyelang/conformance/expected/extension/034_aggregate_max_compound_key.out +1 -0
- package/test/eyelang/conformance/expected/extension/035_date_difference.out +2 -0
- package/test/eyelang/conformance/expected/extension/036_extended_gcd.out +1 -0
- package/test/eyelang/conformance/expected/extension/037_collatz_trajectory.out +1 -0
- package/test/eyelang/conformance/expected/extension/038_kaprekar_steps.out +1 -0
- package/test/eyelang/conformance/expected/extension/039_goldbach_pair.out +2 -0
- package/test/eyelang/conformance/expected/extension/040_matrix_operations.out +3 -0
- package/test/eyelang/conformance/expected/extension/041_atom_range_generators.out +8 -0
- package/test/eyelang/conformance/expected/extension/042_n_queens_small.out +2 -0
- package/test/eyelang/conformance/expected/extension/043_cnf_model.out +1 -0
- package/test/eyelang/conformance/expected/extension/044_cover9_filter.out +2 -0
- package/test/eyelang/conformance/expected/extension/045_alphametic_sum_small.out +4 -0
- package/test/eyelang/conformance/expected/extension/046_bounded_subset.out +5 -0
- package/test/eyelang/run-all.mjs +20 -0
- package/test/eyelang/run-conformance.mjs +80 -0
- package/test/eyelang/run-examples.mjs +126 -0
- package/test/eyelang/run-regression.mjs +640 -0
- package/test/eyelang/test-style.mjs +91 -0
- package/test/eyelang.test.js +58 -0
- package/test/run.js +1 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
% Composition of injective functions is injective, adapted from Eyeling's
|
|
2
|
+
% examples/composition-of-injective-functions-is-injective.n3.
|
|
3
|
+
%
|
|
4
|
+
% The output mirrors the Eyeling golden result shape:
|
|
5
|
+
% sameInputByCompositeInjectivity(h, a, b) and the symmetric counterpart.
|
|
6
|
+
|
|
7
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
8
|
+
materialize(sameInputByCompositeInjectivity, 3).
|
|
9
|
+
|
|
10
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
11
|
+
inX(a).
|
|
12
|
+
inX(b).
|
|
13
|
+
inY(c).
|
|
14
|
+
inY(d).
|
|
15
|
+
inZ(e).
|
|
16
|
+
|
|
17
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
18
|
+
sameTerm(X, X) :- inX(X).
|
|
19
|
+
sameTerm(X, X) :- inY(X).
|
|
20
|
+
sameTerm(X, X) :- inZ(X).
|
|
21
|
+
sameTerm(Y, X) :- sameTerm(X, Y).
|
|
22
|
+
|
|
23
|
+
app(f, a, c).
|
|
24
|
+
app(f, b, d).
|
|
25
|
+
app(g, c, e).
|
|
26
|
+
app(g, d, e).
|
|
27
|
+
|
|
28
|
+
injective(f).
|
|
29
|
+
injective(g).
|
|
30
|
+
compositeOf(h, g, f).
|
|
31
|
+
|
|
32
|
+
app(H, X, Z) :-
|
|
33
|
+
compositeOf(H, G, F),
|
|
34
|
+
app(F, X, Y),
|
|
35
|
+
app(G, Y, Z).
|
|
36
|
+
|
|
37
|
+
sameTerm(X, Y) :-
|
|
38
|
+
injective(F),
|
|
39
|
+
app(F, X, U),
|
|
40
|
+
app(F, Y, V),
|
|
41
|
+
sameTerm(U, V).
|
|
42
|
+
|
|
43
|
+
sameInputByCompositeInjectivity(H, X, Y) :-
|
|
44
|
+
compositeOf(H, G, F),
|
|
45
|
+
injective(G),
|
|
46
|
+
injective(F),
|
|
47
|
+
app(H, X, Z),
|
|
48
|
+
app(H, Y, Z),
|
|
49
|
+
sameTerm(X, Y),
|
|
50
|
+
neq(X, Y).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
% Context association adapted from Eyeling context-association.n3.
|
|
2
|
+
%
|
|
3
|
+
% This version keeps the original shape: each context is named with log_nameOf
|
|
4
|
+
% and its contents remain quoted formula data. Nothing inside the three formulae
|
|
5
|
+
% is asserted globally unless a rule explicitly projects it.
|
|
6
|
+
|
|
7
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
8
|
+
materialize(log_nameOf, 2).
|
|
9
|
+
materialize(dataGraph, 2).
|
|
10
|
+
materialize(signatureGraph, 2).
|
|
11
|
+
materialize(metadataGraph, 2).
|
|
12
|
+
|
|
13
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
14
|
+
log_nameOf(skolem_g0, foaf_name(bob, "Bob")).
|
|
15
|
+
|
|
16
|
+
log_nameOf(skolem_g1, (
|
|
17
|
+
sec_proof(skolem_g0, dataSignature),
|
|
18
|
+
type(signature1, sec_DataIntegrityProof),
|
|
19
|
+
sec_cryptosuite(signature1, "ecdsa-proof-2019"),
|
|
20
|
+
sec_created(signature1, "2021-11-13T18:19:39Z"),
|
|
21
|
+
sec_verificationMethod(signature1, "https://university.example/issuers/14#key-1"),
|
|
22
|
+
sec_proofPurpose(signature1, "assertionMethod"),
|
|
23
|
+
sec_proofValue(signature1, "z58DAdFfa9SkqZMVPxAQp...jQCrfFPP2oumHKtz"),
|
|
24
|
+
sec_issuer(signature1, university),
|
|
25
|
+
sec_validFrom(signature1, "2024-04-03T00:00:00.000Z"),
|
|
26
|
+
sec_validUntil(signature1, "2025-04-03T00:00:00.000Z")
|
|
27
|
+
)).
|
|
28
|
+
|
|
29
|
+
log_nameOf(g3, (
|
|
30
|
+
sec_proof(skolem_g1, signature2),
|
|
31
|
+
type(signature2, sec_DataIntegrityProof),
|
|
32
|
+
sec_cryptosuite(signature2, "ecdsa-proof-2019"),
|
|
33
|
+
sec_created(signature2, "2021-11-13T18:19:39Z"),
|
|
34
|
+
sec_verificationMethod(signature2, "https://university.example/issuers/14#key-1"),
|
|
35
|
+
sec_proofPurpose(signature2, "assertionMethod"),
|
|
36
|
+
sec_proofValue(signature2, "adad123efv434r5200...dqed2t44v43das")
|
|
37
|
+
)).
|
|
38
|
+
|
|
39
|
+
% A tiny projection shows how a program can inspect a quoted context without
|
|
40
|
+
% making the entire context globally true.
|
|
41
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
42
|
+
context_statement(Context, Subject, Predicate, Object) :-
|
|
43
|
+
log_nameOf(Context, Formula),
|
|
44
|
+
formula_binary(Formula, Subject, Predicate, Object).
|
|
45
|
+
|
|
46
|
+
dataGraph(association, skolem_g0) :-
|
|
47
|
+
context_statement(skolem_g0, bob, foaf_name, "Bob").
|
|
48
|
+
|
|
49
|
+
signatureGraph(association, skolem_g1) :-
|
|
50
|
+
context_statement(skolem_g1, skolem_g0, sec_proof, dataSignature).
|
|
51
|
+
|
|
52
|
+
metadataGraph(association, g3) :-
|
|
53
|
+
context_statement(g3, skolem_g1, sec_proof, signature2).
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
% Control Systems example, adapted from Eyelet's input/control-system.pl.
|
|
2
|
+
%
|
|
3
|
+
% The example combines measurements, observations, targets, logarithmic
|
|
4
|
+
% feedforward compensation, square-root normalization, and nonlinear feedback.
|
|
5
|
+
|
|
6
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
7
|
+
materialize(controlSignal, 2).
|
|
8
|
+
materialize(status, 2).
|
|
9
|
+
materialize(normalizedMeasurement, 2).
|
|
10
|
+
materialize(log10, 2).
|
|
11
|
+
|
|
12
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
13
|
+
measurement(input1, [6, 11]).
|
|
14
|
+
measurement(disturbance2, [45, 39]).
|
|
15
|
+
measurement(input2, true).
|
|
16
|
+
measurement(input3, 56967).
|
|
17
|
+
measurement(disturbance1, 35766).
|
|
18
|
+
measurement(output2, 24).
|
|
19
|
+
|
|
20
|
+
observation(state1, 80).
|
|
21
|
+
observation(state2, false).
|
|
22
|
+
observation(state3, 22).
|
|
23
|
+
|
|
24
|
+
target(output2, 29).
|
|
25
|
+
|
|
26
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
27
|
+
measurement_normalized(I, M) :-
|
|
28
|
+
measurement(I, [M1, M2]),
|
|
29
|
+
lt(M1, M2),
|
|
30
|
+
sub(M2, M1, Delta),
|
|
31
|
+
pow(Delta, 0.5, M).
|
|
32
|
+
|
|
33
|
+
measurement_normalized(I, M1) :-
|
|
34
|
+
measurement(I, [M1, M2]),
|
|
35
|
+
ge(M1, M2).
|
|
36
|
+
|
|
37
|
+
log10(Value, Result) :-
|
|
38
|
+
log(Value, NaturalLog),
|
|
39
|
+
log(10, NaturalLog10),
|
|
40
|
+
div(NaturalLog, NaturalLog10, Result).
|
|
41
|
+
|
|
42
|
+
control(actuator1, C) :-
|
|
43
|
+
measurement_normalized(input1, M1),
|
|
44
|
+
measurement(input2, true),
|
|
45
|
+
measurement(disturbance1, D1),
|
|
46
|
+
mul(M1, 19.6, Proportional),
|
|
47
|
+
log10(D1, Compensation),
|
|
48
|
+
sub(Proportional, Compensation, C).
|
|
49
|
+
|
|
50
|
+
control(actuator2, C) :-
|
|
51
|
+
observation(state3, P3),
|
|
52
|
+
measurement(output2, M4),
|
|
53
|
+
target(output2, T2),
|
|
54
|
+
sub(T2, M4, Error),
|
|
55
|
+
sub(P3, M4, DifferentialError),
|
|
56
|
+
mul(5.8, Error, Proportional),
|
|
57
|
+
div(7.3, Error, NonlinearFactor),
|
|
58
|
+
mul(NonlinearFactor, DifferentialError, Differential),
|
|
59
|
+
add(Proportional, Differential, C).
|
|
60
|
+
|
|
61
|
+
controlSignal(Actuator, C) :-
|
|
62
|
+
control(Actuator, C).
|
|
63
|
+
|
|
64
|
+
status(Actuator, active) :-
|
|
65
|
+
control(Actuator, _C).
|
|
66
|
+
|
|
67
|
+
normalizedMeasurement(input1, M) :-
|
|
68
|
+
measurement_normalized(input1, M).
|
|
69
|
+
|
|
70
|
+
log10(disturbance1, C) :-
|
|
71
|
+
measurement(disturbance1, D),
|
|
72
|
+
log10(D, C).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
% Cryptarithmetic without cut.
|
|
2
|
+
%
|
|
3
|
+
% Two column-pruned puzzles are included. SEND + MORE = MONEY is the classic
|
|
4
|
+
% eight-letter puzzle, and DONALD + GERALD = ROBERT uses all ten digits across
|
|
5
|
+
% a six-column addition. Each column constraint is applied as soon as possible
|
|
6
|
+
% so the finite digit search prunes early without cut.
|
|
7
|
+
|
|
8
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
9
|
+
materialize(status, 2).
|
|
10
|
+
materialize(assignment, 2).
|
|
11
|
+
materialize(equation, 2).
|
|
12
|
+
|
|
13
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
14
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
15
|
+
send_more_money(solution(S, E, N, D, M, O, R, Y), Send, More, Money) :-
|
|
16
|
+
alphametic_sum(
|
|
17
|
+
[s, e, n, d, m, o, r, y],
|
|
18
|
+
[[s, e, n, d], [m, o, r, e]],
|
|
19
|
+
[m, o, n, e, y],
|
|
20
|
+
[S, E, N, D, M, O, R, Y],
|
|
21
|
+
[Send, More, Money]
|
|
22
|
+
).
|
|
23
|
+
|
|
24
|
+
donald_gerald_robert(solution(D, O, N, A, L, G, E, R, B, T), Donald, Gerald, Robert) :-
|
|
25
|
+
alphametic_sum(
|
|
26
|
+
[d, o, n, a, l, g, e, r, b, t],
|
|
27
|
+
[[d, o, n, a, l, d], [g, e, r, a, l, d]],
|
|
28
|
+
[r, o, b, e, r, t],
|
|
29
|
+
[D, O, N, A, L, G, E, R, B, T],
|
|
30
|
+
[Donald, Gerald, Robert]
|
|
31
|
+
).
|
|
32
|
+
|
|
33
|
+
status(send_more_money, solved) :-
|
|
34
|
+
once(send_more_money(_Solution, _Send, _More, _Money)).
|
|
35
|
+
|
|
36
|
+
assignment(send_more_money, Solution) :-
|
|
37
|
+
once(send_more_money(Solution, _Send, _More, _Money)).
|
|
38
|
+
|
|
39
|
+
equation(send_more_money, plus(Send, More, Money)) :-
|
|
40
|
+
once(send_more_money(_Solution, Send, More, Money)).
|
|
41
|
+
|
|
42
|
+
status(donald_gerald_robert, solved) :-
|
|
43
|
+
once(donald_gerald_robert(_Solution, _Donald, _Gerald, _Robert)).
|
|
44
|
+
|
|
45
|
+
assignment(donald_gerald_robert, Solution) :-
|
|
46
|
+
once(donald_gerald_robert(Solution, _Donald, _Gerald, _Robert)).
|
|
47
|
+
|
|
48
|
+
equation(donald_gerald_robert, plus(Donald, Gerald, Robert)) :-
|
|
49
|
+
once(donald_gerald_robert(_Solution, Donald, Gerald, Robert)).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
% Cyclic transitive closure. The graph contains a directed cycle, but eyelang's
|
|
2
|
+
% variant loop guard prevents recursive proof search from revisiting the same
|
|
3
|
+
% active subgoal forever.
|
|
4
|
+
|
|
5
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
6
|
+
materialize(path, 2).
|
|
7
|
+
|
|
8
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
9
|
+
arc(a, b).
|
|
10
|
+
arc(b, c).
|
|
11
|
+
arc(c, d).
|
|
12
|
+
arc(d, a).
|
|
13
|
+
|
|
14
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
15
|
+
path(X, Y) :- arc(X, Y).
|
|
16
|
+
path(X, Z) :- arc(X, Y), path(Y, Z).
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
% Eyelet-inspired D3 group example using findall/3 and sort/2.
|
|
2
|
+
% It enumerates subgroups of the dihedral group of order 6.
|
|
3
|
+
|
|
4
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
5
|
+
materialize(subgroups, 2).
|
|
6
|
+
materialize(subgroupCount, 2).
|
|
7
|
+
materialize(reason, 2).
|
|
8
|
+
|
|
9
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
10
|
+
% Six symmetries of an equilateral triangle: identity, rotations, reflections.
|
|
11
|
+
symmetry(identity).
|
|
12
|
+
symmetry(rotation_120).
|
|
13
|
+
symmetry(rotation_240).
|
|
14
|
+
symmetry(reflection_a).
|
|
15
|
+
symmetry(reflection_b).
|
|
16
|
+
symmetry(reflection_c).
|
|
17
|
+
|
|
18
|
+
% Cayley table for D3 composition.
|
|
19
|
+
compose(identity, identity, identity).
|
|
20
|
+
compose(identity, rotation_120, rotation_120).
|
|
21
|
+
compose(identity, rotation_240, rotation_240).
|
|
22
|
+
compose(identity, reflection_a, reflection_a).
|
|
23
|
+
compose(identity, reflection_b, reflection_b).
|
|
24
|
+
compose(identity, reflection_c, reflection_c).
|
|
25
|
+
compose(rotation_120, identity, rotation_120).
|
|
26
|
+
compose(rotation_120, rotation_120, rotation_240).
|
|
27
|
+
compose(rotation_120, rotation_240, identity).
|
|
28
|
+
compose(rotation_120, reflection_a, reflection_b).
|
|
29
|
+
compose(rotation_120, reflection_b, reflection_c).
|
|
30
|
+
compose(rotation_120, reflection_c, reflection_a).
|
|
31
|
+
compose(rotation_240, identity, rotation_240).
|
|
32
|
+
compose(rotation_240, rotation_120, identity).
|
|
33
|
+
compose(rotation_240, rotation_240, rotation_120).
|
|
34
|
+
compose(rotation_240, reflection_a, reflection_c).
|
|
35
|
+
compose(rotation_240, reflection_b, reflection_a).
|
|
36
|
+
compose(rotation_240, reflection_c, reflection_b).
|
|
37
|
+
compose(reflection_a, identity, reflection_a).
|
|
38
|
+
compose(reflection_a, rotation_120, reflection_c).
|
|
39
|
+
compose(reflection_a, rotation_240, reflection_b).
|
|
40
|
+
compose(reflection_a, reflection_a, identity).
|
|
41
|
+
compose(reflection_a, reflection_b, rotation_240).
|
|
42
|
+
compose(reflection_a, reflection_c, rotation_120).
|
|
43
|
+
compose(reflection_b, identity, reflection_b).
|
|
44
|
+
compose(reflection_b, rotation_120, reflection_a).
|
|
45
|
+
compose(reflection_b, rotation_240, reflection_c).
|
|
46
|
+
compose(reflection_b, reflection_a, rotation_120).
|
|
47
|
+
compose(reflection_b, reflection_b, identity).
|
|
48
|
+
compose(reflection_b, reflection_c, rotation_240).
|
|
49
|
+
compose(reflection_c, identity, reflection_c).
|
|
50
|
+
compose(reflection_c, rotation_120, reflection_b).
|
|
51
|
+
compose(reflection_c, rotation_240, reflection_a).
|
|
52
|
+
compose(reflection_c, reflection_a, rotation_240).
|
|
53
|
+
compose(reflection_c, reflection_b, rotation_120).
|
|
54
|
+
compose(reflection_c, reflection_c, identity).
|
|
55
|
+
% Each candidate subgroup must also contain inverses.
|
|
56
|
+
inverse(identity, identity).
|
|
57
|
+
inverse(rotation_120, rotation_240).
|
|
58
|
+
inverse(rotation_240, rotation_120).
|
|
59
|
+
inverse(reflection_a, reflection_a).
|
|
60
|
+
inverse(reflection_b, reflection_b).
|
|
61
|
+
inverse(reflection_c, reflection_c).
|
|
62
|
+
|
|
63
|
+
% Candidate subsets are generated as subsequences of the sorted symmetry list.
|
|
64
|
+
subsequence([], []).
|
|
65
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
66
|
+
subsequence([Head | Tail], [Head | Rest]) :-
|
|
67
|
+
subsequence(Tail, Rest).
|
|
68
|
+
subsequence([_Head | Tail], Rest) :-
|
|
69
|
+
subsequence(Tail, Rest).
|
|
70
|
+
|
|
71
|
+
all_symmetries(Symmetries) :-
|
|
72
|
+
findall(X, symmetry(X), Raw),
|
|
73
|
+
sort(Raw, Symmetries).
|
|
74
|
+
|
|
75
|
+
% A valid subgroup is closed under both composition and inverse.
|
|
76
|
+
closed_under_composition(Group) :-
|
|
77
|
+
not((member(X, Group), member(Y, Group), compose(X, Y, Z), not(member(Z, Group)))).
|
|
78
|
+
|
|
79
|
+
closed_under_inverse(Group) :-
|
|
80
|
+
not((member(X, Group), inverse(X, Y), not(member(Y, Group)))).
|
|
81
|
+
|
|
82
|
+
valid_group(Group) :-
|
|
83
|
+
all_symmetries(All),
|
|
84
|
+
subsequence(All, Group),
|
|
85
|
+
member(identity, Group),
|
|
86
|
+
closed_under_composition(Group),
|
|
87
|
+
closed_under_inverse(Group).
|
|
88
|
+
|
|
89
|
+
all_subgroups(Groups) :-
|
|
90
|
+
findall(G, valid_group(G), Raw),
|
|
91
|
+
sort(Raw, Groups).
|
|
92
|
+
|
|
93
|
+
subgroups(d3_group, Groups) :-
|
|
94
|
+
all_subgroups(Groups).
|
|
95
|
+
|
|
96
|
+
subgroupCount(d3_group, Count) :-
|
|
97
|
+
all_subgroups(Groups),
|
|
98
|
+
length(Groups, Count).
|
|
99
|
+
|
|
100
|
+
reason(d3_group, "findall enumerates candidate subgroups and sort gives canonical subgroup order").
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
% EYE-inspired dairy energy balance case study.
|
|
2
|
+
% Cows are classified from maintenance, milk requirement, and ration supply.
|
|
3
|
+
|
|
4
|
+
% cow(Cow, BodyWeightKg, MilkKgPerDay, RationEnergyMcalPerKgDM, IntakeKgDM).
|
|
5
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
6
|
+
materialize(energyBalance_Mcal, 2).
|
|
7
|
+
materialize(rationSupportedMilk_kg, 2).
|
|
8
|
+
materialize(status, 2).
|
|
9
|
+
materialize(reason, 2).
|
|
10
|
+
materialize(strongestDeficit, 2).
|
|
11
|
+
|
|
12
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
13
|
+
cow(early_lactation, 650, 38, 6.4, 22).
|
|
14
|
+
cow(mid_lactation, 610, 24, 6.5, 26).
|
|
15
|
+
cow(late_lactation, 580, 16, 6.7, 25).
|
|
16
|
+
cow(grazing, 540, 18, 5.8, 21).
|
|
17
|
+
|
|
18
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
19
|
+
maintenance(C, M) :-
|
|
20
|
+
cow(C, Weight, _, _, _),
|
|
21
|
+
mul(Weight, 0.08, M).
|
|
22
|
+
|
|
23
|
+
milk_requirement(C, R) :-
|
|
24
|
+
cow(C, _, Milk, _, _),
|
|
25
|
+
mul(Milk, 5.0, R).
|
|
26
|
+
|
|
27
|
+
ration_supply(C, S) :-
|
|
28
|
+
cow(C, _, _, Density, Intake),
|
|
29
|
+
mul(Density, Intake, S).
|
|
30
|
+
|
|
31
|
+
total_requirement(C, R) :-
|
|
32
|
+
maintenance(C, M),
|
|
33
|
+
milk_requirement(C, MilkR),
|
|
34
|
+
add(M, MilkR, R).
|
|
35
|
+
|
|
36
|
+
energy_balance(C, B) :-
|
|
37
|
+
ration_supply(C, S),
|
|
38
|
+
total_requirement(C, R),
|
|
39
|
+
sub(S, R, B).
|
|
40
|
+
|
|
41
|
+
ration_supported_milk(C, Milk) :-
|
|
42
|
+
ration_supply(C, S),
|
|
43
|
+
maintenance(C, M),
|
|
44
|
+
sub(S, M, AvailableForMilk),
|
|
45
|
+
div(AvailableForMilk, 5.0, Milk).
|
|
46
|
+
|
|
47
|
+
status(C, negative_energy_balance) :-
|
|
48
|
+
energy_balance(C, B),
|
|
49
|
+
lt(B, -5.0).
|
|
50
|
+
|
|
51
|
+
status(C, near_neutral_energy_balance) :-
|
|
52
|
+
energy_balance(C, B),
|
|
53
|
+
ge(B, -5.0),
|
|
54
|
+
le(B, 5.0).
|
|
55
|
+
|
|
56
|
+
status(C, positive_energy_balance) :-
|
|
57
|
+
energy_balance(C, B),
|
|
58
|
+
gt(B, 5.0).
|
|
59
|
+
|
|
60
|
+
energyBalance_Mcal(C, B) :- energy_balance(C, B).
|
|
61
|
+
rationSupportedMilk_kg(C, M) :- ration_supported_milk(C, M).
|
|
62
|
+
reason(dairy_energy_balance, "ration supply minus maintenance and milk energy requirement determines the class").
|
|
63
|
+
strongestDeficit(dairy_energy_balance, early_lactation) :-
|
|
64
|
+
status(early_lactation, negative_energy_balance),
|
|
65
|
+
status(late_lactation, positive_energy_balance).
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
% Data negotiation with policies, adapted from Eyelet input/data-negotiation.pl.
|
|
2
|
+
% The accepted negotiation matches Eyelet output-swipl/data-negotiation.pl.
|
|
3
|
+
|
|
4
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
5
|
+
materialize(negotiate, 2).
|
|
6
|
+
|
|
7
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
8
|
+
% Each agent has local data, desired remote data, and a simple policy.
|
|
9
|
+
hasData(agent1, [data1, data2, data3]).
|
|
10
|
+
hasData(agent2, [data4, data5, data6]).
|
|
11
|
+
|
|
12
|
+
want_negotiate(agent1, [agent2, data4]).
|
|
13
|
+
want_negotiate(agent1, [agent2, data5]).
|
|
14
|
+
want_negotiate(agent1, [agent2, data7]).
|
|
15
|
+
|
|
16
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
17
|
+
policy(agent1, [request, Data]) :-
|
|
18
|
+
member(Data, [data4, data6]).
|
|
19
|
+
policy(agent2, [accept, Data]) :-
|
|
20
|
+
neq(Data, data5).
|
|
21
|
+
|
|
22
|
+
% A request is possible only if A lacks the data and A's policy allows asking for it.
|
|
23
|
+
request_data(AgentA, AgentB, Data) :-
|
|
24
|
+
hasData(AgentA, DataListA),
|
|
25
|
+
hasData(AgentB, DataListB),
|
|
26
|
+
member(Data, DataListB),
|
|
27
|
+
not_member(Data, DataListA),
|
|
28
|
+
policy(AgentA, [request, Data]).
|
|
29
|
+
|
|
30
|
+
% B accepts only requests for data it has and its own policy permits sharing.
|
|
31
|
+
accept_request(AgentB, _AgentA, Data) :-
|
|
32
|
+
hasData(AgentB, DataListB),
|
|
33
|
+
member(Data, DataListB),
|
|
34
|
+
policy(AgentB, [accept, Data]).
|
|
35
|
+
|
|
36
|
+
negotiate(AgentA, [AgentB, Data]) :-
|
|
37
|
+
want_negotiate(AgentA, [AgentB, Data]),
|
|
38
|
+
request_data(AgentA, AgentB, Data),
|
|
39
|
+
accept_request(AgentB, AgentA, Data).
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
% =============================================================================================================================
|
|
2
|
+
% Deep Taxonomy - depth 10 - expanded N3-style eyelang with checkpoint proof accelerators
|
|
3
|
+
%
|
|
4
|
+
% Adjacent rules mirror the Eyeling N3 deep-taxonomy chain. The checkpoint
|
|
5
|
+
% rules are redundant consequences of that chain and are placed first so eyelang
|
|
6
|
+
% can prove terminal/report goals without overflowing the JavaScript call stack.
|
|
7
|
+
% Report/check rules use once/1 so successful checks do not backtrack into a
|
|
8
|
+
% long adjacent-only proof after a shorter checkpoint proof has succeeded.
|
|
9
|
+
% =============================================================================================================================
|
|
10
|
+
|
|
11
|
+
% Output declarations: materialize/2 selects the relations written to this example's golden output.
|
|
12
|
+
materialize(is, 2).
|
|
13
|
+
materialize(answer, 2).
|
|
14
|
+
materialize(reason, 2).
|
|
15
|
+
materialize(result, 2).
|
|
16
|
+
materialize(checkPassed, 2).
|
|
17
|
+
materialize(arc, 2).
|
|
18
|
+
|
|
19
|
+
% Program structure: facts set up the scenario, and rules derive the materialized conclusions.
|
|
20
|
+
% fact
|
|
21
|
+
|
|
22
|
+
a(ind, n0).
|
|
23
|
+
|
|
24
|
+
% terminal rule
|
|
25
|
+
|
|
26
|
+
% Derivation rules: each rule below contributes one logical step toward the displayed results.
|
|
27
|
+
is(test, true) :- once(a(ind, a2)).
|
|
28
|
+
a(X, a2) :- a(X, n10).
|
|
29
|
+
|
|
30
|
+
% Redundant checkpoint accelerators.
|
|
31
|
+
|
|
32
|
+
a(X, n10) :- a(X, n0).
|
|
33
|
+
a(X, n4) :- a(X, n0).
|
|
34
|
+
a(X, n9) :- a(X, n0).
|
|
35
|
+
|
|
36
|
+
% Adjacent N3-style taxonomy rules.
|
|
37
|
+
|
|
38
|
+
a(X, n1) :- a(X, n0).
|
|
39
|
+
a(X, i1) :- a(X, n0).
|
|
40
|
+
a(X, j1) :- a(X, n0).
|
|
41
|
+
a(X, n2) :- a(X, n1).
|
|
42
|
+
a(X, i2) :- a(X, n1).
|
|
43
|
+
a(X, j2) :- a(X, n1).
|
|
44
|
+
a(X, n3) :- a(X, n2).
|
|
45
|
+
a(X, i3) :- a(X, n2).
|
|
46
|
+
a(X, j3) :- a(X, n2).
|
|
47
|
+
a(X, n4) :- a(X, n3).
|
|
48
|
+
a(X, i4) :- a(X, n3).
|
|
49
|
+
a(X, j4) :- a(X, n3).
|
|
50
|
+
a(X, n5) :- a(X, n4).
|
|
51
|
+
a(X, i5) :- a(X, n4).
|
|
52
|
+
a(X, j5) :- a(X, n4).
|
|
53
|
+
a(X, n6) :- a(X, n5).
|
|
54
|
+
a(X, i6) :- a(X, n5).
|
|
55
|
+
a(X, j6) :- a(X, n5).
|
|
56
|
+
a(X, n7) :- a(X, n6).
|
|
57
|
+
a(X, i7) :- a(X, n6).
|
|
58
|
+
a(X, j7) :- a(X, n6).
|
|
59
|
+
a(X, n8) :- a(X, n7).
|
|
60
|
+
a(X, i8) :- a(X, n7).
|
|
61
|
+
a(X, j8) :- a(X, n7).
|
|
62
|
+
a(X, n9) :- a(X, n8).
|
|
63
|
+
a(X, i9) :- a(X, n8).
|
|
64
|
+
a(X, j9) :- a(X, n8).
|
|
65
|
+
a(X, n10) :- a(X, n9).
|
|
66
|
+
a(X, i10) :- a(X, n9).
|
|
67
|
+
a(X, j10) :- a(X, n9).
|
|
68
|
+
|
|
69
|
+
% ARC checks
|
|
70
|
+
|
|
71
|
+
arc(check1, "C1 OK - the starting classification n0 is present.") :-
|
|
72
|
+
once(a(ind, n0)).
|
|
73
|
+
|
|
74
|
+
arc(check2, "C2 OK - the first expansion produced n1 together with side labels i1 and j1.") :-
|
|
75
|
+
once(a(ind, n1)),
|
|
76
|
+
once(a(ind, i1)),
|
|
77
|
+
once(a(ind, j1)).
|
|
78
|
+
|
|
79
|
+
arc(check3, "C3 OK - the chain reaches the midpoint n5 and still carries both side-label branches.") :-
|
|
80
|
+
once(a(ind, n5)),
|
|
81
|
+
once(a(ind, i5)),
|
|
82
|
+
once(a(ind, j5)).
|
|
83
|
+
|
|
84
|
+
arc(check4, "C4 OK - the final taxonomy step from n9 to n10 was completed.") :-
|
|
85
|
+
once(a(ind, n9)),
|
|
86
|
+
once(a(ind, n10)).
|
|
87
|
+
|
|
88
|
+
arc(check5, "C5 OK - once n10 is reached, the terminal class a2 is derived.") :-
|
|
89
|
+
once(a(ind, n10)),
|
|
90
|
+
once(a(ind, a2)).
|
|
91
|
+
|
|
92
|
+
arc(check6, "C6 OK - the success flag is raised only after the terminal class a2 is present.") :-
|
|
93
|
+
once(a(ind, a2)),
|
|
94
|
+
once(is(test, true)).
|
|
95
|
+
|
|
96
|
+
% ARC report
|
|
97
|
+
|
|
98
|
+
answer(report, "The test succeeds: starting from one individual classified as n0, the rules eventually classify it as n10 and then as a2.") :-
|
|
99
|
+
once(is(test, true)).
|
|
100
|
+
|
|
101
|
+
reason(report, "The adjacent rules mirror the Eyeling N3 deep-taxonomy-10 chain. Redundant checkpoint rules are included only as proof accelerators: each shortcut is entailed by the adjacent chain, and once/1 prevents backtracking into the long adjacent-only proof after a check has succeeded.") :-
|
|
102
|
+
once(a(ind, a2)),
|
|
103
|
+
once(is(test, true)).
|
|
104
|
+
|
|
105
|
+
checkPassed(report, Check) :-
|
|
106
|
+
arc(Check, _Message).
|
|
107
|
+
|
|
108
|
+
result(report, success) :-
|
|
109
|
+
once(is(test, true)),
|
|
110
|
+
once(arc(check1, _C1)),
|
|
111
|
+
once(arc(check2, _C2)),
|
|
112
|
+
once(arc(check3, _C3)),
|
|
113
|
+
once(arc(check4, _C4)),
|
|
114
|
+
once(arc(check5, _C5)),
|
|
115
|
+
once(arc(check6, _C6)).
|