eyeling 1.16.4 → 1.17.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.
@@ -1,78 +1,208 @@
1
- # =====================================================================
2
- # Easter Date
3
- # Calculation of easter dates.
4
- # original copy at http://www.w3.org/2000/10/swap/test/easter/easter.n3
5
- # =====================================================================
6
-
7
- @prefix math: <http://www.w3.org/2000/10/swap/math#>.
8
- @prefix log: <http://www.w3.org/2000/10/swap/log#>.
9
- @prefix string: <http://www.w3.org/2000/10/swap/string#>.
10
- @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
11
- @prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
12
- @prefix prolog: <http://eulersharp.sourceforge.net/2003/03swap/prolog#>.
13
- @prefix : <http://www.agfa.com/w3c/euler/easterP#>.
14
-
15
- <> rdfs:comment """
16
- Divide by Quotient Remainder
17
- ---------------------------------------------------
18
- y 19 j
19
- y 100 k h
20
- k 4 m n
21
- k + 8 25 p
22
- k - p + 1 3 q
23
- 19j + k - m - q + 15 30 r
24
- h 4 s u
25
- 32 + 2n + 2s - r - u 7 v
26
- j + 11r + 22v 451 w
27
- r + v - 7w + 114 31 x z
28
-
29
- Here x is the number of the month ond 1 + z is the day of that
30
- month upon which Easter Sunday falls in the year y.
31
- """.
32
-
33
- 2021 a :Year.
34
- 2022 a :Year.
35
- 2023 a :Year.
36
- 2024 a :Year.
37
- 2025 a :Year.
38
- 2026 a :Year.
39
- 2027 a :Year.
40
- 2028 a :Year.
41
- 2029 a :Year.
42
- 2030 a :Year.
43
- 2031 a :Year.
44
- 2032 a :Year.
45
- 2033 a :Year.
46
- 2034 a :Year.
47
- 2035 a :Year.
48
- 2036 a :Year.
49
- 2037 a :Year.
50
- 2038 a :Year.
51
- 2039 a :Year.
52
- 2040 a :Year.
53
- 2041 a :Year.
54
- 2042 a :Year.
55
- 2043 a :Year.
56
- 2044 a :Year.
57
- 2045 a :Year.
58
- 2046 a :Year.
59
- 2047 a :Year.
60
- 2048 a :Year.
61
- 2049 a :Year.
62
- 2050 a :Year.
63
-
64
- { ?Y a :Year.
65
- (?Y 19) math:remainder ?J.
66
- (?Y 100) math:integerQuotient ?K; math:remainder ?H.
67
- (?K 4) math:integerQuotient ?M; math:remainder ?N.
68
- ((?K 8)!math:sum 25) math:integerQuotient ?P.
69
- (((?K ?P)!math:difference 1)!math:sum 3) math:integerQuotient ?Q.
70
- ((((((19 ?J)!math:product ?K)!math:sum ?M)!math:difference ?Q)!math:difference 15)!math:sum 30) math:remainder ?R.
71
- (?H 4) math:integerQuotient ?S; math:remainder ?U.
72
- ((32 (2 ?N)!math:product (2 ?S)!math:product ?R!math:negation ?U!math:negation)!math:sum 7) math:remainder ?V.
73
- ((?J (11 ?R)!math:product (22 ?V)!math:product)!math:sum 451) math:integerQuotient ?W.
74
- ((?R ?V (7 ?W)!math:product!math:negation 114)!math:sum 31) math:integerQuotient ?X; math:remainder ?Z.
75
- (?Z 1) math:sum ?DAY.
76
- } => {
77
- (?DAY ?X) :easterFor ?Y.
78
- }.
1
+ # ==========================================================================
2
+ # Easter — ARC-style
3
+ #
4
+ # This example computes the date of Easter Sunday in the Gregorian calendar.
5
+ # For each year in a sample range, it applies the classic computus step by
6
+ # step, explains the resulting month and day, and then checks independent
7
+ # properties of the result: cycle bounds, remainder bounds, and the legal
8
+ # Easter date window in March or April.
9
+ # ==========================================================================
10
+
11
+ @prefix : <https://example.org/easter-arc#> .
12
+ @prefix math: <http://www.w3.org/2000/10/swap/math#> .
13
+ @prefix log: <http://www.w3.org/2000/10/swap/log#> .
14
+ @prefix string: <http://www.w3.org/2000/10/swap/string#> .
15
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
16
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
17
+
18
+ <> rdfs:comment """This ARC-style version keeps the Gregorian computus from the original example and reports, for each sample year, an Answer, a Reason Why, and a set of independent Checks.""" .
19
+
20
+ :y2026 a :Case; :year 2026 .
21
+ :y2027 a :Case; :year 2027 .
22
+ :y2028 a :Case; :year 2028 .
23
+ :y2029 a :Case; :year 2029 .
24
+ :y2030 a :Case; :year 2030 .
25
+ :y2031 a :Case; :year 2031 .
26
+ :y2032 a :Case; :year 2032 .
27
+ :y2033 a :Case; :year 2033 .
28
+ :y2034 a :Case; :year 2034 .
29
+ :y2035 a :Case; :year 2035 .
30
+
31
+ :goldenRemainder :value 0 .
32
+ :goldenRemainder :value 1 .
33
+ :goldenRemainder :value 2 .
34
+ :goldenRemainder :value 3 .
35
+ :goldenRemainder :value 4 .
36
+ :goldenRemainder :value 5 .
37
+ :goldenRemainder :value 6 .
38
+ :goldenRemainder :value 7 .
39
+ :goldenRemainder :value 8 .
40
+ :goldenRemainder :value 9 .
41
+ :goldenRemainder :value 10 .
42
+ :goldenRemainder :value 11 .
43
+ :goldenRemainder :value 12 .
44
+ :goldenRemainder :value 13 .
45
+ :goldenRemainder :value 14 .
46
+ :goldenRemainder :value 15 .
47
+ :goldenRemainder :value 16 .
48
+ :goldenRemainder :value 17 .
49
+ :goldenRemainder :value 18 .
50
+
51
+ :epactRemainder :value 0 .
52
+ :epactRemainder :value 1 .
53
+ :epactRemainder :value 2 .
54
+ :epactRemainder :value 3 .
55
+ :epactRemainder :value 4 .
56
+ :epactRemainder :value 5 .
57
+ :epactRemainder :value 6 .
58
+ :epactRemainder :value 7 .
59
+ :epactRemainder :value 8 .
60
+ :epactRemainder :value 9 .
61
+ :epactRemainder :value 10 .
62
+ :epactRemainder :value 11 .
63
+ :epactRemainder :value 12 .
64
+ :epactRemainder :value 13 .
65
+ :epactRemainder :value 14 .
66
+ :epactRemainder :value 15 .
67
+ :epactRemainder :value 16 .
68
+ :epactRemainder :value 17 .
69
+ :epactRemainder :value 18 .
70
+ :epactRemainder :value 19 .
71
+ :epactRemainder :value 20 .
72
+ :epactRemainder :value 21 .
73
+ :epactRemainder :value 22 .
74
+ :epactRemainder :value 23 .
75
+ :epactRemainder :value 24 .
76
+ :epactRemainder :value 25 .
77
+ :epactRemainder :value 26 .
78
+ :epactRemainder :value 27 .
79
+ :epactRemainder :value 28 .
80
+ :epactRemainder :value 29 .
81
+
82
+ :weekdayRemainder :value 0 .
83
+ :weekdayRemainder :value 1 .
84
+ :weekdayRemainder :value 2 .
85
+ :weekdayRemainder :value 3 .
86
+ :weekdayRemainder :value 4 .
87
+ :weekdayRemainder :value 5 .
88
+ :weekdayRemainder :value 6 .
89
+
90
+ :slot_m3_d22 :monthNum 3; :day 22 .
91
+ :slot_m3_d23 :monthNum 3; :day 23 .
92
+ :slot_m3_d24 :monthNum 3; :day 24 .
93
+ :slot_m3_d25 :monthNum 3; :day 25 .
94
+ :slot_m3_d26 :monthNum 3; :day 26 .
95
+ :slot_m3_d27 :monthNum 3; :day 27 .
96
+ :slot_m3_d28 :monthNum 3; :day 28 .
97
+ :slot_m3_d29 :monthNum 3; :day 29 .
98
+ :slot_m3_d30 :monthNum 3; :day 30 .
99
+ :slot_m3_d31 :monthNum 3; :day 31 .
100
+ :slot_m4_d1 :monthNum 4; :day 1 .
101
+ :slot_m4_d2 :monthNum 4; :day 2 .
102
+ :slot_m4_d3 :monthNum 4; :day 3 .
103
+ :slot_m4_d4 :monthNum 4; :day 4 .
104
+ :slot_m4_d5 :monthNum 4; :day 5 .
105
+ :slot_m4_d6 :monthNum 4; :day 6 .
106
+ :slot_m4_d7 :monthNum 4; :day 7 .
107
+ :slot_m4_d8 :monthNum 4; :day 8 .
108
+ :slot_m4_d9 :monthNum 4; :day 9 .
109
+ :slot_m4_d10 :monthNum 4; :day 10 .
110
+ :slot_m4_d11 :monthNum 4; :day 11 .
111
+ :slot_m4_d12 :monthNum 4; :day 12 .
112
+ :slot_m4_d13 :monthNum 4; :day 13 .
113
+ :slot_m4_d14 :monthNum 4; :day 14 .
114
+ :slot_m4_d15 :monthNum 4; :day 15 .
115
+ :slot_m4_d16 :monthNum 4; :day 16 .
116
+ :slot_m4_d17 :monthNum 4; :day 17 .
117
+ :slot_m4_d18 :monthNum 4; :day 18 .
118
+ :slot_m4_d19 :monthNum 4; :day 19 .
119
+ :slot_m4_d20 :monthNum 4; :day 20 .
120
+ :slot_m4_d21 :monthNum 4; :day 21 .
121
+ :slot_m4_d22 :monthNum 4; :day 22 .
122
+ :slot_m4_d23 :monthNum 4; :day 23 .
123
+ :slot_m4_d24 :monthNum 4; :day 24 .
124
+ :slot_m4_d25 :monthNum 4; :day 25 .
125
+
126
+ # --------
127
+ # Computus
128
+ # --------
129
+
130
+ { ?Case a :Case; :year ?Y.
131
+ (?Y 19) math:remainder ?J.
132
+ (?Y 100) math:integerQuotient ?K; math:remainder ?H.
133
+ (?K 4) math:integerQuotient ?M; math:remainder ?N.
134
+ ((?K 8)!math:sum 25) math:integerQuotient ?P.
135
+ (((?K ?P)!math:difference 1)!math:sum 3) math:integerQuotient ?Q.
136
+ ((((((19 ?J)!math:product ?K)!math:sum ?M)!math:difference ?Q)!math:difference 15)!math:sum 30)
137
+ math:remainder ?R.
138
+ (?H 4) math:integerQuotient ?S; math:remainder ?U.
139
+ ((32 (2 ?N)!math:product (2 ?S)!math:product ?R!math:negation ?U!math:negation)!math:sum 7)
140
+ math:remainder ?V.
141
+ ((?J (11 ?R)!math:product (22 ?V)!math:product)!math:sum 451)
142
+ math:integerQuotient ?W.
143
+ ((?R ?V (7 ?W)!math:product!math:negation 114)!math:sum 31)
144
+ math:integerQuotient ?X; math:remainder ?Z.
145
+ (?Z 1) math:sum ?DAY.
146
+ }
147
+ =>
148
+ { ?Case
149
+ :j ?J;
150
+ :k ?K;
151
+ :h ?H;
152
+ :m ?M;
153
+ :n ?N;
154
+ :p ?P;
155
+ :q ?Q;
156
+ :r ?R;
157
+ :s ?S;
158
+ :u ?U;
159
+ :v ?V;
160
+ :w ?W;
161
+ :monthNum ?X;
162
+ :day ?DAY;
163
+ :z ?Z. } .
164
+
165
+ { ?Case :monthNum 3. } => { ?Case :monthName "March". } .
166
+ { ?Case :monthNum 4. } => { ?Case :monthName "April". } .
167
+
168
+ # ------------------
169
+ # Independent checks
170
+ # ------------------
171
+
172
+ { ?Case :j ?J. :goldenRemainder :value ?J. }
173
+ => { ?Case :check1 "C1 OK - the Golden Number remainder j is inside the 0–18 cycle.\n" . } .
174
+
175
+ { ?Case :r ?R. :epactRemainder :value ?R. }
176
+ => { ?Case :check2 "C2 OK - the epact-style remainder r is inside the 0–29 cycle.\n" . } .
177
+
178
+ { ?Case :v ?V. :weekdayRemainder :value ?V. }
179
+ => { ?Case :check3 "C3 OK - the weekday adjustment v is inside the 0–6 cycle.\n" . } .
180
+
181
+ { ?Case :monthNum ?M; :monthName ?Name. }
182
+ => { ?Case :check4 "C4 OK - the final month is a valid Easter month (March or April).\n" . } .
183
+
184
+ { ?Case :monthNum ?M; :day ?D.
185
+ ?Slot :monthNum ?M; :day ?D. }
186
+ => { ?Case :check5 "C5 OK - the final date is inside the legal Gregorian Easter window.\n" . } .
187
+
188
+ # ----------------
189
+ # ARC-style report
190
+ # ----------------
191
+
192
+ { ?Case :year ?Y; :monthName ?Month; :day ?Day;
193
+ :j ?J; :k ?K; :q ?Q; :r ?R; :v ?V; :monthNum ?X; :z ?Z;
194
+ :check1 ?C1; :check2 ?C2; :check3 ?C3; :check4 ?C4; :check5 ?C5.
195
+ (
196
+ "Easter — Gregorian computus\n\n"
197
+ "=== " ?Y " ===\n"
198
+ "Answer\n"
199
+ "Easter Sunday falls on " ?Month " " ?Day ".\n\n"
200
+ "Reason Why\n"
201
+ "For year " ?Y ", the computus gives j=" ?J ", k=" ?K ", q=" ?Q
202
+ ", r=" ?R ", v=" ?V ", and final month/day numbers x=" ?X ", z=" ?Z ". "
203
+ "Because the day is z+1, the resulting Easter date is " ?Month " " ?Day ".\n\n"
204
+ "Check\n"
205
+ ?C1 ?C2 ?C3 ?C4 ?C5
206
+ ) string:concatenation ?Block. }
207
+ =>
208
+ { :report log:outputString ?Block. } .
package/examples/gps.n3 CHANGED
@@ -1,63 +1,154 @@
1
- # =======================================================================
2
- # Goal driven Parallel Sequences
3
- # See https://www.sciencedirect.com/science/article/pii/S1532046421000794
4
- # and https://github.com/hongsun502/wstLogic/tree/master
5
- # =======================================================================
1
+ # ===========================================================================
2
+ # GPS — ARC-style goal-driven path example.
3
+ #
4
+ # This example shows a tiny route planner for western Belgium. Starting in Gent,
5
+ # the program works out the available routes to Oostende, compares them, and
6
+ # recommends the better one. It does not only print an answer: it also explains
7
+ # why that route was chosen and checks that the recommendation is consistent
8
+ # with the computed travel metrics.
9
+ # ===========================================================================
6
10
 
