eyeling 1.5.38 → 1.5.40

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,21 +1,47 @@
1
1
  # =======================================================================================
2
- # OSLO-STEPS workflow composition translation pipeline style
2
+ # OSLO-STEPS minimal “Address change” workflow composition example
3
3
  #
4
- # Goal:
5
- # Compose an "address change confirmation" workflow from OSLO-STEPS-style input:
6
- # - o-steps:State + o-steps:hasStateShape (SHACL constraints)
7
- # - o-steps:Step + o-steps:requiresState / o-steps:producesState + costs
4
+ # Purpose
5
+ # A compact, representative test case for Eyeling/EYE workflow composition in the
6
+ # OSLO-STEPS style, without SHACL or shape machinery.
8
7
  #
9
- # Pipeline:
10
- # 1) StateShape -> State constraints (targetClass, path, value) [SHACL -> constraints]
11
- # 2) Step + required/produced State -> gps:description [OSLO -> internal]
12
- # 3) planner composes gps:description [internal -> plan]
8
+ # What it models
9
+ # A citizen (Bob) completes an address change. The workflow progresses through five
10
+ # “state flags”:
11
+ # 1) personalInfoProvided
12
+ # 2) movingDataProvided
13
+ # 3) newAddressProvided
14
+ # 4) addressChangeDeclared
15
+ # 5) confirmationOfAddressChange
13
16
  #
14
- # Notes:
15
- # - Aggregation:
16
- # duration + monetaryCost = sum
17
- # success * satisfaction = product
18
- # - Pruning is done using math:lessThan / math:greaterThan (known to work in EYE).
17
+ # OSLO-STEPS core used
18
+ # - Each action is an o-steps:Step with:
19
+ # o-steps:requiresState (precondition state)
20
+ # o-steps:producesState (postcondition state)
21
+ # plus simple costs:
22
+ # cost:duration, cost:monetaryCost, cost:success, cost:usersatifaction
23
+ #
24
+ # State representation
25
+ # - Each “State” is stored as a quoted N3 formula term in state:si :formula { ... }.
26
+ # - We use var:x inside formulas as a stable placeholder to avoid variable-renaming
27
+ # explosions and to keep formula-term matching predictable across engines.
28
+ #
29
+ # Compilation and planning
30
+ # - A small compiler turns each o-steps:Step into a gps:description transition:
31
+ # (FROM true TO STEP duration cost success satisfaction)
32
+ # - A minimal planner composes gps:description transitions into a gps:path by chaining
33
+ # them and aggregating metrics:
34
+ # duration + monetaryCost = sum
35
+ # success * satisfaction = product
36
+ # - No “fuel” bound is used here; termination is ensured because the workflow graph is
37
+ # acyclic (s0 -> s1 -> s2 -> s3 -> s4 -> s5) and has a finite number of alternatives.
38
+ #
39
+ # Output
40
+ # - Derives :bob gps:path ( ?Steps ?Duration ?Cost ?Success ?Satisfaction ).
41
+ #
42
+ # Run (examples)
43
+ # eye --quiet --nope --pass-only-new oslo-steps-workflow-composition-min.n3
44
+ # node eyeling.js oslo-steps-workflow-composition-min.n3
19
45
  # =======================================================================================
20
46
 
21
47
  @prefix math: <http://www.w3.org/2000/10/swap/math#>.
@@ -24,7 +50,7 @@
24
50
  @prefix : <https://eyereasoner.github.io/eye/reasoning#>.
25
51
 
26
52
  @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
27
- @prefix sh: <http://www.w3.org/ns/shacl#>.
53
+ @prefix var: <http://www.w3.org/2000/10/swap/var#>.
28
54
 
29
55
  @prefix o-steps: <https://fast.ilabt.imec.be/ns/oslo-steps#>.
30
56
  @prefix o-persoon: <https://data.vlaanderen.be/ns/persoon#>.
@@ -33,171 +59,148 @@
33
59
  @prefix cost: <https://example.org/cost#>.
34
60
  @prefix state: <https://example.org/states#>.
35
61
  @prefix step: <https://example.org/steps#>.
