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
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
const {
|
|
21
21
|
RDF_NS,
|
|
22
|
+
RDFS_NS,
|
|
23
|
+
OWL_NS,
|
|
22
24
|
XSD_NS,
|
|
23
25
|
CRYPTO_NS,
|
|
24
26
|
MATH_NS,
|
|
@@ -1046,6 +1048,9 @@ const XSD_HEX_BINARY_DT = XSD_NS + 'hexBinary';
|
|
|
1046
1048
|
const XSD_BASE64_BINARY_DT = XSD_NS + 'base64Binary';
|
|
1047
1049
|
const XSD_ANY_URI_DT = XSD_NS + 'anyURI';
|
|
1048
1050
|
const RDF_LANGSTRING_DT = RDF_NS + 'langString';
|
|
1051
|
+
const RDF_PLAIN_LITERAL_DT = RDF_NS + 'PlainLiteral';
|
|
1052
|
+
const RDF_XML_LITERAL_DT = RDF_NS + 'XMLLiteral';
|
|
1053
|
+
const RDFS_LITERAL_DT = RDFS_NS + 'Literal';
|
|
1049
1054
|
|
|
1050
1055
|
const XSD_STRING_LIKE_DTS = new Set([
|
|
1051
1056
|
XSD_STRING_DT,
|
|
@@ -1074,6 +1079,9 @@ const XSD_INTEGER_BOUNDS = new Map([
|
|
|
1074
1079
|
|
|
1075
1080
|
const XSD_DATATYPE_BUILTIN_DTS = new Set([
|
|
1076
1081
|
RDF_LANGSTRING_DT,
|
|
1082
|
+
RDF_PLAIN_LITERAL_DT,
|
|
1083
|
+
RDF_XML_LITERAL_DT,
|
|
1084
|
+
RDFS_LITERAL_DT,
|
|
1077
1085
|
XSD_STRING_DT,
|
|
1078
1086
|
XSD_NS + 'normalizedString',
|
|
1079
1087
|
XSD_NS + 'token',
|
|
@@ -1095,6 +1103,11 @@ const XSD_DATATYPE_BUILTIN_DTS = new Set([
|
|
|
1095
1103
|
]);
|
|
1096
1104
|
|
|
1097
1105
|
|
|
1106
|
+
const XSD_FLOAT_MAX_VALUE = 3.4028234663852886e38;
|
|
1107
|
+
const XSD_FLOAT_MIN_POSITIVE_VALUE = 1.401298464324817e-45;
|
|
1108
|
+
const XSD_DOUBLE_MAX_VALUE = Number.MAX_VALUE;
|
|
1109
|
+
const XSD_DOUBLE_MIN_POSITIVE_VALUE = Number.MIN_VALUE;
|
|
1110
|
+
|
|
1098
1111
|
// Integer-derived datatypes from XML Schema Part 2 (and commonly used ones).
|
|
1099
1112
|
const XSD_INTEGER_DERIVED_DTS = new Set([
|
|
1100
1113
|
XSD_INTEGER_DT,
|
|
@@ -1153,13 +1166,31 @@ function inferDatatypeForShorthandLexical(lex) {
|
|
|
1153
1166
|
|
|
1154
1167
|
function extractLiteralLanguageTag(litVal) {
|
|
1155
1168
|
if (typeof litVal !== 'string' || !literalHasLangTag(litVal)) return null;
|
|
1156
|
-
|
|
1169
|
+
|
|
1170
|
+
let lastQuote;
|
|
1171
|
+
let quoteLen;
|
|
1172
|
+
if (litVal.startsWith('\"\"\"')) {
|
|
1173
|
+
lastQuote = litVal.lastIndexOf('\"\"\"');
|
|
1174
|
+
quoteLen = 3;
|
|
1175
|
+
} else {
|
|
1176
|
+
lastQuote = litVal.lastIndexOf('"');
|
|
1177
|
+
quoteLen = 1;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1157
1180
|
if (lastQuote < 0) return null;
|
|
1158
|
-
const after = lastQuote +
|
|
1181
|
+
const after = lastQuote + quoteLen;
|
|
1159
1182
|
if (after >= litVal.length || litVal[after] !== '@') return null;
|
|
1160
1183
|
const tag = litVal.slice(after + 1);
|
|
1161
|
-
if (
|
|
1162
|
-
return tag;
|
|
1184
|
+
if (!isValidLanguageTag(tag, true)) return null;
|
|
1185
|
+
return tag.toLowerCase();
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
function isValidLanguageTag(tag, allowDirectionalSuffix) {
|
|
1189
|
+
if (typeof tag !== 'string') return false;
|
|
1190
|
+
const pattern = allowDirectionalSuffix
|
|
1191
|
+
? /^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*(?:--(?:ltr|rtl))?$/
|
|
1192
|
+
: /^[A-Za-z]{1,8}(?:-[A-Za-z0-9]{1,8})*$/;
|
|
1193
|
+
return pattern.test(tag);
|
|
1163
1194
|
}
|
|
1164
1195
|
|
|
1165
1196
|
function literalLexicalValue(litVal) {
|
|
@@ -1218,17 +1249,18 @@ function canonicalFloatDoubleLex(n) {
|
|
|
1218
1249
|
}
|
|
1219
1250
|
|
|
1220
1251
|
function parseStringLikeDatatypeValue(lexical, dt) {
|
|
1221
|
-
|
|
1252
|
+
const value = String(lexical);
|
|
1222
1253
|
|
|
1223
1254
|
if (dt === XSD_NS + 'normalizedString') {
|
|
1224
|
-
|
|
1255
|
+
if (/[\t\n\r]/.test(value)) return null;
|
|
1225
1256
|
} else if (dt !== XSD_STRING_DT) {
|
|
1226
|
-
|
|
1257
|
+
// String-derived datatypes with whitespace facet collapse are considered
|
|
1258
|
+
// lexically valid only when the spelling is already in collapsed form.
|
|
1259
|
+
if (/[\t\n\r]/.test(value) || /^ | $/.test(value) || / {2,}/.test(value)) return null;
|
|
1227
1260
|
}
|
|
1228
1261
|
|
|
1229
1262
|
if (dt === XSD_NS + 'language') {
|
|
1230
|
-
if (
|
|
1231
|
-
value = value.toLowerCase();
|
|
1263
|
+
if (!isValidLanguageTag(value, false)) return null;
|
|
1232
1264
|
} else if (dt === XSD_NS + 'Name') {
|
|
1233
1265
|
if (!/^[:_\p{L}][:_\p{L}\p{N}.\-\u00B7\u0300-\u036F\u203F-\u2040]*$/u.test(value)) return null;
|
|
1234
1266
|
} else if (dt === XSD_NS + 'NCName') {
|
|
@@ -1240,9 +1272,51 @@ function parseStringLikeDatatypeValue(lexical, dt) {
|
|
|
1240
1272
|
return {
|
|
1241
1273
|
family: 'string',
|
|
1242
1274
|
dt,
|
|
1243
|
-
value,
|
|
1244
|
-
canonicalLex: value,
|
|
1245
|
-
canonicalLiteral: makeDatatypeTypedLiteral(value, dt),
|
|
1275
|
+
value: dt === XSD_NS + 'language' ? value.toLowerCase() : value,
|
|
1276
|
+
canonicalLex: dt === XSD_NS + 'language' ? value.toLowerCase() : value,
|
|
1277
|
+
canonicalLiteral: makeDatatypeTypedLiteral(dt === XSD_NS + 'language' ? value.toLowerCase() : value, dt),
|
|
1278
|
+
comparable: true,
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
function parsePlainLiteralDatatypeValue(lexical) {
|
|
1283
|
+
const parsed = splitPlainLiteralLexical(lexical);
|
|
1284
|
+
if (!parsed) return null;
|
|
1285
|
+
const canonicalLex = `${parsed.text}@${parsed.lang}`;
|
|
1286
|
+
return {
|
|
1287
|
+
family: 'plainLiteral',
|
|
1288
|
+
dt: RDF_PLAIN_LITERAL_DT,
|
|
1289
|
+
value: parsed.text,
|
|
1290
|
+
lang: parsed.lang,
|
|
1291
|
+
canonicalLex,
|
|
1292
|
+
canonicalLiteral: makeDatatypeTypedLiteral(canonicalLex, RDF_PLAIN_LITERAL_DT),
|
|
1293
|
+
comparable: true,
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
function splitPlainLiteralLexical(lexical) {
|
|
1298
|
+
const s = String(lexical);
|
|
1299
|
+
const at = s.lastIndexOf('@');
|
|
1300
|
+
// rdf:PlainLiteral lexical forms encode the literal as text + "@" +
|
|
1301
|
+
// language-tag. The language tag may be empty, e.g. "abc@".
|
|
1302
|
+
// A lexical with no separator at all, e.g. "abc", is ill-typed.
|
|
1303
|
+
if (at < 0) return null;
|
|
1304
|
+
const text = s.slice(0, at);
|
|
1305
|
+
const lang = s.slice(at + 1);
|
|
1306
|
+
if (lang !== '' && !isValidLanguageTag(lang, false)) return null;
|
|
1307
|
+
return { text, lang: lang.toLowerCase() };
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
function parseXmlLiteralDatatypeValue(lexical) {
|
|
1311
|
+
const s = String(lexical);
|
|
1312
|
+
if (!isWellFormedXmlFragment(s)) return null;
|
|
1313
|
+
const canonicalLex = s.trim();
|
|
1314
|
+
return {
|
|
1315
|
+
family: 'xmlLiteral',
|
|
1316
|
+
dt: RDF_XML_LITERAL_DT,
|
|
1317
|
+
value: canonicalLex,
|
|
1318
|
+
canonicalLex,
|
|
1319
|
+
canonicalLiteral: makeDatatypeTypedLiteral(canonicalLex, RDF_XML_LITERAL_DT),
|
|
1246
1320
|
comparable: true,
|
|
1247
1321
|
};
|
|
1248
1322
|
}
|
|
@@ -1330,6 +1404,11 @@ function parseFloatDoubleDatatypeValue(lexical, dt) {
|
|
|
1330
1404
|
const special = parseXsdFloatSpecialLex(s);
|
|
1331
1405
|
const value = special !== null ? special : Number(s);
|
|
1332
1406
|
if (Number.isNaN(value) && s !== 'NaN') return null;
|
|
1407
|
+
if (Number.isFinite(value)) {
|
|
1408
|
+
const abs = Math.abs(value);
|
|
1409
|
+
if (dt === XSD_FLOAT_DT && abs > 0 && (abs > XSD_FLOAT_MAX_VALUE || abs < XSD_FLOAT_MIN_POSITIVE_VALUE)) return null;
|
|
1410
|
+
if (dt === XSD_DOUBLE_DT && abs > 0 && (abs > XSD_DOUBLE_MAX_VALUE || abs < XSD_DOUBLE_MIN_POSITIVE_VALUE)) return null;
|
|
1411
|
+
}
|
|
1333
1412
|
const canonicalLex = canonicalFloatDoubleLex(value);
|
|
1334
1413
|
return {
|
|
1335
1414
|
family: 'numeric',
|
|
@@ -1419,7 +1498,11 @@ function parseBinaryDatatypeValue(lexical, dt) {
|
|
|
1419
1498
|
|
|
1420
1499
|
function parseAnyUriDatatypeValue(lexical) {
|
|
1421
1500
|
const value = String(lexical);
|
|
1422
|
-
if (/[
|
|
1501
|
+
if (/[^\u0021-\u007E]/.test(value) || /[<>"{}|\\^`]/.test(value)) return null;
|
|
1502
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
1503
|
+
if (value[i] === '%' && !/^[0-9A-Fa-f]{2}$/.test(value.slice(i + 1, i + 3))) return null;
|
|
1504
|
+
}
|
|
1505
|
+
if (!isValidIriReferenceLexical(value)) return null;
|
|
1423
1506
|
return {
|
|
1424
1507
|
family: 'anyURI',
|
|
1425
1508
|
dt: XSD_ANY_URI_DT,
|
|
@@ -1430,6 +1513,116 @@ function parseAnyUriDatatypeValue(lexical) {
|
|
|
1430
1513
|
};
|
|
1431
1514
|
}
|
|
1432
1515
|
|
|
1516
|
+
function isValidIriReferenceLexical(value) {
|
|
1517
|
+
// Minimal RFC 3987/3986 structural check for IRI references. In
|
|
1518
|
+
// particular, a relative reference may not start with a colon-bearing first
|
|
1519
|
+
// path segment such as ":abc"; this is the OWL 2 RL anyURI illtyped case.
|
|
1520
|
+
// Empty references and fragment-only references are allowed.
|
|
1521
|
+
const s = String(value);
|
|
1522
|
+
if (s === '') return true;
|
|
1523
|
+
if (/^[A-Za-z][A-Za-z0-9+.-]*:/.test(s)) return true; // absolute scheme
|
|
1524
|
+
if (s.startsWith('//') || s.startsWith('/') || s.startsWith('?') || s.startsWith('#')) return true;
|
|
1525
|
+
const cut = s.search(/[/?#]/);
|
|
1526
|
+
const firstSegment = cut < 0 ? s : s.slice(0, cut);
|
|
1527
|
+
return !firstSegment.includes(':');
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
function isWellFormedXmlFragment(input) {
|
|
1531
|
+
const source = String(input).trim();
|
|
1532
|
+
if (!source) return false;
|
|
1533
|
+
const stack = [];
|
|
1534
|
+
let seenElement = false;
|
|
1535
|
+
let position = 0;
|
|
1536
|
+
|
|
1537
|
+
while (position < source.length) {
|
|
1538
|
+
const open = source.indexOf('<', position);
|
|
1539
|
+
if (open < 0) return stack.length === 0 && isValidXmlText(source.slice(position)) && seenElement;
|
|
1540
|
+
if (!isValidXmlText(source.slice(position, open))) return false;
|
|
1541
|
+
|
|
1542
|
+
if (source.startsWith('<!--', open)) {
|
|
1543
|
+
const close = source.indexOf('-->', open + 4);
|
|
1544
|
+
if (close < 0 || source.slice(open + 4, close).includes('--')) return false;
|
|
1545
|
+
position = close + 3;
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
if (source.startsWith('<![CDATA[', open)) {
|
|
1550
|
+
const close = source.indexOf(']]>', open + 9);
|
|
1551
|
+
if (close < 0) return false;
|
|
1552
|
+
position = close + 3;
|
|
1553
|
+
continue;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
if (source.startsWith('<?', open)) {
|
|
1557
|
+
const close = source.indexOf('?>', open + 2);
|
|
1558
|
+
if (close < 0) return false;
|
|
1559
|
+
position = close + 2;
|
|
1560
|
+
continue;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
if (source.startsWith('</', open)) {
|
|
1564
|
+
const close = source.indexOf('>', open + 2);
|
|
1565
|
+
if (close < 0) return false;
|
|
1566
|
+
const name = source.slice(open + 2, close).trim();
|
|
1567
|
+
if (!isValidXmlName(name) || stack.pop() !== name) return false;
|
|
1568
|
+
position = close + 1;
|
|
1569
|
+
continue;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
const close = findXmlTagEnd(source, open + 1);
|
|
1573
|
+
if (close < 0) return false;
|
|
1574
|
+
const raw = source.slice(open + 1, close);
|
|
1575
|
+
const selfClosing = /\/\s*$/.test(raw);
|
|
1576
|
+
const content = selfClosing ? raw.replace(/\/\s*$/, '').trim() : raw.trim();
|
|
1577
|
+
const nameMatch = /^([^\s/>]+)/.exec(content);
|
|
1578
|
+
if (!nameMatch || !isValidXmlName(nameMatch[1]) || !areValidXmlAttributes(content.slice(nameMatch[0].length))) return false;
|
|
1579
|
+
seenElement = true;
|
|
1580
|
+
if (!selfClosing) stack.push(nameMatch[1]);
|
|
1581
|
+
position = close + 1;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
return stack.length === 0 && seenElement;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
function findXmlTagEnd(source, start) {
|
|
1588
|
+
let quote = null;
|
|
1589
|
+
for (let i = start; i < source.length; i += 1) {
|
|
1590
|
+
const ch = source[i];
|
|
1591
|
+
if (quote) {
|
|
1592
|
+
if (ch === quote) quote = null;
|
|
1593
|
+
} else if (ch === '"' || ch === "'") {
|
|
1594
|
+
quote = ch;
|
|
1595
|
+
} else if (ch === '>') {
|
|
1596
|
+
return i;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
return -1;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
function areValidXmlAttributes(source) {
|
|
1603
|
+
let rest = String(source).trim();
|
|
1604
|
+
const seen = new Set();
|
|
1605
|
+
while (rest) {
|
|
1606
|
+
const m = /^([A-Za-z_:\u0080-\uFFFF][A-Za-z0-9_.:\-\u0080-\uFFFF]*)\s*=\s*("[^"]*"|'[^']*')\s*/u.exec(rest);
|
|
1607
|
+
if (!m || seen.has(m[1]) || !isValidXmlAttributeValue(m[2].slice(1, -1))) return false;
|
|
1608
|
+
seen.add(m[1]);
|
|
1609
|
+
rest = rest.slice(m[0].length).trim();
|
|
1610
|
+
}
|
|
1611
|
+
return true;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
function isValidXmlAttributeValue(value) {
|
|
1615
|
+
return !/[<]/.test(value) && isValidXmlText(value);
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
function isValidXmlText(value) {
|
|
1619
|
+
return !/[<&]/.test(String(value).replace(/&(?:amp|lt|gt|quot|apos|#\d+|#x[0-9A-Fa-f]+);/g, ''));
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
function isValidXmlName(name) {
|
|
1623
|
+
return /^[A-Za-z_:\u0080-\uFFFF][A-Za-z0-9_.:\-\u0080-\uFFFF]*$/u.test(name) && !/^xml$/i.test(name);
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1433
1626
|
function isLeapYearBigInt(year) {
|
|
1434
1627
|
if (year % 400n === 0n) return true;
|
|
1435
1628
|
if (year % 100n === 0n) return false;
|
|
@@ -1586,11 +1779,33 @@ function parseLangStringDatatypeValue(t, lexical) {
|
|
|
1586
1779
|
};
|
|
1587
1780
|
}
|
|
1588
1781
|
|
|
1782
|
+
function literalTermDatatypeKey(t) {
|
|
1783
|
+
return `${literalLexicalValue(t.value)}^^${literalDatatypeIri(t) || ''}`;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1589
1786
|
function parseDatatypeValueForDatatype(t, dt) {
|
|
1590
1787
|
if (!(t instanceof Literal) || typeof dt !== 'string' || !isSupportedDatatypeIri(dt)) return null;
|
|
1788
|
+
|
|
1789
|
+
if (dt === RDFS_LITERAL_DT) {
|
|
1790
|
+
const ownDt = literalDatatypeIri(t);
|
|
1791
|
+
if (ownDt === null || !isSupportedDatatypeIri(ownDt)) return null;
|
|
1792
|
+
const ownValue = parseDatatypeValueForDatatype(t, ownDt);
|
|
1793
|
+
if (!ownValue) return null;
|
|
1794
|
+
return {
|
|
1795
|
+
family: 'literal',
|
|
1796
|
+
dt: RDFS_LITERAL_DT,
|
|
1797
|
+
value: literalTermDatatypeKey(t),
|
|
1798
|
+
canonicalLex: literalLexicalValue(t.value),
|
|
1799
|
+
canonicalLiteral: t,
|
|
1800
|
+
comparable: false,
|
|
1801
|
+
};
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1591
1804
|
const lexical = literalLexicalValue(t.value);
|
|
1592
1805
|
|
|
1593
1806
|
if (dt === RDF_LANGSTRING_DT) return parseLangStringDatatypeValue(t, lexical);
|
|
1807
|
+
if (dt === RDF_PLAIN_LITERAL_DT) return parsePlainLiteralDatatypeValue(lexical);
|
|
1808
|
+
if (dt === RDF_XML_LITERAL_DT) return parseXmlLiteralDatatypeValue(lexical);
|
|
1594
1809
|
if (literalHasLangTag(t.value)) return null;
|
|
1595
1810
|
if (XSD_STRING_LIKE_DTS.has(dt)) return parseStringLikeDatatypeValue(lexical, dt);
|
|
1596
1811
|
if (dt === XSD_BOOLEAN_DT) return parseBooleanDatatypeValue(lexical);
|
|
@@ -1616,10 +1831,11 @@ function compareDecimalExactValues(a, b) {
|
|
|
1616
1831
|
|
|
1617
1832
|
function datatypeValuesSame(a, b) {
|
|
1618
1833
|
if (!a || !b || !a.comparable || !b.comparable) return false;
|
|
1619
|
-
if (a.family === 'langString' || b.family === 'langString') {
|
|
1834
|
+
if (a.family === 'langString' || b.family === 'langString' || a.family === 'plainLiteral' || b.family === 'plainLiteral') {
|
|
1620
1835
|
return a.family === b.family && a.value === b.value && a.lang === b.lang;
|
|
1621
1836
|
}
|
|
1622
1837
|
if (a.family === 'string' && b.family === 'string') return a.value === b.value;
|
|
1838
|
+
if (a.family === 'xmlLiteral' && b.family === 'xmlLiteral') return a.value === b.value;
|
|
1623
1839
|
if (a.family === 'boolean' && b.family === 'boolean') return a.value === b.value;
|
|
1624
1840
|
if (a.family === 'anyURI' && b.family === 'anyURI') return a.value === b.value;
|
|
1625
1841
|
if (a.family === 'binary' && b.family === 'binary') {
|
|
@@ -1646,7 +1862,9 @@ function datatypeValuesSame(a, b) {
|
|
|
1646
1862
|
function datatypeValuesComparable(a, b) {
|
|
1647
1863
|
if (!a || !b || !a.comparable || !b.comparable) return false;
|
|
1648
1864
|
if (a.family === 'dateTime' && b.family === 'dateTime' && a.hasTimezone !== b.hasTimezone) return false;
|
|
1865
|
+
if (a.family === 'numeric' && b.family === 'numeric') return true;
|
|
1649
1866
|
if (a.family === 'langString' || b.family === 'langString') return a.family === b.family;
|
|
1867
|
+
if (a.family === 'plainLiteral' || b.family === 'plainLiteral') return a.family === b.family;
|
|
1650
1868
|
if (a.family === 'string' || b.family === 'string') return a.family === b.family;
|
|
1651
1869
|
return a.family === b.family;
|
|
1652
1870
|
}
|
|
@@ -1670,6 +1888,17 @@ function evalDatatypeInspectionBuiltin(g, subst, kind) {
|
|
|
1670
1888
|
const dt = literalDatatypeIri(g.s);
|
|
1671
1889
|
if (dt === null) return [];
|
|
1672
1890
|
valueTerm = internIri(dt);
|
|
1891
|
+
const out = evalBindBuiltinObject(g.o, valueTerm, subst);
|
|
1892
|
+
|
|
1893
|
+
// OWL 2 RL datatype rules often need common string literals to also
|
|
1894
|
+
// participate in generic literal comparisons, while application rules still
|
|
1895
|
+
// ask for their precise datatype explicitly. When the datatype output is
|
|
1896
|
+
// unbound, expose rdfs:Literal as an additional super-datatype answer for
|
|
1897
|
+
// xsd:string and rdf:langString; bound-object calls remain strictly exact.
|
|
1898
|
+
if (g.o instanceof Var && (dt === XSD_STRING_DT || dt === RDF_LANGSTRING_DT)) {
|
|
1899
|
+
out.push(...evalBindBuiltinObject(g.o, internIri(RDFS_LITERAL_DT), subst));
|
|
1900
|
+
}
|
|
1901
|
+
return out;
|
|
1673
1902
|
} else if (kind === 'lexicalForm') {
|
|
1674
1903
|
valueTerm = makeStringLiteral(literalLexicalValue(g.s.value));
|
|
1675
1904
|
} else if (kind === 'language') {
|
|
@@ -1738,6 +1967,57 @@ function evalDatatypeValueComparisonBuiltin(g, subst, same) {
|
|
|
1738
1967
|
return [];
|
|
1739
1968
|
}
|
|
1740
1969
|
|
|
1970
|
+
function evalOwlSameAsBuiltin(g, subst, facts, maxResults) {
|
|
1971
|
+
const out = [];
|
|
1972
|
+
const seen = new Set();
|
|
1973
|
+
const limit = typeof maxResults === 'number' && maxResults > 0 ? maxResults : Infinity;
|
|
1974
|
+
|
|
1975
|
+
function addPair(left, right) {
|
|
1976
|
+
if (out.length >= limit) return true;
|
|
1977
|
+
const key = `${termFastKey ? termFastKey(left) : termToN3(left)} ${termFastKey ? termFastKey(right) : termToN3(right)}`;
|
|
1978
|
+
if (seen.has(key)) return false;
|
|
1979
|
+
let s2 = unifyTerm(g.s, left, subst);
|
|
1980
|
+
if (s2 === null) return false;
|
|
1981
|
+
s2 = unifyTerm(g.o, right, s2);
|
|
1982
|
+
if (s2 === null) return false;
|
|
1983
|
+
seen.add(key);
|
|
1984
|
+
out.push(s2);
|
|
1985
|
+
return out.length >= limit;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
function addReflexive(term) {
|
|
1989
|
+
return addPair(term, term);
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
const sameAsIri = OWL_NS + 'sameAs';
|
|
1993
|
+
const differentFromIri = OWL_NS + 'differentFrom';
|
|
1994
|
+
|
|
1995
|
+
for (const tr of facts || []) {
|
|
1996
|
+
if (tr && tr.p instanceof Iri && tr.p.value === sameAsIri) {
|
|
1997
|
+
if (addPair(tr.s, tr.o)) return out;
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
// owl:sameAs is reflexive. Avoid enumerating the entire active term universe
|
|
2002
|
+
// for fully-unbound goals; only add the reflexive pairs that are immediately
|
|
2003
|
+
// needed to detect explicit self-diversity (?x owl:differentFrom ?x).
|
|
2004
|
+
if (!(g.s instanceof Var) && !(g.o instanceof Var)) {
|
|
2005
|
+
if (termsEqual(g.s, g.o)) addReflexive(g.s);
|
|
2006
|
+
} else if (!(g.s instanceof Var)) {
|
|
2007
|
+
addReflexive(g.s);
|
|
2008
|
+
} else if (!(g.o instanceof Var)) {
|
|
2009
|
+
addReflexive(g.o);
|
|
2010
|
+
} else {
|
|
2011
|
+
for (const tr of facts || []) {
|
|
2012
|
+
if (tr && tr.p instanceof Iri && tr.p.value === differentFromIri && termsEqual(tr.s, tr.o)) {
|
|
2013
|
+
if (addReflexive(tr.s)) return out;
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
return out;
|
|
2019
|
+
}
|
|
2020
|
+
|
|
1741
2021
|
// ===========================================================================
|
|
1742
2022
|
// Math builtin helpers
|
|
1743
2023
|
// ===========================================================================
|
|
@@ -2877,6 +3157,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen, maxResults) {
|
|
|
2877
3157
|
const pv = iriValue(g.p);
|
|
2878
3158
|
if (pv === null) return null;
|
|
2879
3159
|
|
|
3160
|
+
if (pv === OWL_NS + 'sameAs') return evalOwlSameAsBuiltin(g, subst, facts, maxResults);
|
|
3161
|
+
|
|
2880
3162
|
// Super restricted mode: disable *all* builtins except => / <= (log:implies / log:impliedBy)
|
|
2881
3163
|
if (typeof getSuperRestrictedMode === 'function' && getSuperRestrictedMode()) {
|
|
2882
3164
|
const allow1 = LOG_NS + 'implies';
|
|
@@ -5219,6 +5501,7 @@ function isBuiltinPred(p) {
|
|
|
5219
5501
|
}
|
|
5220
5502
|
|
|
5221
5503
|
if (__customBuiltinHandlers.has(v)) return true;
|
|
5504
|
+
if (v === OWL_NS + 'sameAs') return true;
|
|
5222
5505
|
|
|
5223
5506
|
return (
|
|
5224
5507
|
v.startsWith(CRYPTO_NS) ||
|
|
@@ -6210,6 +6493,7 @@ async function main() {
|
|
|
6210
6493
|
`Options:\n` +
|
|
6211
6494
|
` -a, --ast Print parsed AST as JSON and exit.\n` +
|
|
6212
6495
|
` --builtin <module.js> Load a custom builtin module (repeatable).\n` +
|
|
6496
|
+
` --engine <n3|eyelang> Select the N3 engine (default) or eyelang engine.\n` +
|
|
6213
6497
|
` -d, --deterministic-skolem Make log:skolem stable across reasoning runs.\n` +
|
|
6214
6498
|
` -e, --enforce-https Rewrite http:// IRIs to https:// for log dereferencing builtins.\n` +
|
|
6215
6499
|
` -h, --help Show this help and exit.\n` +
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Eyelang examples inside Eyeling
|
|
2
|
+
|
|
3
|
+
This directory contains eyelang examples that can be exercised through Eyeling's experimental second engine:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
eyeling --engine eyelang examples/eyelang/ancestor.pl
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The eyelang conformance corpus is kept under `test/eyelang/` and can be run with:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm run test:eyelang:corpus
|
|
13
|
+
```
|