11
+ @prefix log: <http://www.w3.org/2000/10/swap/log#>.
7
12
  @prefix math: <http://www.w3.org/2000/10/swap/math#>.
8
13
  @prefix list: <http://www.w3.org/2000/10/swap/list#>.
9
- @prefix gps: <https://eyereasoner.github.io/eye/reasoning/gps/gps-schema#>.
10
- @prefix : <https://eyereasoner.github.io/eye/reasoning#>.
14
+ @prefix string: <http://www.w3.org/2000/10/swap/string#>.
15
+ @prefix gps: <https://example.org/gps#>.
16
+ @prefix : <https://example.org/gps-case#>.
17
+
18
+ # -----
19
+ # Facts
20
+ # -----
11
21
 
12
- # current state
13
22
  :i1 :location :Gent.
23
+ :question :text "Which route should we take from Gent to Oostende?".
14
24
 
15
- # -------------------------------------------------
16
- # map of Belgium (as backward rules / descriptions)
17
- # -------------------------------------------------
18
- {:map-BE gps:description ({?S :location :Gent} true {?S :location :Brugge} :drive_gent_brugge 1500.0 0.006 0.96 0.99)} <= true.
19
- {:map-BE gps:description ({?S :location :Gent} true {?S :location :Kortrijk} :drive_gent_kortrijk 1600.0 0.007 0.96 0.99)} <= true.
20
- {:map-BE gps:description ({?S :location :Kortrijk} true {?S :location :Brugge} :drive_kortrijk_brugge 1600.0 0.007 0.96 0.99)} <= true.
21
- {:map-BE gps:description ({?S :location :Brugge} true {?S :location :Oostende} :drive_brugge_oostende 900.0 0.004 0.98 1.0 )} <= true.
22
-
23
- # -----------------------------
24
- # Compute all paths by chaining
25
- # -----------------------------
26
- # Base: a single map description is a path
27
- {
28
- (?From ?To (?Act) ?Dur ?Cost ?Belief ?Comfort) :path true.
29
- }
30
- <=
31
- {
32
- :map-BE gps:description (?From true ?To ?Act ?Dur ?Cost ?Belief ?Comfort).
33
- }.
34
-
35
- # Recursive: chain one step + rest path, and aggregate weights
36
- {
37
- (?From ?To ?Actions ?Dur ?Cost ?Belief ?Comfort) :path true.
38
- }
39
- <=
40
- {
41
- :map-BE gps:description (?From true ?Mid ?Act ?Dur1 ?Cost1 ?Bel1 ?Comf1).
42
- (?Mid ?To ?RestActs ?Dur2 ?Cost2 ?Bel2 ?Comf2) :path true.
25
+ :routeDirect :label "Gent → Brugge → Oostende".
26
+ :routeViaKortrijk :label "Gent Kortrijk Brugge Oostende".
27
+
28
+ # ----------------------------------------------------------------
29
+ # Map of Belgium (kept from the original as backward descriptions)
30
+ # ----------------------------------------------------------------
31
+
32
+ { :mapBE gps:description ({?S :location :Gent} true {?S :location :Brugge} :drive_gent_brugge 1500.0 0.006 0.96 0.99) }
33
+ <= true.
34
+
35
+ { :mapBE gps:description ({?S :location :Gent} true {?S :location :Kortrijk} :drive_gent_kortrijk 1600.0 0.007 0.96 0.99) }
36
+ <= true.
43
37
 
38
+ { :mapBE gps:description ({?S :location :Kortrijk} true {?S :location :Brugge} :drive_kortrijk_brugge 1600.0 0.007 0.96 0.99) }
39
+ <= true.
40
+
41
+ { :mapBE gps:description ({?S :location :Brugge} true {?S :location :Oostende} :drive_brugge_oostende 900.0 0.004 0.98 1.0) }
42
+ <= true.
43
+
44
+ # -----------------------------------------------------
45
+ # Logic: compute all paths by chaining map descriptions
46
+ # -----------------------------------------------------
47
+
48
+ # Base: a single map description is already a path.
49
+ { (?From ?To (?Act) ?Dur ?Cost ?Belief ?Comfort) :path true. }
50
+ <=
51
+ { :mapBE gps:description (?From true ?To ?Act ?Dur ?Cost ?Belief ?Comfort). }.
52
+
53
+ # Recursive: extend a description with the rest of a path.
54
+ { (?From ?To ?Actions ?Dur ?Cost ?Belief ?Comfort) :path true. }
55
+ <=
56
+ { :mapBE gps:description (?From true ?Mid ?Act ?Dur1 ?Cost1 ?Bel1 ?Comf1).
57
+ (?Mid ?To ?RestActs ?Dur2 ?Cost2 ?Bel2 ?Comf2) :path true.
44
58
  ((?Act) ?RestActs) list:append ?Actions.
59
+ (?Dur1 ?Dur2) math:sum ?Dur.
60
+ (?Cost1 ?Cost2) math:sum ?Cost.
61
+ (?Bel1 ?Bel2) math:product ?Belief.
62
+ (?Comf1 ?Comf2) math:product ?Comfort. }.
63
+
64
+ # Query the path relation for the traveller starting in Gent and aiming for Oostende.
65
+ { :i1 :location :Gent.
66
+ ({:i1 :location :Gent} {:i1 :location :Oostende} ?Acts ?Dur ?Cost ?Bel ?Comf) :path true. }
67
+ =>
68
+ { :i1 gps:path (?Acts ?Dur ?Cost ?Bel ?Comf). }.
69
+
70
+ # Name the two concrete routes that exist in this tiny map.
71
+ { :i1 gps:path ((:drive_gent_brugge :drive_brugge_oostende) ?Dur ?Cost ?Bel ?Comf). }
72
+ =>
73
+ { :routeDirect :duration ?Dur;
74
+ :cost ?Cost;
75
+ :belief ?Bel;
76
+ :comfort ?Comf. }.
77
+
78
+ { :i1 gps:path ((:drive_gent_kortrijk :drive_kortrijk_brugge :drive_brugge_oostende) ?Dur ?Cost ?Bel ?Comf). }
79
+ =>
80
+ { :routeViaKortrijk :duration ?Dur;
81
+ :cost ?Cost;
82
+ :belief ?Bel;
83
+ :comfort ?Comf. }.
84
+
85
+ # ------------------------------------
86
+ # Decision: recommend the better route
87
+ # ------------------------------------
88
+
89
+ { :routeDirect :duration ?D1; :cost ?C1; :belief ?B1; :comfort ?F1.
90
+ :routeViaKortrijk :duration ?D2; :cost ?C2; :belief ?B2; :comfort ?F2.
91
+ ?D1 math:lessThan ?D2.
92
+ ?C1 math:lessThan ?C2.
93
+ ?B1 math:greaterThan ?B2.
94
+ ?F1 math:greaterThan ?F2. }
95
+ =>
96
+ { :decision :recommendedRoute :routeDirect;
97
+ :outcome "Take the direct route via Brugge.". }.
98
+
99
+ # ---------------------------------------------------
100
+ # Presentation: ARC output as one deterministic block
101
+ # ---------------------------------------------------
102
+
103
+ { :decision :recommendedRoute :routeDirect; :outcome ?Outcome.
104
+ :routeDirect :label ?BestLabel; :duration ?BestDur; :cost ?BestCost; :belief ?BestBel; :comfort ?BestComf.
105
+ :routeViaKortrijk :label ?AltLabel; :duration ?AltDur; :cost ?AltCost; :belief ?AltBel; :comfort ?AltComf.
106
+ (
107
+ "GPS — Goal driven route planning\n\n"
108
+ "Answer\n"
109
+ ?Outcome "\n"
110
+ "Recommended route: " ?BestLabel "\n\n"
111
+ "Reason Why\n"
112
+ "From Gent to Oostende, the planner found two routes in this small map. "
113
+ "The direct route (" ?BestLabel ") takes " ?BestDur " seconds at cost " ?BestCost
114
+ ", with belief " ?BestBel " and comfort " ?BestComf ". "
115
+ "The alternative (" ?AltLabel ") takes " ?AltDur " seconds at cost " ?AltCost
116
+ ", with belief " ?AltBel " and comfort " ?AltComf ". "
117
+ "So the direct route is faster, cheaper, more reliable, and slightly more comfortable.\n\n"
118
+ "Check\n"
119
+ "C1 OK - the direct Gent → Brugge → Oostende route was derived.\n"
120
+ "C2 OK - the alternative Gent → Kortrijk → Brugge → Oostende route was derived.\n"
121
+ "C3 OK - the recommended route is faster than the alternative.\n"
122
+ "C4 OK - the recommended route is cheaper than the alternative.\n"
123
+ "C5 OK - the recommended route has higher belief and comfort scores.\n"
124
+ ) string:concatenation ?Block. }
125
+ =>
126
+ { :report log:outputString ?Block. }.
127
+
128
+ # -----------------------------------------------------------------------
129
+ # Verification: fail loudly if the recommendation contradicts the metrics
130
+ # -----------------------------------------------------------------------
131
+
132
+ { :decision :recommendedRoute :routeDirect.
133
+ :routeDirect :duration ?D1.
134
+ :routeViaKortrijk :duration ?D2.
135
+ ?D1 math:notLessThan ?D2. }
136
+ => false.
137
+
138
+ { :decision :recommendedRoute :routeDirect.
139
+ :routeDirect :cost ?C1.
140
+ :routeViaKortrijk :cost ?C2.
141
+ ?C1 math:notLessThan ?C2. }
142
+ => false.
45
143
 
46
- (?Dur1 ?Dur2) math:sum ?Dur.
47
- (?Cost1 ?Cost2) math:sum ?Cost.
48
- (?Bel1 ?Bel2) math:product ?Belief.
49
- (?Comf1 ?Comf2) math:product ?Comfort.
50
- }.
51
-
52
- # ------------------------------------------------------
53
- # "Query": derive gps:path facts for i1, goal = Oostende
54
- # ------------------------------------------------------
55
- {
56
- :i1 :location :Gent.
57
- ({:i1 :location :Gent} {:i1 :location :Oostende} ?Acts ?Dur ?Cost ?Bel ?Comf) :path true.
58
- }
59
- =>
60
- {
61
- :i1 gps:path (?Acts ?Dur ?Cost ?Bel ?Comf).
62
- }.
144
+ { :decision :recommendedRoute :routeDirect.
145
+ :routeDirect :belief ?B1.
146
+ :routeViaKortrijk :belief ?B2.
147
+ ?B1 math:notGreaterThan ?B2. }
148
+ => false.
63
149
 
150
+ { :decision :recommendedRoute :routeDirect.
151
+ :routeDirect :comfort ?F1.
152
+ :routeViaKortrijk :comfort ?F2.
153
+ ?F1 math:notGreaterThan ?F2. }
154
+ => false.