36
- @prefix shape: <https://example.org/shapes#>.
37
-
38
- # ----------------------------------------------------------------------
39
- # 1) OSLO-STEPS-like INPUT
40
- # We model the user situation with a fixed “signature” of 5 booleans:
41
- # ex:personalInfoProvided
42
- # ex:movingDataProvided
43
- # ex:newAddressProvided
44
- # ex:addressChangeDeclared
45
- # ex:confirmationOfAddressChange
46
- # ----------------------------------------------------------------------
47
- # States
48
- state:s0 a o-steps:State; rdfs:label "Start"@en; o-steps:hasStateShape shape:s0Shape.
49
- state:s1 a o-steps:State; rdfs:label "Personal info provided"@en;o-steps:hasStateShape shape:s1Shape.
50
- state:s2 a o-steps:State; rdfs:label "Moving data provided"@en; o-steps:hasStateShape shape:s2Shape.
51
- state:s3 a o-steps:State; rdfs:label "New address provided"@en; o-steps:hasStateShape shape:s3Shape.
52
- state:s4 a o-steps:State; rdfs:label "Declared"@en; o-steps:hasStateShape shape:s4Shape.
53
- state:s5 a o-steps:State; rdfs:label "Confirmed"@en; o-steps:hasStateShape shape:s5Shape.
54
-
55
- # StateShapes (each shape defines the full signature using 5 property shapes)
56
- shape:s0Shape a o-steps:StateShape; sh:targetClass o-persoon:Inwoner;
57
- sh:property shape:s0PI, shape:s0MD, shape:s0NA, shape:s0DECL, shape:s0CONF.
58
- shape:s1Shape a o-steps:StateShape; sh:targetClass o-persoon:Inwoner;
59
- sh:property shape:s1PI, shape:s1MD, shape:s1NA, shape:s1DECL, shape:s1CONF.
60
- shape:s2Shape a o-steps:StateShape; sh:targetClass o-persoon:Inwoner;
61
- sh:property shape:s2PI, shape:s2MD, shape:s2NA, shape:s2DECL, shape:s2CONF.
62
- shape:s3Shape a o-steps:StateShape; sh:targetClass o-persoon:Inwoner;
63
- sh:property shape:s3PI, shape:s3MD, shape:s3NA, shape:s3DECL, shape:s3CONF.
64
- shape:s4Shape a o-steps:StateShape; sh:targetClass o-persoon:Inwoner;
65
- sh:property shape:s4PI, shape:s4MD, shape:s4NA, shape:s4DECL, shape:s4CONF.
66
- shape:s5Shape a o-steps:StateShape; sh:targetClass o-persoon:Inwoner;
67
- sh:property shape:s5PI, shape:s5MD, shape:s5NA, shape:s5DECL, shape:s5CONF.
68
-
69
- # S0: all false
70
- shape:s0PI a sh:PropertyShape; sh:path ex:personalInfoProvided; sh:hasValue false; sh:minCount 1.
71
- shape:s0MD a sh:PropertyShape; sh:path ex:movingDataProvided; sh:hasValue false; sh:minCount 1.
72
- shape:s0NA a sh:PropertyShape; sh:path ex:newAddressProvided; sh:hasValue false; sh:minCount 1.
73
- shape:s0DECL a sh:PropertyShape; sh:path ex:addressChangeDeclared; sh:hasValue false; sh:minCount 1.
74
- shape:s0CONF a sh:PropertyShape; sh:path ex:confirmationOfAddressChange; sh:hasValue false; sh:minCount 1.
75
-
76
- # S1: PI true
77
- shape:s1PI a sh:PropertyShape; sh:path ex:personalInfoProvided; sh:hasValue true; sh:minCount 1.
78
- shape:s1MD a sh:PropertyShape; sh:path ex:movingDataProvided; sh:hasValue false; sh:minCount 1.
79
- shape:s1NA a sh:PropertyShape; sh:path ex:newAddressProvided; sh:hasValue false; sh:minCount 1.
80
- shape:s1DECL a sh:PropertyShape; sh:path ex:addressChangeDeclared; sh:hasValue false; sh:minCount 1.
81
- shape:s1CONF a sh:PropertyShape; sh:path ex:confirmationOfAddressChange; sh:hasValue false; sh:minCount 1.
82
-
83
- # S2: PI true, MD true
84
- shape:s2PI a sh:PropertyShape; sh:path ex:personalInfoProvided; sh:hasValue true; sh:minCount 1.
85
- shape:s2MD a sh:PropertyShape; sh:path ex:movingDataProvided; sh:hasValue true; sh:minCount 1.
86
- shape:s2NA a sh:PropertyShape; sh:path ex:newAddressProvided; sh:hasValue false; sh:minCount 1.
87
- shape:s2DECL a sh:PropertyShape; sh:path ex:addressChangeDeclared; sh:hasValue false; sh:minCount 1.
88
- shape:s2CONF a sh:PropertyShape; sh:path ex:confirmationOfAddressChange; sh:hasValue false; sh:minCount 1.
89
-
90
- # S3: PI true, MD true, NA true
91
- shape:s3PI a sh:PropertyShape; sh:path ex:personalInfoProvided; sh:hasValue true; sh:minCount 1.
92
- shape:s3MD a sh:PropertyShape; sh:path ex:movingDataProvided; sh:hasValue true; sh:minCount 1.
93
- shape:s3NA a sh:PropertyShape; sh:path ex:newAddressProvided; sh:hasValue true; sh:minCount 1.
94
- shape:s3DECL a sh:PropertyShape; sh:path ex:addressChangeDeclared; sh:hasValue false; sh:minCount 1.
95
- shape:s3CONF a sh:PropertyShape; sh:path ex:confirmationOfAddressChange; sh:hasValue false; sh:minCount 1.
96
-
97
- # S4: declared true
98
- shape:s4PI a sh:PropertyShape; sh:path ex:personalInfoProvided; sh:hasValue true; sh:minCount 1.
99
- shape:s4MD a sh:PropertyShape; sh:path ex:movingDataProvided; sh:hasValue true; sh:minCount 1.
100
- shape:s4NA a sh:PropertyShape; sh:path ex:newAddressProvided; sh:hasValue true; sh:minCount 1.
101
- shape:s4DECL a sh:PropertyShape; sh:path ex:addressChangeDeclared; sh:hasValue true; sh:minCount 1.
102
- shape:s4CONF a sh:PropertyShape; sh:path ex:confirmationOfAddressChange; sh:hasValue false; sh:minCount 1.
103
-
104
- # S5: confirmed true
105
- shape:s5PI a sh:PropertyShape; sh:path ex:personalInfoProvided; sh:hasValue true; sh:minCount 1.
106
- shape:s5MD a sh:PropertyShape; sh:path ex:movingDataProvided; sh:hasValue true; sh:minCount 1.
107
- shape:s5NA a sh:PropertyShape; sh:path ex:newAddressProvided; sh:hasValue true; sh:minCount 1.
108
- shape:s5DECL a sh:PropertyShape; sh:path ex:addressChangeDeclared; sh:hasValue true; sh:minCount 1.
109
- shape:s5CONF a sh:PropertyShape; sh:path ex:confirmationOfAddressChange; sh:hasValue true; sh:minCount 1.
110
-
111
- # Steps (branching alternatives)
62
+
63
+ # =======================================================================================
64
+ # 1) States as formula terms (no SHACL)
65
+ # =======================================================================================
66
+
67
+ # Start (all false)
68
+ state:s0 :formula {
69
+ var:x a o-persoon:Inwoner.
70
+ var:x ex:personalInfoProvided false.
71
+ var:x ex:movingDataProvided false.
72
+ var:x ex:newAddressProvided false.
73
+ var:x ex:addressChangeDeclared false.
74
+ var:x ex:confirmationOfAddressChange false.
75
+ }.
76
+
77
+ # Personal info done
78
+ state:s1 :formula {
79
+ var:x a o-persoon:Inwoner.
80
+ var:x ex:personalInfoProvided true.
81
+ var:x ex:movingDataProvided false.
82
+ var:x ex:newAddressProvided false.
83
+ var:x ex:addressChangeDeclared false.
84
+ var:x ex:confirmationOfAddressChange false.
85
+ }.
86
+
87
+ # Moving data done
88
+ state:s2 :formula {
89
+ var:x a o-persoon:Inwoner.
90
+ var:x ex:personalInfoProvided true.
91
+ var:x ex:movingDataProvided true.
92
+ var:x ex:newAddressProvided false.
93
+ var:x ex:addressChangeDeclared false.
94
+ var:x ex:confirmationOfAddressChange false.
95
+ }.
96
+
97
+ # New address done
98
+ state:s3 :formula {
99
+ var:x a o-persoon:Inwoner.
100
+ var:x ex:personalInfoProvided true.
101
+ var:x ex:movingDataProvided true.
102
+ var:x ex:newAddressProvided true.
103
+ var:x ex:addressChangeDeclared false.
104
+ var:x ex:confirmationOfAddressChange false.
105
+ }.
106
+
107
+ # Declared
108
+ state:s4 :formula {
109
+ var:x a o-persoon:Inwoner.
110
+ var:x ex:personalInfoProvided true.
111
+ var:x ex:movingDataProvided true.
112
+ var:x ex:newAddressProvided true.
113
+ var:x ex:addressChangeDeclared true.
114
+ var:x ex:confirmationOfAddressChange false.
115
+ }.
116
+
117
+ # Confirmed (goal)
118
+ state:s5 :formula {
119
+ var:x a o-persoon:Inwoner.
120
+ var:x ex:personalInfoProvided true.
121
+ var:x ex:movingDataProvided true.
122
+ var:x ex:newAddressProvided true.
123
+ var:x ex:addressChangeDeclared true.
124
+ var:x ex:confirmationOfAddressChange true.
125
+ }.
126
+
127
+ # =======================================================================================
128
+ # 2) Steps (OSLO-STEPS core) + costs
129
+ # =======================================================================================
130
+
131
+ # s0 -> s1
112
132
  step:providePersonalInfoOnline a o-steps:Step;
