eyeling 1.23.4 → 1.24.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/HANDBOOK.md +6 -6
- package/README.md +1 -0
- package/dist/browser/eyeling.browser.js +11812 -11836
- package/eyeling.js +40 -12
- package/lib/prelude.js +40 -12
- package/package.json +7 -5
- package/see/README.md +146 -0
- package/see/examples/_see.js +218 -0
- package/see/examples/age.js +1433 -0
- package/see/examples/annotation.js +1294 -0
- package/see/examples/backward.js +1379 -0
- package/see/examples/backward_recursion.js +1478 -0
- package/see/examples/bayes_diagnosis.js +2857 -0
- package/see/examples/bayes_therapy.js +4126 -0
- package/see/examples/bmi.js +3012 -0
- package/see/examples/builtin_coverage.js +2498 -0
- package/see/examples/collection.js +1294 -0
- package/see/examples/complex.js +3736 -0
- package/see/examples/complex_matrix_stability.js +2947 -0
- package/see/examples/composition_of_injective_functions_is_injective.js +2144 -0
- package/see/examples/control_system.js +1892 -0
- package/see/examples/crypto_builtins_tests.js +1463 -0
- package/see/examples/delfour.js +3148 -0
- package/see/examples/digital_product_passport.js +2830 -0
- package/see/examples/dijkstra.js +2044 -0
- package/see/examples/dijkstra_risk_path.js +1848 -0
- package/see/examples/doc/age.md +27 -0
- package/see/examples/doc/annotation.md +24 -0
- package/see/examples/doc/backward.md +26 -0
- package/see/examples/doc/backward_recursion.md +26 -0
- package/see/examples/doc/bayes_diagnosis.md +41 -0
- package/see/examples/doc/bayes_therapy.md +40 -0
- package/see/examples/doc/bmi.md +38 -0
- package/see/examples/doc/builtin_coverage.md +53 -0
- package/see/examples/doc/collection.md +24 -0
- package/see/examples/doc/complex.md +38 -0
- package/see/examples/doc/complex_matrix_stability.md +35 -0
- package/see/examples/doc/composition_of_injective_functions_is_injective.md +24 -0
- package/see/examples/doc/control_system.md +32 -0
- package/see/examples/doc/crypto_builtins_tests.md +27 -0
- package/see/examples/doc/delfour.md +37 -0
- package/see/examples/doc/digital_product_passport.md +36 -0
- package/see/examples/doc/dijkstra.md +28 -0
- package/see/examples/doc/dijkstra_risk_path.md +30 -0
- package/see/examples/doc/dog.md +28 -0
- package/see/examples/doc/eco_route_insight.md +33 -0
- package/see/examples/doc/equals.md +26 -0
- package/see/examples/doc/equivalence_classes_overlap_implies_same_class.md +24 -0
- package/see/examples/doc/euler_identity.md +39 -0
- package/see/examples/doc/ev_roundtrip_planner.md +32 -0
- package/see/examples/doc/existential_rule.md +24 -0
- package/see/examples/doc/expression_eval.md +26 -0
- package/see/examples/doc/family_cousins.md +24 -0
- package/see/examples/doc/fastpow.md +29 -0
- package/see/examples/doc/fibonacci.md +28 -0
- package/see/examples/doc/french_cities.md +28 -0
- package/see/examples/doc/fundamental_theorem_arithmetic.md +36 -0
- package/see/examples/doc/genetic_knapsack_selection.md +29 -0
- package/see/examples/doc/goldbach_1000.md +31 -0
- package/see/examples/doc/good_cobbler.md +27 -0
- package/see/examples/doc/gps.md +35 -0
- package/see/examples/doc/gray_code_counter.md +31 -0
- package/see/examples/doc/greatest_lower_bound_uniqueness.md +24 -0
- package/see/examples/doc/group_inverse_uniqueness.md +24 -0
- package/see/examples/doc/hadamard_approx.md +32 -0
- package/see/examples/doc/hanoi.md +26 -0
- package/see/examples/doc/odrl_dpv_risk_ranked.md +57 -0
- package/see/examples/doc/path_discovery.md +33 -0
- package/see/examples/doc/rc_discharge_envelope.md +33 -0
- package/see/examples/doc/rdf_message_flow.md +35 -0
- package/see/examples/doc/rdf_messages.md +37 -0
- package/see/examples/doc/school_placement_audit.md +31 -0
- package/see/examples/doc/smoke_arithmetic.md +31 -0
- package/see/examples/doc/socrates.md +24 -0
- package/see/examples/doc/wind_turbine.md +37 -0
- package/see/examples/doc/witch.md +28 -0
- package/see/examples/dog.js +1410 -0
- package/see/examples/eco_route_insight.js +2084 -0
- package/see/examples/equals.js +1337 -0
- package/see/examples/equivalence_classes_overlap_implies_same_class.js +1766 -0
- package/see/examples/euler_identity.js +2012 -0
- package/see/examples/ev_roundtrip_planner.js +2536 -0
- package/see/examples/existential_rule.js +1337 -0
- package/see/examples/expression_eval.js +1772 -0
- package/see/examples/family_cousins.js +1560 -0
- package/see/examples/fastpow.js +2181 -0
- package/see/examples/fibonacci.js +1568 -0
- package/see/examples/french_cities.js +1466 -0
- package/see/examples/fundamental_theorem_arithmetic.js +2080 -0
- package/see/examples/genetic_knapsack_selection.js +1717 -0
- package/see/examples/goldbach_1000.js +1772 -0
- package/see/examples/good_cobbler.js +1370 -0
- package/see/examples/gps.js +2787 -0
- package/see/examples/gray_code_counter.js +1615 -0
- package/see/examples/greatest_lower_bound_uniqueness.js +1892 -0
- package/see/examples/group_inverse_uniqueness.js +1871 -0
- package/see/examples/hadamard_approx.js +4391 -0
- package/see/examples/hanoi.js +1599 -0
- package/see/examples/input/age.trig +27 -0
- package/see/examples/input/annotation.trig +31 -0
- package/see/examples/input/backward.trig +25 -0
- package/see/examples/input/backward_recursion.trig +25 -0
- package/see/examples/input/bayes_diagnosis.trig +111 -0
- package/see/examples/input/bayes_therapy.trig +130 -0
- package/see/examples/input/bmi.trig +28 -0
- package/see/examples/input/builtin_coverage.trig +24 -0
- package/see/examples/input/collection.trig +25 -0
- package/see/examples/input/complex.trig +26 -0
- package/see/examples/input/complex_matrix_stability.trig +65 -0
- package/see/examples/input/composition_of_injective_functions_is_injective.trig +35 -0
- package/see/examples/input/control_system.trig +31 -0
- package/see/examples/input/crypto_builtins_tests.trig +25 -0
- package/see/examples/input/delfour.trig +90 -0
- package/see/examples/input/digital_product_passport.trig +116 -0
- package/see/examples/input/dijkstra.trig +34 -0
- package/see/examples/input/dijkstra_risk_path.trig +46 -0
- package/see/examples/input/dog.trig +31 -0
- package/see/examples/input/eco_route_insight.trig +58 -0
- package/see/examples/input/equals.trig +25 -0
- package/see/examples/input/equivalence_classes_overlap_implies_same_class.trig +28 -0
- package/see/examples/input/euler_identity.trig +34 -0
- package/see/examples/input/ev_roundtrip_planner.trig +90 -0
- package/see/examples/input/existential_rule.trig +26 -0
- package/see/examples/input/expression_eval.trig +41 -0
- package/see/examples/input/family_cousins.trig +39 -0
- package/see/examples/input/fastpow.trig +25 -0
- package/see/examples/input/fibonacci.trig +51 -0
- package/see/examples/input/french_cities.trig +38 -0
- package/see/examples/input/fundamental_theorem_arithmetic.trig +42 -0
- package/see/examples/input/genetic_knapsack_selection.trig +39 -0
- package/see/examples/input/goldbach_1000.trig +53 -0
- package/see/examples/input/good_cobbler.trig +24 -0
- package/see/examples/input/gps.trig +35 -0
- package/see/examples/input/gray_code_counter.trig +33 -0
- package/see/examples/input/greatest_lower_bound_uniqueness.trig +29 -0
- package/see/examples/input/group_inverse_uniqueness.trig +29 -0
- package/see/examples/input/hadamard_approx.trig +32 -0
- package/see/examples/input/hanoi.trig +26 -0
- package/see/examples/input/odrl_dpv_risk_ranked.trig +107 -0
- package/see/examples/input/path-discovery.trig +96448 -0
- package/see/examples/input/path_discovery.trig +29 -0
- package/see/examples/input/rc_discharge_envelope.trig +37 -0
- package/see/examples/input/rdf_message_flow.trig +100 -0
- package/see/examples/input/rdf_messages.trig +69 -0
- package/see/examples/input/school_placement_audit.trig +51 -0
- package/see/examples/input/smoke_arithmetic.trig +27 -0
- package/see/examples/input/socrates.trig +26 -0
- package/see/examples/input/wind_turbine.trig +48 -0
- package/see/examples/input/witch.trig +26 -0
- package/see/examples/n3/age.n3 +28 -0
- package/see/examples/n3/annotation.n3 +7 -0
- package/see/examples/n3/backward.n3 +22 -0
- package/see/examples/n3/backward_recursion.n3 +12 -0
- package/see/examples/n3/bayes_diagnosis.n3 +122 -0
- package/see/examples/n3/bayes_therapy.n3 +149 -0
- package/see/examples/n3/bmi.n3 +145 -0
- package/see/examples/n3/builtin_coverage.n3 +68 -0
- package/see/examples/n3/collection.n3 +3 -0
- package/see/examples/n3/complex.n3 +140 -0
- package/see/examples/n3/complex_matrix_stability.n3 +113 -0
- package/see/examples/n3/composition_of_injective_functions_is_injective.n3 +27 -0
- package/see/examples/n3/control_system.n3 +59 -0
- package/see/examples/n3/crypto_builtins_tests.n3 +18 -0
- package/see/examples/n3/delfour.n3 +167 -0
- package/see/examples/n3/digital_product_passport.n3 +156 -0
- package/see/examples/n3/dijkstra.n3 +46 -0
- package/see/examples/n3/dijkstra_risk_path.n3 +67 -0
- package/see/examples/n3/dog.n3 +20 -0
- package/see/examples/n3/eco_route_insight.n3 +88 -0
- package/see/examples/n3/equals.n3 +11 -0
- package/see/examples/n3/equivalence_classes_overlap_implies_same_class.n3 +19 -0
- package/see/examples/n3/euler_identity.n3 +41 -0
- package/see/examples/n3/ev_roundtrip_planner.n3 +82 -0
- package/see/examples/n3/existential_rule.n3 +10 -0
- package/see/examples/n3/expression_eval.n3 +21 -0
- package/see/examples/n3/family_cousins.n3 +62 -0
- package/see/examples/n3/fastpow.n3 +56 -0
- package/see/examples/n3/fibonacci.n3 +44 -0
- package/see/examples/n3/french_cities.n3 +28 -0
- package/see/examples/n3/fundamental_theorem_arithmetic.n3 +84 -0
- package/see/examples/n3/genetic_knapsack_selection.n3 +54 -0
- package/see/examples/n3/goldbach_1000.n3 +66 -0
- package/see/examples/n3/good_cobbler.n3 +10 -0
- package/see/examples/n3/gps.n3 +70 -0
- package/see/examples/n3/gray_code_counter.n3 +53 -0
- package/see/examples/n3/greatest_lower_bound_uniqueness.n3 +20 -0
- package/see/examples/n3/group_inverse_uniqueness.n3 +19 -0
- package/see/examples/n3/hadamard_approx.n3 +43 -0
- package/see/examples/n3/hanoi.n3 +16 -0
- package/see/examples/n3/odrl_dpv_risk_ranked.n3 +460 -0
- package/see/examples/n3/path_discovery.n3 +43 -0
- package/see/examples/n3/rc_discharge_envelope.n3 +61 -0
- package/see/examples/n3/rdf_message_flow.n3 +209 -0
- package/see/examples/n3/rdf_messages.n3 +143 -0
- package/see/examples/n3/school_placement_audit.n3 +63 -0
- package/see/examples/n3/smoke_arithmetic.n3 +22 -0
- package/see/examples/n3/socrates.n3 +21 -0
- package/see/examples/n3/wind_turbine.n3 +85 -0
- package/see/examples/n3/witch.n3 +30 -0
- package/see/examples/odrl_dpv_risk_ranked.js +5102 -0
- package/see/examples/output/age.md +48 -0
- package/see/examples/output/annotation.md +43 -0
- package/see/examples/output/backward.md +50 -0
- package/see/examples/output/backward_recursion.md +54 -0
- package/see/examples/output/bayes_diagnosis.md +103 -0
- package/see/examples/output/bayes_therapy.md +84 -0
- package/see/examples/output/bmi.md +164 -0
- package/see/examples/output/builtin_coverage.md +99 -0
- package/see/examples/output/collection.md +44 -0
- package/see/examples/output/complex.md +61 -0
- package/see/examples/output/complex_matrix_stability.md +55 -0
- package/see/examples/output/composition_of_injective_functions_is_injective.md +62 -0
- package/see/examples/output/control_system.md +61 -0
- package/see/examples/output/crypto_builtins_tests.md +68 -0
- package/see/examples/output/delfour.md +100 -0
- package/see/examples/output/digital_product_passport.md +100 -0
- package/see/examples/output/dijkstra.md +74 -0
- package/see/examples/output/dijkstra_risk_path.md +76 -0
- package/see/examples/output/dog.md +50 -0
- package/see/examples/output/eco_route_insight.md +88 -0
- package/see/examples/output/equals.md +50 -0
- package/see/examples/output/equivalence_classes_overlap_implies_same_class.md +86 -0
- package/see/examples/output/euler_identity.md +73 -0
- package/see/examples/output/ev_roundtrip_planner.md +79 -0
- package/see/examples/output/existential_rule.md +54 -0
- package/see/examples/output/expression_eval.md +50 -0
- package/see/examples/output/family_cousins.md +187 -0
- package/see/examples/output/fastpow.md +36 -0
- package/see/examples/output/fibonacci.md +53 -0
- package/see/examples/output/french_cities.md +70 -0
- package/see/examples/output/fundamental_theorem_arithmetic.md +101 -0
- package/see/examples/output/genetic_knapsack_selection.md +66 -0
- package/see/examples/output/goldbach_1000.md +58 -0
- package/see/examples/output/good_cobbler.md +54 -0
- package/see/examples/output/gps.md +102 -0
- package/see/examples/output/gray_code_counter.md +68 -0
- package/see/examples/output/greatest_lower_bound_uniqueness.md +60 -0
- package/see/examples/output/group_inverse_uniqueness.md +60 -0
- package/see/examples/output/hadamard_approx.md +510 -0
- package/see/examples/output/hanoi.md +51 -0
- package/see/examples/output/odrl_dpv_risk_ranked.md +139 -0
- package/see/examples/output/path_discovery.md +65 -0
- package/see/examples/output/rc_discharge_envelope.md +102 -0
- package/see/examples/output/rdf_message_flow.md +198 -0
- package/see/examples/output/rdf_messages.md +134 -0
- package/see/examples/output/school_placement_audit.md +99 -0
- package/see/examples/output/smoke_arithmetic.md +54 -0
- package/see/examples/output/socrates.md +55 -0
- package/see/examples/output/wind_turbine.md +108 -0
- package/see/examples/output/witch.md +87 -0
- package/see/examples/path_discovery.js +1748 -0
- package/see/examples/rc_discharge_envelope.js +1967 -0
- package/see/examples/rdf_message_flow.js +2554 -0
- package/see/examples/rdf_messages.js +2150 -0
- package/see/examples/school_placement_audit.js +1841 -0
- package/see/examples/smoke_arithmetic.js +1457 -0
- package/see/examples/socrates.js +1394 -0
- package/see/examples/wind_turbine.js +2827 -0
- package/see/examples/witch.js +1493 -0
- package/see/see.js +1794 -0
- package/test/api.test.js +27 -0
- package/test/see.test.js +159 -0
- package/tools/n3gen.js +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Dijkstra Risk Path
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
selected path : ClinicA -> DepotB -> LabD -> HubZ
|
|
5
|
+
raw cost : 10.00
|
|
6
|
+
risk sum : 0.55
|
|
7
|
+
risk-adjusted score : 11.10
|
|
8
|
+
edges in selected path : 3
|
|
9
|
+
|
|
10
|
+
## Explanation
|
|
11
|
+
Each edge contributes its delivery cost plus the configured risk penalty. The N3 source enumerates the small graph's simple route candidates and compares the selected route against each alternative score. The selected route balances cost and risk through DepotB and LabD, while the apparently cheaper DepotC path is rejected once risk is priced in.
|
|
12
|
+
|
|
13
|
+
**Generated derivation support**
|
|
14
|
+
|
|
15
|
+
Compiled support: 21 source fact(s), 3 rule(s), fixpoint reached before rendering.
|
|
16
|
+
|
|
17
|
+
Derivation steps:
|
|
18
|
+
- Rule 1 (9 premise pattern(s) => 2 conclusion pattern(s)) derives :Case :selectedPath :pathB ., :Case :trustGate :noEnumeratedPathIsLower .
|
|
19
|
+
- Uses: :pathB :score 11.1 . _(source)_; :pathC :score 11.3 . _(source)_; :pathRelay :score 11.7 . _(source)_; :pathDirectC :score 11.6 . _(source)_; … +1 more premise fact(s)
|
|
20
|
+
- Rule 2 (7 premise pattern(s) => 1 conclusion pattern(s)) derives :Case :notes :riskCanOutweighRawCost .
|
|
21
|
+
- Uses: :pathViaC :rawCost 8 . _(source)_; :pathViaC :score 11.2 . _(source)_; :pathViaC :riskSum 1.6 . _(source)_; :pathB :rawCost 10 . _(source)_; … +1 more premise fact(s)
|
|
22
|
+
- Rule 3 (9 premise pattern(s) => 2 conclusion pattern(s)) derives :dijkstraRiskPath log:outputString "[authored report]" ., :dijkstraRiskPath :selects :pathB .
|
|
23
|
+
- Uses: :Case :selectedPath :pathB . _(derived)_; :Case :trustGate :noEnumeratedPathIsLower . _(derived)_; :Case :notes :riskCanOutweighRawCost . _(derived)_; :pathB :routeText "ClinicA -> DepotB -> LabD -> HubZ" . _(source)_; … +4 more premise fact(s)
|
|
24
|
+
|
|
25
|
+
Selected explanation support:
|
|
26
|
+
- :dijkstraRiskPath :selects :pathB . _(derived by Rule 3)_
|
|
27
|
+
- :Case :selectedPath :pathB . _(derived by Rule 1)_
|
|
28
|
+
- :pathB :score 11.1 . _(source)_
|
|
29
|
+
- :pathC :score 11.3 . _(source)_
|
|
30
|
+
- :pathRelay :score 11.7 . _(source)_
|
|
31
|
+
- :pathDirectC :score 11.6 . _(source)_
|
|
32
|
+
- ... 1 more premise fact(s)
|
|
33
|
+
- :Case :trustGate :noEnumeratedPathIsLower . _(derived by Rule 1)_
|
|
34
|
+
- :pathB :score 11.1 . _(source)_
|
|
35
|
+
- :pathC :score 11.3 . _(source)_
|
|
36
|
+
- :pathRelay :score 11.7 . _(source)_
|
|
37
|
+
- :pathDirectC :score 11.6 . _(source)_
|
|
38
|
+
- ... 1 more premise fact(s)
|
|
39
|
+
- :Case :notes :riskCanOutweighRawCost . _(derived by Rule 2)_
|
|
40
|
+
- :pathViaC :rawCost 8 . _(source)_
|
|
41
|
+
- :pathViaC :score 11.2 . _(source)_
|
|
42
|
+
- :pathViaC :riskSum 1.6 . _(source)_
|
|
43
|
+
- :pathB :rawCost 10 . _(source)_
|
|
44
|
+
- ... 1 more premise fact(s)
|
|
45
|
+
- :pathB :routeText "ClinicA -> DepotB -> LabD -> HubZ" . _(source)_
|
|
46
|
+
- ... 4 more premise fact(s)
|
|
47
|
+
|
|
48
|
+
## Formal TriG Output
|
|
49
|
+
|
|
50
|
+
```trig
|
|
51
|
+
@prefix : <https://eyereasoner.github.io/see/examples/dijkstra-risk-path#> .
|
|
52
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
53
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
54
|
+
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
|
|
55
|
+
@prefix see: <https://example.org/see#> .
|
|
56
|
+
@prefix in: <https://example.org/see/input#> .
|
|
57
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
58
|
+
|
|
59
|
+
:dijkstraRiskPath :selects :pathB .
|
|
60
|
+
|
|
61
|
+
in:metadata {
|
|
62
|
+
in:run a see:InputDataset .
|
|
63
|
+
in:run see:name "dijkstra_risk_path" .
|
|
64
|
+
in:run see:title "Dijkstra Risk Path" .
|
|
65
|
+
in:run see:sourceFile "examples/n3/dijkstra_risk_path.n3" .
|
|
66
|
+
in:run see:sourceSHA256 "a11f23a58252e557817c5d26cabdfee5ce8c5c08a40a54ab680eaa8960c88937" .
|
|
67
|
+
in:run see:description "N3-compiled version of the risk-adjusted route example. The original JSON\ninput is preserved as the data-input sidecar; this source compiles the\nexecutable derivation and report." .
|
|
68
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
69
|
+
in:run see:inputFacts 21 .
|
|
70
|
+
in:run see:compiledRules 3 .
|
|
71
|
+
in:run see:compiledBackwardRules 0 .
|
|
72
|
+
in:run see:compiledFuses 0 .
|
|
73
|
+
in:run see:compiledQueries 1 .
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Dog license example
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
The derivation produced 1 new fact(s) from 7 stated fact(s).
|
|
5
|
+
Main conclusion: **:alice :mustHave :dogLicense.**
|
|
6
|
+
|
|
7
|
+
Selected conclusions:
|
|
8
|
+
- :alice :mustHave :dogLicense .
|
|
9
|
+
|
|
10
|
+
## Explanation
|
|
11
|
+
Starts with 7 source fact(s), applies 1 rule(s), and reaches a fixpoint.
|
|
12
|
+
|
|
13
|
+
Derivation steps:
|
|
14
|
+
- Rule 1 (4 premise pattern(s) => 1 conclusion pattern(s)) derives :alice :mustHave :dogLicense .
|
|
15
|
+
- Uses: :alice :hasDog :dog1 . _(source)_
|
|
16
|
+
|
|
17
|
+
Selected explanation support:
|
|
18
|
+
- :alice :mustHave :dogLicense . _(derived by Rule 1)_
|
|
19
|
+
- :alice :hasDog :dog1 . _(source)_
|
|
20
|
+
|
|
21
|
+
The selected facts are serialized in the Formal TriG Output section.
|
|
22
|
+
|
|
23
|
+
## Formal TriG Output
|
|
24
|
+
|
|
25
|
+
```trig
|
|
26
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
27
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
28
|
+
@prefix : <https://eyereasoner.github.io/ns#> .
|
|
29
|
+
@prefix see: <https://example.org/see#> .
|
|
30
|
+
@prefix in: <https://example.org/see/input#> .
|
|
31
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
32
|
+
|
|
33
|
+
:alice :mustHave :dogLicense .
|
|
34
|
+
|
|
35
|
+
in:metadata {
|
|
36
|
+
in:run a see:InputDataset .
|
|
37
|
+
in:run see:name "dog" .
|
|
38
|
+
in:run see:title "Dog license example" .
|
|
39
|
+
in:run see:sourceFile "examples/n3/dog.n3" .
|
|
40
|
+
in:run see:sourceSHA256 "3487cceaf7e09eac16d9048cca2140bd1a474a2da0bf2091ffc0e0e5f87b3167" .
|
|
41
|
+
in:run see:description "If you have more than 4 dogs you need a license." .
|
|
42
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
43
|
+
in:run see:inputFacts 7 .
|
|
44
|
+
in:run see:compiledRules 1 .
|
|
45
|
+
in:run see:compiledBackwardRules 0 .
|
|
46
|
+
in:run see:compiledFuses 0 .
|
|
47
|
+
in:run see:compiledQueries 0 .
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Eco Route Insight
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
insight status : issue
|
|
5
|
+
show eco banner : yes
|
|
6
|
+
audience : Depot X
|
|
7
|
+
allowed use : ui.eco.banner
|
|
8
|
+
suggested route : alt-low-fuel
|
|
9
|
+
current fuel index : 120.75
|
|
10
|
+
suggested fuel index : 99.75
|
|
11
|
+
estimated saving : 21.00
|
|
12
|
+
expires at : 2025-01-01T11:00:00Z
|
|
13
|
+
raw data exported : no
|
|
14
|
+
signature algorithm : HMAC-SHA256
|
|
15
|
+
payload digest : 00e19becd91e81d6881749655d23d43002d9ea714bba61e855eafbc8ef9a5135
|
|
16
|
+
signature key : local-demo-key
|
|
17
|
+
signature : 7fFGBN8fyI7xrmRz5VreeAUSf3LC_ywbj32NGk2ovUs
|
|
18
|
+
|
|
19
|
+
## Explanation
|
|
20
|
+
The current route uses fuel index = distanceKm × (payloadKg / 1000) × gradientFactor. For shipment-1, Current urban route gives 42.00 × 2.50 × 1.15 = 120.75. The policy threshold is 120.00, so a local eco banner is justified. The selected alternative alt-low-fuel gives 38.00 × 2.50 × 1.05 = 99.75, saving 21.00 while staying within the ETA delay limit. The signed envelope exposes audience, use, expiry, route suggestion, and compact fuel indices, but not raw payload, GPS trace, driver behavior, or raw telemetry.
|
|
21
|
+
|
|
22
|
+
**Generated derivation support**
|
|
23
|
+
|
|
24
|
+
Compiled support: 33 source fact(s), 2 rule(s), fixpoint reached before rendering.
|
|
25
|
+
|
|
26
|
+
Derivation steps:
|
|
27
|
+
- Rule 1 (11 premise pattern(s) => 4 conclusion pattern(s)) derives :Insight :status "issue" ., :Insight :showEcoBanner "yes" ., :Insight :suggestedRoute :altLowFuel ., :Insight :estimatedSaving 21 .
|
|
28
|
+
- Uses: :currentRoute :fuelIndex 120.75 . _(source)_; :currentRoute :etaMinutes 64 . _(source)_; :altLowFuel :fuelIndex 99.75 . _(source)_; :altLowFuel :etaMinutes 66 . _(source)_; … +2 more premise fact(s)
|
|
29
|
+
- Rule 2 (23 premise pattern(s) => 2 conclusion pattern(s)) derives :ecoRouteInsight log:outputString "[authored report]" ., :ecoRouteInsight :issues :Insight .
|
|
30
|
+
- Uses: :Insight :status "issue" . _(derived)_; :Insight :showEcoBanner "yes" . _(derived)_; :Insight :suggestedRoute :altLowFuel . _(derived)_; :Insight :estimatedSaving 21 . _(derived)_; … +18 more premise fact(s)
|
|
31
|
+
|
|
32
|
+
Selected explanation support:
|
|
33
|
+
- :ecoRouteInsight :issues :Insight . _(derived by Rule 2)_
|
|
34
|
+
- :Insight :status "issue" . _(derived by Rule 1)_
|
|
35
|
+
- :currentRoute :fuelIndex 120.75 . _(source)_
|
|
36
|
+
- :currentRoute :etaMinutes 64 . _(source)_
|
|
37
|
+
- :altLowFuel :fuelIndex 99.75 . _(source)_
|
|
38
|
+
- :altLowFuel :etaMinutes 66 . _(source)_
|
|
39
|
+
- ... 2 more premise fact(s)
|
|
40
|
+
- :Insight :showEcoBanner "yes" . _(derived by Rule 1)_
|
|
41
|
+
- :currentRoute :fuelIndex 120.75 . _(source)_
|
|
42
|
+
- :currentRoute :etaMinutes 64 . _(source)_
|
|
43
|
+
- :altLowFuel :fuelIndex 99.75 . _(source)_
|
|
44
|
+
- :altLowFuel :etaMinutes 66 . _(source)_
|
|
45
|
+
- ... 2 more premise fact(s)
|
|
46
|
+
- :Insight :suggestedRoute :altLowFuel . _(derived by Rule 1)_
|
|
47
|
+
- :currentRoute :fuelIndex 120.75 . _(source)_
|
|
48
|
+
- :currentRoute :etaMinutes 64 . _(source)_
|
|
49
|
+
- :altLowFuel :fuelIndex 99.75 . _(source)_
|
|
50
|
+
- :altLowFuel :etaMinutes 66 . _(source)_
|
|
51
|
+
- ... 2 more premise fact(s)
|
|
52
|
+
- :Insight :estimatedSaving 21 . _(derived by Rule 1)_
|
|
53
|
+
- :currentRoute :fuelIndex 120.75 . _(source)_
|
|
54
|
+
- :currentRoute :etaMinutes 64 . _(source)_
|
|
55
|
+
- :altLowFuel :fuelIndex 99.75 . _(source)_
|
|
56
|
+
- :altLowFuel :etaMinutes 66 . _(source)_
|
|
57
|
+
- ... 2 more premise fact(s)
|
|
58
|
+
- ... 18 more premise fact(s)
|
|
59
|
+
|
|
60
|
+
## Formal TriG Output
|
|
61
|
+
|
|
62
|
+
```trig
|
|
63
|
+
@prefix : <https://eyereasoner.github.io/see/examples/eco-route-insight#> .
|
|
64
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
65
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
66
|
+
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
|
|
67
|
+
@prefix see: <https://example.org/see#> .
|
|
68
|
+
@prefix in: <https://example.org/see/input#> .
|
|
69
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
70
|
+
|
|
71
|
+
:ecoRouteInsight :issues :Insight .
|
|
72
|
+
|
|
73
|
+
in:metadata {
|
|
74
|
+
in:run a see:InputDataset .
|
|
75
|
+
in:run see:name "eco_route_insight" .
|
|
76
|
+
in:run see:title "Eco Route Insight" .
|
|
77
|
+
in:run see:sourceFile "examples/n3/eco_route_insight.n3" .
|
|
78
|
+
in:run see:sourceSHA256 "b5af0caa2e473b5957ba8cec647ee4e2edf4cdc2a5c28110e8536c19381b0bd3" .
|
|
79
|
+
in:run see:description "N3-compiled version of the privacy-preserving eco route insight. The JSON\ninput remains the data-input sidecar; this source compiles the local decision\nand signed-envelope explanation." .
|
|
80
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
81
|
+
in:run see:inputFacts 33 .
|
|
82
|
+
in:run see:compiledRules 2 .
|
|
83
|
+
in:run see:compiledBackwardRules 0 .
|
|
84
|
+
in:run see:compiledFuses 0 .
|
|
85
|
+
in:run see:compiledQueries 1 .
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Equals test
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
The derivation produced 1 new fact(s) from 1 stated fact(s).
|
|
5
|
+
Main conclusion: **:test is true.**
|
|
6
|
+
|
|
7
|
+
Selected conclusions:
|
|
8
|
+
- :test :is true .
|
|
9
|
+
|
|
10
|
+
## Explanation
|
|
11
|
+
Starts with 1 source fact(s), applies 1 rule(s), and reaches a fixpoint.
|
|
12
|
+
|
|
13
|
+
Derivation steps:
|
|
14
|
+
- Rule 1: :X owl:sameAs :Y => :test :is true derives :test :is true .
|
|
15
|
+
- Uses: :X owl:sameAs :Y . _(source)_
|
|
16
|
+
|
|
17
|
+
Selected explanation support:
|
|
18
|
+
- :test :is true . _(derived by Rule 1)_
|
|
19
|
+
- :X owl:sameAs :Y . _(source)_
|
|
20
|
+
|
|
21
|
+
The selected facts are serialized in the Formal TriG Output section.
|
|
22
|
+
|
|
23
|
+
## Formal TriG Output
|
|
24
|
+
|
|
25
|
+
```trig
|
|
26
|
+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
27
|
+
@prefix : <http://example.org/socrates#> .
|
|
28
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
29
|
+
@prefix see: <https://example.org/see#> .
|
|
30
|
+
@prefix in: <https://example.org/see/input#> .
|
|
31
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
32
|
+
|
|
33
|
+
:test :is true .
|
|
34
|
+
|
|
35
|
+
in:metadata {
|
|
36
|
+
in:run a see:InputDataset .
|
|
37
|
+
in:run see:name "equals" .
|
|
38
|
+
in:run see:title "Equals test" .
|
|
39
|
+
in:run see:sourceFile "examples/n3/equals.n3" .
|
|
40
|
+
in:run see:sourceSHA256 "29dfd303c09b0b2f05c637d6a56b6e3b198053a0732aa179ca3e75265dfb8003" .
|
|
41
|
+
in:run see:description "Example from Patrick Hochstenbach" .
|
|
42
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
43
|
+
in:run see:inputFacts 1 .
|
|
44
|
+
in:run see:compiledRules 1 .
|
|
45
|
+
in:run see:compiledBackwardRules 0 .
|
|
46
|
+
in:run see:compiledFuses 0 .
|
|
47
|
+
in:run see:compiledQueries 0 .
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# If two equivalence classes share an element, they are the same class.
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
The compiled query selected 18 fact(s) after the rule closure was computed.
|
|
5
|
+
Main conclusion: **:result :sameClassBecauseOfSharedMember (:a :b :c).**
|
|
6
|
+
|
|
7
|
+
Selected conclusions:
|
|
8
|
+
- :result :sameClassBecauseOfSharedMember (:a :b :c) .
|
|
9
|
+
- :result :sameClassBecauseOfSharedMember (:a :c :c) .
|
|
10
|
+
- :result :sameClassBecauseOfSharedMember (:c :b :a) .
|
|
11
|
+
- :result :sameClassBecauseOfSharedMember (:c :a :a) .
|
|
12
|
+
- :result :sameClassBecauseOfSharedMember (:b :a :c) .
|
|
13
|
+
- :result :sameClassBecauseOfSharedMember (:b :c :c) .
|
|
14
|
+
|
|
15
|
+
## Explanation
|
|
16
|
+
Starts with 5 source fact(s), applies 7 rule(s), and reaches a fixpoint.
|
|
17
|
+
The log:query projection then keeps only the matching fact(s) shown above.
|
|
18
|
+
|
|
19
|
+
Derivation steps:
|
|
20
|
+
- Rule 1: ?x :inX true => ?x :sim ?x derives :a :sim :a ., :b :sim :b ., :c :sim :c .
|
|
21
|
+
- Uses: :a :inX true . _(source)_; :b :inX true . _(source)_; :c :inX true . _(source)_
|
|
22
|
+
- Rule 2: ?x :sim ?y => ?y :sim ?x derives :a :sim :b ., :c :sim :b .
|
|
23
|
+
- Uses: :b :sim :a . _(source)_; :b :sim :c . _(source)_
|
|
24
|
+
- Rule 3: ?x :sim ?y; ?y :sim ?z => ?x :sim ?z derives :a :sim :c ., :c :sim :a .
|
|
25
|
+
- Uses: :a :sim :b . _(derived)_; :b :sim :c . _(source)_; :c :sim :b . _(derived)_; :b :sim :a . _(source)_
|
|
26
|
+
- Rule 4: ?u :sim ?x => ?u :inClassOf ?x derives :b :inClassOf :a ., :b :inClassOf :c ., :a :inClassOf :a ., :b :inClassOf :b ., … +5 more
|
|
27
|
+
- Uses: :b :sim :a . _(source)_; :b :sim :c . _(source)_; :a :sim :a . _(derived)_; :b :sim :b . _(derived)_; … +5 more premise fact(s)
|
|
28
|
+
- Rule 5: ?x :sim ?y => (?x ?y) :sameClass true derives (:b :a) :sameClass true ., (:b :c) :sameClass true ., (:a :a) :sameClass true ., (:b :b) :sameClass true ., … +5 more
|
|
29
|
+
- Uses: :b :sim :a . _(source)_; :b :sim :c . _(source)_; :a :sim :a . _(derived)_; :b :sim :b . _(derived)_; … +5 more premise fact(s)
|
|
30
|
+
- Rule 7 (3 premise pattern(s) => 1 conclusion pattern(s)) derives (:a :a :b) :sharedMemberShowsSameClass true ., (:a :c :b) :sharedMemberShowsSameClass true ., (:a :b :b) :sharedMemberShowsSameClass true ., (:c :a :b) :sharedMemberShowsSameClass true ., … +23 more
|
|
31
|
+
- Uses: :b :inClassOf :a . _(derived)_; (:a :a) :sameClass true . _(derived)_; :b :inClassOf :c . _(derived)_; (:a :c) :sameClass true . _(derived)_; … +14 more premise fact(s)
|
|
32
|
+
|
|
33
|
+
Selected explanation support:
|
|
34
|
+
- :result :sameClassBecauseOfSharedMember (:a :b :c) . _(no recorded rule support)_
|
|
35
|
+
- :result :sameClassBecauseOfSharedMember (:a :c :c) . _(no recorded rule support)_
|
|
36
|
+
- :result :sameClassBecauseOfSharedMember (:c :b :a) . _(no recorded rule support)_
|
|
37
|
+
- :result :sameClassBecauseOfSharedMember (:c :a :a) . _(no recorded rule support)_
|
|
38
|
+
- :result :sameClassBecauseOfSharedMember (:b :a :c) . _(no recorded rule support)_
|
|
39
|
+
- :result :sameClassBecauseOfSharedMember (:b :c :c) . _(no recorded rule support)_
|
|
40
|
+
|
|
41
|
+
The query-selected facts are serialized in the Formal TriG Output section.
|
|
42
|
+
|
|
43
|
+
## Formal TriG Output
|
|
44
|
+
|
|
45
|
+
```trig
|
|
46
|
+
@prefix : <https://eyereasoner.github.io/eye/reasoning#> .
|
|
47
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
48
|
+
@prefix see: <https://example.org/see#> .
|
|
49
|
+
@prefix in: <https://example.org/see/input#> .
|
|
50
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
51
|
+
|
|
52
|
+
:result :sameClassBecauseOfSharedMember (:a :c :b) .
|
|
53
|
+
:result :sameClassBecauseOfSharedMember (:a :b :b) .
|
|
54
|
+
:result :sameClassBecauseOfSharedMember (:c :a :b) .
|
|
55
|
+
:result :sameClassBecauseOfSharedMember (:c :b :b) .
|
|
56
|
+
:result :sameClassBecauseOfSharedMember (:a :b :a) .
|
|
57
|
+
:result :sameClassBecauseOfSharedMember (:a :c :a) .
|
|
58
|
+
:result :sameClassBecauseOfSharedMember (:b :a :b) .
|
|
59
|
+
:result :sameClassBecauseOfSharedMember (:b :c :b) .
|
|
60
|
+
:result :sameClassBecauseOfSharedMember (:c :b :c) .
|
|
61
|
+
:result :sameClassBecauseOfSharedMember (:c :a :c) .
|
|
62
|
+
:result :sameClassBecauseOfSharedMember (:b :a :a) .
|
|
63
|
+
:result :sameClassBecauseOfSharedMember (:b :c :a) .
|
|
64
|
+
:result :sameClassBecauseOfSharedMember (:b :c :c) .
|
|
65
|
+
:result :sameClassBecauseOfSharedMember (:b :a :c) .
|
|
66
|
+
:result :sameClassBecauseOfSharedMember (:c :a :a) .
|
|
67
|
+
:result :sameClassBecauseOfSharedMember (:c :b :a) .
|
|
68
|
+
:result :sameClassBecauseOfSharedMember (:a :c :c) .
|
|
69
|
+
:result :sameClassBecauseOfSharedMember (:a :b :c) .
|
|
70
|
+
|
|
71
|
+
in:metadata {
|
|
72
|
+
in:run a see:InputDataset .
|
|
73
|
+
in:run see:name "equivalence_classes_overlap_implies_same_class" .
|
|
74
|
+
in:run see:title "If two equivalence classes share an element, they are the same class." .
|
|
75
|
+
in:run see:sourceFile "examples/n3/equivalence_classes_overlap_implies_same_class.n3" .
|
|
76
|
+
in:run see:sourceSHA256 "b36ed917f7af601a38f6a1657ce4956a4e38484573c40d0a963e3008cbb46f5f" .
|
|
77
|
+
in:run see:description "" .
|
|
78
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
79
|
+
in:run see:inputFacts 5 .
|
|
80
|
+
in:run see:compiledRules 7 .
|
|
81
|
+
in:run see:compiledBackwardRules 0 .
|
|
82
|
+
in:run see:compiledFuses 0 .
|
|
83
|
+
in:run see:compiledQueries 1 .
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Euler identity (exact, certificate-friendly):
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
The compiled query selected 6 fact(s) after the rule closure was computed.
|
|
5
|
+
Main conclusion: **:result :identityHolds true.**
|
|
6
|
+
|
|
7
|
+
Selected conclusions:
|
|
8
|
+
- :result :identityHolds true .
|
|
9
|
+
- :result :phaseModSqIsOne true .
|
|
10
|
+
- :result :phaseModSq 1 .
|
|
11
|
+
- :result :rhsZero (0 0) .
|
|
12
|
+
- :result :lhsPlusOne (0 0) .
|
|
13
|
+
- :result :phasePi (-1 0) .
|
|
14
|
+
|
|
15
|
+
## Explanation
|
|
16
|
+
Starts with 10 source fact(s), applies 5 rule(s), and reaches a fixpoint.
|
|
17
|
+
The log:query projection then keeps only the matching fact(s) shown above.
|
|
18
|
+
|
|
19
|
+
Derivation steps:
|
|
20
|
+
- Rule 1: (0 1) math:difference ?minusOne => :phasePi :exact (?minusOne 0) derives :phasePi :exact (-1 0) .
|
|
21
|
+
- Uses: no graph premises; built-ins/constants satisfied the rule.
|
|
22
|
+
- Rule 2 (4 premise pattern(s) => 2 conclusion pattern(s)) derives :EulerIdentity :lhsExact (0 0) ., :EulerIdentity :rhsExact (0 0) .
|
|
23
|
+
- Uses: :phasePi :exact (-1 0) . _(derived)_; :one :exact (1 0) . _(source)_
|
|
24
|
+
- Rule 3: :EulerIdentity :lhsExact (?sumRe ?sumIm); :zero :exact (?sumRe ?sumIm) => :EulerIdentity :holds true derives :EulerIdentity :holds true .
|
|
25
|
+
- Uses: :EulerIdentity :lhsExact (0 0) . _(derived)_; :zero :exact (0 0) . _(source)_
|
|
26
|
+
- Rule 4 (4 premise pattern(s) => 1 conclusion pattern(s)) derives :phasePi :modSq 1 .
|
|
27
|
+
- Uses: :phasePi :exact (-1 0) . _(derived)_
|
|
28
|
+
- Rule 5: :phasePi :modSq ?modSq; ?modSq math:equalTo 1 => :phasePi :modSqIsOne true derives :phasePi :modSqIsOne true .
|
|
29
|
+
- Uses: :phasePi :modSq 1 . _(derived)_
|
|
30
|
+
|
|
31
|
+
Selected explanation support:
|
|
32
|
+
- :result :identityHolds true . _(no recorded rule support)_
|
|
33
|
+
- :result :phaseModSqIsOne true . _(no recorded rule support)_
|
|
34
|
+
- :result :phaseModSq 1 . _(no recorded rule support)_
|
|
35
|
+
- :result :rhsZero (0 0) . _(no recorded rule support)_
|
|
36
|
+
- :result :lhsPlusOne (0 0) . _(no recorded rule support)_
|
|
37
|
+
- :result :phasePi (-1 0) . _(no recorded rule support)_
|
|
38
|
+
|
|
39
|
+
The query-selected facts are serialized in the Formal TriG Output section.
|
|
40
|
+
|
|
41
|
+
## Formal TriG Output
|
|
42
|
+
|
|
43
|
+
```trig
|
|
44
|
+
@prefix : <https://eyereasoner.github.io/see/examples/euler-identity#> .
|
|
45
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
46
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
47
|
+
@prefix see: <https://example.org/see#> .
|
|
48
|
+
@prefix in: <https://example.org/see/input#> .
|
|
49
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
50
|
+
|
|
51
|
+
:result :phasePi (-1 0) .
|
|
52
|
+
:result :lhsPlusOne (0 0) .
|
|
53
|
+
:result :rhsZero (0 0) .
|
|
54
|
+
:result :phaseModSq 1 .
|
|
55
|
+
:result :phaseModSqIsOne true .
|
|
56
|
+
:result :identityHolds true .
|
|
57
|
+
|
|
58
|
+
in:metadata {
|
|
59
|
+
in:run a see:InputDataset .
|
|
60
|
+
in:run see:name "euler_identity" .
|
|
61
|
+
in:run see:title "Euler identity (exact, certificate-friendly):" .
|
|
62
|
+
in:run see:sourceFile "examples/n3/euler_identity.n3" .
|
|
63
|
+
in:run see:sourceSHA256 "8a0467bd923b3774627c99aa4cc9fe34baaa0bbaff1847399cd025d24b39c17a" .
|
|
64
|
+
in:run see:description "exp(i*pi) + 1 = 0\nPhilosophy:\nUnlike the T-gate example, this phase needs no approximation. exp(i*pi) lands exactly at\n(-1,0) = cos(pi) + i sin(pi), so the identity can be certified using integer arithmetic\nalone.\nMethod:\n1) Construct -1 as 0 - 1.\n2) Represent exp(i*pi) exactly as (-1, 0).\n3) Add 1 componentwise to obtain (0, 0).\n4) Sanity validation the phase modulus: |-1 + 0i|^2 = 1.\n5) Project only the intended certificates via log:query." .
|
|
65
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
66
|
+
in:run see:inputFacts 10 .
|
|
67
|
+
in:run see:compiledRules 5 .
|
|
68
|
+
in:run see:compiledBackwardRules 0 .
|
|
69
|
+
in:run see:compiledFuses 0 .
|
|
70
|
+
in:run see:compiledQueries 1 .
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# EV Roadtrip Planner
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
Select plan : drive_bru_liege -> drive_liege_aachen -> shuttle_aachen_cologne.
|
|
5
|
+
route result : Cologne battery=low pass=none
|
|
6
|
+
duration : 210.0 minutes
|
|
7
|
+
cost : 0.054
|
|
8
|
+
belief : 0.974175
|
|
9
|
+
comfort : 0.898320
|
|
10
|
+
acceptable plans : 8
|
|
11
|
+
fuel remaining : 5 of 8
|
|
12
|
+
|
|
13
|
+
## Explanation
|
|
14
|
+
The planner starts with car1 at Brussels, battery=high, pass=none, then composes action descriptions until the goal city Cologne is reached. Duration and cost are summed across each candidate; belief and comfort are multiplied, matching the N3 planner pattern. The selected plan is the fastest acceptable candidate under belief > 0.93, cost < 0.090, and duration < 260.0. It uses the shuttle from Aachen to Cologne, avoiding an extra charge stop while keeping belief at 0.974175.
|
|
15
|
+
|
|
16
|
+
Top acceptable plans:
|
|
17
|
+
1. drive_bru_liege -> drive_liege_aachen -> shuttle_aachen_cologne | duration=210.0 cost=0.054 belief=0.974175 comfort=0.898320 final=Cologne/low/none
|
|
18
|
+
2. buy_pass_brussels -> drive_bru_liege -> drive_liege_aachen -> shuttle_aachen_cologne | duration=220.0 cost=0.058 belief=0.973201 comfort=0.889337 final=Cologne/low/yes
|
|
19
|
+
3. buy_pass_brussels -> drive_bru_liege -> drive_liege_aachen -> fast_charge_aachen_pass -> premium_corridor_aachen_cologne | duration=220.0 cost=0.063 belief=0.953737 comfort=0.880398 final=Cologne/low/yes
|
|
20
|
+
4. drive_bru_liege -> buy_pass_liege -> drive_liege_aachen -> shuttle_aachen_cologne | duration=225.0 cost=0.057 belief=0.969304 comfort=0.880354 final=Cologne/low/yes
|
|
21
|
+
5. drive_bru_liege -> buy_pass_liege -> drive_liege_aachen -> fast_charge_aachen_pass -> premium_corridor_aachen_cologne | duration=225.0 cost=0.062 belief=0.949918 comfort=0.871505 final=Cologne/low/yes
|
|
22
|
+
|
|
23
|
+
**Generated derivation support**
|
|
24
|
+
|
|
25
|
+
Compiled support: 64 source fact(s), 3 rule(s), fixpoint reached before rendering.
|
|
26
|
+
|
|
27
|
+
Derivation steps:
|
|
28
|
+
- Rule 1 (10 premise pattern(s) => 1 conclusion pattern(s)) derives :plan1 gps:acceptable true ., :plan2 gps:acceptable true ., :plan3 gps:acceptable true ., :plan4 gps:acceptable true ., … +1 more
|
|
29
|
+
- Uses: :plan1 rdf:type gps:Plan . _(source)_; :plan1 gps:duration 210 . _(source)_; :plan1 gps:cost 0.054 . _(source)_; :plan1 gps:belief 0.974175 . _(source)_; … +19 more premise fact(s)
|
|
30
|
+
- Rule 2: :plan1 gps:acceptable true; :plan1 gps:rank 1 => :PlanSet :selected :plan1 derives :PlanSet :selected :plan1 .
|
|
31
|
+
- Uses: :plan1 gps:acceptable true . _(derived)_; :plan1 gps:rank 1 . _(source)_
|
|
32
|
+
- Rule 4 (45 premise pattern(s) => 2 conclusion pattern(s)) derives :evRoadtripPlanner log:outputString "[authored report]" ., :evRoadtripPlanner :selects :plan1 .
|
|
33
|
+
- Uses: :PlanSet :selected :plan1 . _(derived)_; :PlanSet :acceptableCount 8 . _(source)_; :PlanSet :fuelBudget 8 . _(source)_; :plan1 gps:actions "drive_bru_liege -> drive_liege_aachen -> shuttle_aachen_cologne" . _(source)_; … +40 more premise fact(s)
|
|
34
|
+
|
|
35
|
+
Selected explanation support:
|
|
36
|
+
- :evRoadtripPlanner :selects :plan1 . _(derived by Rule 4)_
|
|
37
|
+
- :PlanSet :selected :plan1 . _(derived by Rule 2)_
|
|
38
|
+
- :plan1 gps:acceptable true . _(derived by Rule 1)_
|
|
39
|
+
- :plan1 rdf:type gps:Plan . _(source)_
|
|
40
|
+
- :plan1 gps:duration 210 . _(source)_
|
|
41
|
+
- :plan1 gps:cost 0.054 . _(source)_
|
|
42
|
+
- :plan1 gps:belief 0.974175 . _(source)_
|
|
43
|
+
- ... 3 more premise fact(s)
|
|
44
|
+
- :plan1 gps:rank 1 . _(source)_
|
|
45
|
+
- :PlanSet :acceptableCount 8 . _(source)_
|
|
46
|
+
- :PlanSet :fuelBudget 8 . _(source)_
|
|
47
|
+
- :plan1 gps:actions "drive_bru_liege -> drive_liege_aachen -> shuttle_aachen_cologne" . _(source)_
|
|
48
|
+
- ... 40 more premise fact(s)
|
|
49
|
+
|
|
50
|
+
## Formal TriG Output
|
|
51
|
+
|
|
52
|
+
```trig
|
|
53
|
+
@prefix : <https://eyereasoner.github.io/see/examples/ev-roundtrip-planner#> .
|
|
54
|
+
@prefix gps: <https://eyereasoner.github.io/see/examples/gps#> .
|
|
55
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
56
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
57
|
+
@prefix string: <http://www.w3.org/2000/10/swap/string#> .
|
|
58
|
+
@prefix see: <https://example.org/see#> .
|
|
59
|
+
@prefix in: <https://example.org/see/input#> .
|
|
60
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
61
|
+
|
|
62
|
+
:evRoadtripPlanner :selects :plan1 .
|
|
63
|
+
|
|
64
|
+
in:metadata {
|
|
65
|
+
in:run a see:InputDataset .
|
|
66
|
+
in:run see:name "ev_roundtrip_planner" .
|
|
67
|
+
in:run see:title "EV Roadtrip Planner" .
|
|
68
|
+
in:run see:sourceFile "examples/n3/ev_roundtrip_planner.n3" .
|
|
69
|
+
in:run see:sourceSHA256 "0adbefa76f008fdb320ee926631bf5e997a8c3b8b7159ec8c3c9111db3437c65" .
|
|
70
|
+
in:run see:description "N3-compiled version of the hand-written EV roadtrip planner. Candidate plans\nare represented as data; rules apply the same acceptance thresholds and select\nthe fastest acceptable route." .
|
|
71
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
72
|
+
in:run see:inputFacts 64 .
|
|
73
|
+
in:run see:compiledRules 3 .
|
|
74
|
+
in:run see:compiledBackwardRules 0 .
|
|
75
|
+
in:run see:compiledFuses 1 .
|
|
76
|
+
in:run see:compiledQueries 1 .
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Existential rule
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
The derivation produced 2 new fact(s) from 2 stated fact(s).
|
|
5
|
+
Main conclusion: **:Plato is _:B.**
|
|
6
|
+
|
|
7
|
+
Selected conclusions:
|
|
8
|
+
- :Plato :is _:B .
|
|
9
|
+
- :Socrates :is _:B .
|
|
10
|
+
|
|
11
|
+
## Explanation
|
|
12
|
+
Starts with 2 source fact(s), applies 1 rule(s), and reaches a fixpoint.
|
|
13
|
+
|
|
14
|
+
Derivation steps:
|
|
15
|
+
- Rule 1: ?S rdf:type :Human => ?S :is _:B derives :Socrates :is _:B ., :Plato :is _:B .
|
|
16
|
+
- Uses: :Socrates rdf:type :Human . _(source)_; :Plato rdf:type :Human . _(source)_
|
|
17
|
+
|
|
18
|
+
Selected explanation support:
|
|
19
|
+
- :Plato :is _:B . _(derived by Rule 1)_
|
|
20
|
+
- :Plato rdf:type :Human . _(source)_
|
|
21
|
+
- :Socrates :is _:B . _(derived by Rule 1)_
|
|
22
|
+
- :Socrates rdf:type :Human . _(source)_
|
|
23
|
+
|
|
24
|
+
The selected facts are serialized in the Formal TriG Output section.
|
|
25
|
+
|
|
26
|
+
## Formal TriG Output
|
|
27
|
+
|
|
28
|
+
```trig
|
|
29
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
30
|
+
@prefix : <https://eyereasoner.github.io/eye/reasoning#> .
|
|
31
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
32
|
+
@prefix see: <https://example.org/see#> .
|
|
33
|
+
@prefix in: <https://example.org/see/input#> .
|
|
34
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
35
|
+
|
|
36
|
+
:Socrates :is _:B .
|
|
37
|
+
:Plato :is _:B .
|
|
38
|
+
|
|
39
|
+
in:metadata {
|
|
40
|
+
in:run a see:InputDataset .
|
|
41
|
+
in:run see:name "existential_rule" .
|
|
42
|
+
in:run see:title "Existential rule" .
|
|
43
|
+
in:run see:sourceFile "examples/n3/existential_rule.n3" .
|
|
44
|
+
in:run see:sourceSHA256 "f47b48d679b4bf2149782d40e01abb6f0d72cbbd0582bd7ab8a0ed2046f991f7" .
|
|
45
|
+
in:run see:description "" .
|
|
46
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
47
|
+
in:run see:inputFacts 2 .
|
|
48
|
+
in:run see:compiledRules 1 .
|
|
49
|
+
in:run see:compiledBackwardRules 0 .
|
|
50
|
+
in:run see:compiledFuses 0 .
|
|
51
|
+
in:run see:compiledQueries 0 .
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# A tiny expression evaluator in N3
|
|
2
|
+
|
|
3
|
+
## Insight
|
|
4
|
+
The derivation produced 1 new fact(s) from 17 stated fact(s).
|
|
5
|
+
Main conclusion: **:Root :result 12.**
|
|
6
|
+
|
|
7
|
+
Selected conclusions:
|
|
8
|
+
- :Root :result 12 .
|
|
9
|
+
|
|
10
|
+
## Explanation
|
|
11
|
+
Starts with 17 source fact(s), applies 5 rule(s), and reaches a fixpoint.
|
|
12
|
+
|
|
13
|
+
Derivation steps:
|
|
14
|
+
- Rule 5: :Root :expr ?E; ?E :value ?V => :Root :result ?V derives :Root :result 12 .
|
|
15
|
+
- Uses: :Root :expr :eAdd . _(source)_
|
|
16
|
+
|
|
17
|
+
Selected explanation support:
|
|
18
|
+
- :Root :result 12 . _(derived by Rule 5)_
|
|
19
|
+
- :Root :expr :eAdd . _(source)_
|
|
20
|
+
|
|
21
|
+
The selected facts are serialized in the Formal TriG Output section.
|
|
22
|
+
|
|
23
|
+
## Formal TriG Output
|
|
24
|
+
|
|
25
|
+
```trig
|
|
26
|
+
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
|
|
27
|
+
@prefix : <https://eyereasoner.github.io/eye/reasoning#> .
|
|
28
|
+
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
|
|
29
|
+
@prefix see: <https://example.org/see#> .
|
|
30
|
+
@prefix in: <https://example.org/see/input#> .
|
|
31
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
32
|
+
|
|
33
|
+
:Root :result 12 .
|
|
34
|
+
|
|
35
|
+
in:metadata {
|
|
36
|
+
in:run a see:InputDataset .
|
|
37
|
+
in:run see:name "expression_eval" .
|
|
38
|
+
in:run see:title "A tiny expression evaluator in N3" .
|
|
39
|
+
in:run see:sourceFile "examples/n3/expression_eval.n3" .
|
|
40
|
+
in:run see:sourceSHA256 "8b33d5122b55a40c19af6d1504d29871bcd864dce595d6824acd4515d76e360c" .
|
|
41
|
+
in:run see:description "" .
|
|
42
|
+
in:run see:compiler "see.js N3-to-JS compiler" .
|
|
43
|
+
in:run see:inputFacts 17 .
|
|
44
|
+
in:run see:compiledRules 1 .
|
|
45
|
+
in:run see:compiledBackwardRules 4 .
|
|
46
|
+
in:run see:compiledFuses 0 .
|
|
47
|
+
in:run see:compiledQueries 0 .
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|