113
- o-steps:requiresState state:s0; o-steps:producesState state:s1;
114
- cost:duration 30.0; cost:monetaryCost 0.0; cost:success 0.99; cost:usersatifaction 0.95.
133
+ rdfs:label "Provide personal info (online)"@en;
134
+ o-steps:requiresState state:s0;
135
+ o-steps:producesState state:s1;
136
+ cost:duration 30.0; cost:monetaryCost 0.0; cost:success 0.99; cost:usersatifaction 0.95.
115
137
 
116
138
  step:providePersonalInfoDesk a o-steps:Step;
117
- o-steps:requiresState state:s0; o-steps:producesState state:s1;
118
- cost:duration 120.0; cost:monetaryCost 0.0; cost:success 0.995; cost:usersatifaction 0.85.
139
+ rdfs:label "Provide personal info (desk)"@en;
140
+ o-steps:requiresState state:s0;
141
+ o-steps:producesState state:s1;
142
+ cost:duration 120.0; cost:monetaryCost 0.0; cost:success 0.995; cost:usersatifaction 0.85.
119
143
 
144
+ # s1 -> s2
120
145
  step:provideMovingDataOnline a o-steps:Step;
121
- o-steps:requiresState state:s1; o-steps:producesState state:s2;
122
- cost:duration 45.0; cost:monetaryCost 2.0; cost:success 0.99; cost:usersatifaction 0.92.
146
+ rdfs:label "Provide moving data (online)"@en;
147
+ o-steps:requiresState state:s1;
148
+ o-steps:producesState state:s2;
149
+ cost:duration 45.0; cost:monetaryCost 2.0; cost:success 0.99; cost:usersatifaction 0.92.
123
150
 
124
151
  step:provideMovingDataDesk a o-steps:Step;
125
- o-steps:requiresState state:s1; o-steps:producesState state:s2;
126
- cost:duration 90.0; cost:monetaryCost 2.0; cost:success 0.995; cost:usersatifaction 0.88.
152
+ rdfs:label "Provide moving data (desk)"@en;
153
+ o-steps:requiresState state:s1;
154
+ o-steps:producesState state:s2;
155
+ cost:duration 90.0; cost:monetaryCost 2.0; cost:success 0.995; cost:usersatifaction 0.88.
127
156
 
157
+ # s2 -> s3
128
158
  step:provideNewAddress a o-steps:Step;
129
- o-steps:requiresState state:s2; o-steps:producesState state:s3;
130
- cost:duration 30.0; cost:monetaryCost 0.0; cost:success 0.99; cost:usersatifaction 0.93.
159
+ rdfs:label "Provide new address"@en;
160
+ o-steps:requiresState state:s2;
161
+ o-steps:producesState state:s3;
162
+ cost:duration 30.0; cost:monetaryCost 0.0; cost:success 0.99; cost:usersatifaction 0.93.
131
163
 
164
+ # s3 -> s4
132
165
  step:declareAddressChangeOnline a o-steps:Step;
133
- o-steps:requiresState state:s3; o-steps:producesState state:s4;
134
- cost:duration 60.0; cost:monetaryCost 0.0; cost:success 0.98; cost:usersatifaction 0.90.
166
+ rdfs:label "Declare address change (online)"@en;
167
+ o-steps:requiresState state:s3;
168
+ o-steps:producesState state:s4;
169
+ cost:duration 60.0; cost:monetaryCost 0.0; cost:success 0.98; cost:usersatifaction 0.90.
135
170
 
136
171
  step:declareAddressChangePostal a o-steps:Step;
137
- o-steps:requiresState state:s3; o-steps:producesState state:s4;
138
- cost:duration 90.0; cost:monetaryCost 2.0; cost:success 0.95; cost:usersatifaction 0.88.
172
+ rdfs:label "Declare address change (postal)"@en;
173
+ o-steps:requiresState state:s3;
174
+ o-steps:producesState state:s4;
175
+ cost:duration 90.0; cost:monetaryCost 2.0; cost:success 0.95; cost:usersatifaction 0.88.
139
176
 
177
+ # s4 -> s5
140
178
  step:confirmAddressChangePolice a o-steps:Step;
141
- o-steps:requiresState state:s4; o-steps:producesState state:s5;
142
- cost:duration 20160.0; cost:monetaryCost 0.0; cost:success 0.98; cost:usersatifaction 0.97.
179
+ rdfs:label "Confirm address change (police visit)"@en;
180
+ o-steps:requiresState state:s4;
181
+ o-steps:producesState state:s5;
182
+ cost:duration 20160.0; cost:monetaryCost 0.0; cost:success 0.98; cost:usersatifaction 0.97.
143
183
 
144
184
  step:confirmAddressChangeCityHall a o-steps:Step;
145
- o-steps:requiresState state:s4; o-steps:producesState state:s5;
146
- cost:duration 10080.0; cost:monetaryCost 0.0; cost:success 0.90; cost:usersatifaction 0.85.
147
-
148
- # --------------------------
149
- # 2) TRANSLATION (docs-like)
150
- # --------------------------
151
- # 2.1) StateShape -> State constraints: (targetClass, path, value)
152
- { ?STATE :constraint (?TARGET ?PATH ?VALUE). } <=
153
- {
154
- ?STATE o-steps:hasStateShape ?SHAPE.
155
- ?SHAPE sh:targetClass ?TARGET.
156
- ?SHAPE sh:property ?PS.
157
- ?PS sh:path ?PATH.
158
- ?PS sh:hasValue ?VALUE.
159
- ?PS sh:minCount 1.
160
- }.
185
+ rdfs:label "Confirm address change (city hall)"@en;
186
+ o-steps:requiresState state:s4;
187
+ o-steps:producesState state:s5;
188
+ cost:duration 10080.0; cost:monetaryCost 0.0; cost:success 0.90; cost:usersatifaction 0.85.
189
+
190
+ # =======================================================================================
191
+ # 3) Compile OSLO-STEPS core -> internal gps:description transitions
192
+ # =======================================================================================
161
193
 
162
- # 2.2) Step -> internal gps:description transition (compiled)
163
- # IMPORTANT: we use ?x inside the formulas so they unify (no existential ?x).
164
194
  {
165
- ex:movemap gps:description
166
- (
167
- { ?x a ?T.
168
- ?x ex:personalInfoProvided ?PI1.
169
- ?x ex:movingDataProvided ?MD1.
170
- ?x ex:newAddressProvided ?NA1.
171
- ?x ex:addressChangeDeclared ?DECL1.
172
- ?x ex:confirmationOfAddressChange ?CONF1.
173
- }
174
- true
175
- { ?x a ?T.
176
- ?x ex:personalInfoProvided ?PI2.
177
- ?x ex:movingDataProvided ?MD2.
178
- ?x ex:newAddressProvided ?NA2.
179
- ?x ex:addressChangeDeclared ?DECL2.
180
- ?x ex:confirmationOfAddressChange ?CONF2.
181
- }
182
- ?STEP
183
- ?DUR ?MC ?SUC ?SAT
184
- ).
195
+ ex:movemap gps:description ( ?FROM true ?TO ?STEP ?DUR ?MC ?SUC ?SAT ).
185
196
  } <=
186
197
  {
198
+ ?STEP a o-steps:Step.
187
199
  ?STEP o-steps:requiresState ?REQ.
188
200
  ?STEP o-steps:producesState ?PROD.
189
201
 
190
- ?REQ :constraint (?T ex:personalInfoProvided ?PI1).
191
- ?REQ :constraint (?T ex:movingDataProvided ?MD1).
192
- ?REQ :constraint (?T ex:newAddressProvided ?NA1).
193
- ?REQ :constraint (?T ex:addressChangeDeclared ?DECL1).
194
- ?REQ :constraint (?T ex:confirmationOfAddressChange ?CONF1).
195
-
196
- ?PROD :constraint (?T ex:personalInfoProvided ?PI2).
197
- ?PROD :constraint (?T ex:movingDataProvided ?MD2).
198
- ?PROD :constraint (?T ex:newAddressProvided ?NA2).
199
- ?PROD :constraint (?T ex:addressChangeDeclared ?DECL2).
200
- ?PROD :constraint (?T ex:confirmationOfAddressChange ?CONF2).
202
+ ?REQ :formula ?FROM.
203
+ ?PROD :formula ?TO.
201
204
 
202
205
  ?STEP cost:duration ?DUR.
203
206
  ?STEP cost:monetaryCost ?MC.
@@ -205,37 +208,29 @@ step:confirmAddressChangeCityHall a o-steps:Step;
205
208
  ?STEP cost:usersatifaction ?SAT.
206
209
  }.
207
210
 
208
- # --------
209
- # 3) START
210
- # --------
211
- :bob :start
212
- {
213
- ?x a o-persoon:Inwoner.
214
- ?x ex:personalInfoProvided false.
215
- ?x ex:movingDataProvided false.
216
- ?x ex:newAddressProvided false.
217
- ?x ex:addressChangeDeclared false.
218
- ?x ex:confirmationOfAddressChange false.
211
+ # =======================================================================================
212
+ # 4) Start + planner (NO fuel; terminates because workflow is acyclic)
213
+ # =======================================================================================
214
+
215
+ :bob :start {
216
+ var:x a o-persoon:Inwoner.
217
+ var:x ex:personalInfoProvided false.
218
+ var:x ex:movingDataProvided false.
219
+ var:x ex:newAddressProvided false.
220
+ var:x ex:addressChangeDeclared false.
221
+ var:x ex:confirmationOfAddressChange false.
219
222
  }.
220
223
 
221
- # ----------------------------------------------------------
222
- # 4) PLANNER
223
- # Path tuple:
224
- # (From To Actions Dur Cost Success Sat)
225
- # ----------------------------------------------------------
226
- # Base: one step
224
+ # Base: one step is a path
227
225
  { (?From ?To (?Act) ?Dur ?Cost ?Suc ?Sat) :path true. }
228
226
  <=
229
- {
230
- ex:movemap gps:description (?From true ?To ?Act ?Dur ?Cost ?Suc ?Sat).
231
- }.
227
+ { ex:movemap gps:description (?From true ?To ?Act ?Dur ?Cost ?Suc ?Sat). }.
232
228
 
233
- # Recursive: step + rest (aggregate)
229
+ # Recursive: step + rest, aggregate
234
230
  { (?From ?To ?Acts ?Dur ?Cost ?Suc ?Sat) :path true. }
235
231
  <=
236
232
  {
237
233
  ex:movemap gps:description (?From true ?Mid ?Act ?Dur1 ?Cost1 ?Suc1 ?Sat1).
238
-
239
234
  (?Mid ?To ?Rest ?Dur2 ?Cost2 ?Suc2 ?Sat2) :path true.
240
235
 
241
236
  ((?Act) ?Rest) list:append ?Acts.
@@ -245,56 +240,36 @@ step:confirmAddressChangeCityHall a o-steps:Step;
245
240
  (?Sat1 ?Sat2) math:product ?Sat.
246
241
  }.
247
242
 
248
- # OSLO-like wrapper with pruning limits applied at query-time (simple + predictable)
243
+ # Wrapper: OSLO-like findpath with bounds
249
244
  {
250
- :scope gps:findpath
251
- (
252
- ?GOAL
253
- ?PATH
254
- ?DURATION
255
- ?MONETARYCOST
256
- ?SUCCESS
257
- ?SATISFACTION
258
- (?DL ?CL ?SL ?AL)
259
- ).
245
+ :scope gps:findpath ( ?GOAL ?PATH ?DUR ?COST ?SUC ?SAT (?DL ?CL ?SL ?AL) ).
260
246
  } <=
261
247
  {
262
248
  :bob :start ?START.
249
+ (?START ?GOAL ?PATH ?DUR ?COST ?SUC ?SAT) :path true.
263
250
 
264
- (?START ?GOAL ?PATH ?DURATION ?MONETARYCOST ?SUCCESS ?SATISFACTION) :path true.
265
-
266
- # pruning (strict)
267
- ?DURATION math:lessThan ?DL.
268
- ?MONETARYCOST math:lessThan ?CL.
269
- ?SUCCESS math:greaterThan ?SL.
270
- ?SATISFACTION math:greaterThan ?AL.
251
+ ?DUR math:lessThan ?DL.
252
+ ?COST math:lessThan ?CL.
253
+ ?SUC math:greaterThan ?SL.
254
+ ?SAT math:greaterThan ?AL.
271
255
  }.
272
256
 
273
- # -----------------------------------------------------------------------
274
- # 5) GOAL QUERY -> OUTPUT
275
- # (Fully specified goal formula, so formula-term unification is exact)
276
- # -----------------------------------------------------------------------
257
+ # =======================================================================================
258
+ # 5) Goal query -> output
259
+ # =======================================================================================
260
+
277
261
  {
262
+ state:s5 :formula ?GOAL.
263
+
278
264
  :scope gps:findpath
279
265
  (
280
- {
281
- ?x a o-persoon:Inwoner.
282
- ?x ex:personalInfoProvided true.
283
- ?x ex:movingDataProvided true.
284
- ?x ex:newAddressProvided true.
285
- ?x ex:addressChangeDeclared true.
286
- ?x ex:confirmationOfAddressChange true.
287
- }
288
- ?PATH
289
- ?DUR
290
- ?COST
291
- ?SUC
292
- ?SAT
266
+ ?GOAL
267
+ ?PATH ?DUR ?COST ?SUC ?SAT
293
268
  (
294
- 40320.0 # duration limit (4 weeks)
295
- 20.0 # monetary cost limit
296
- 0.80 # success lower bound
297
- 0.65 # satisfaction lower bound (0.8 is too strict for product)
269
+ 40320.0 # duration limit (4 weeks)
270
+ 20.0 # monetary cost limit
271
+ 0.80 # success lower bound
272
+ 0.65 # satisfaction lower bound (product shrinks fast)
298
273
  )
299
274
  ).
300
275
  }