eyeprolog 1.6.35 → 1.6.37

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.
Files changed (272) hide show
  1. package/examples/auroracare.pl +25 -10
  2. package/examples/chart-parser.pl +24 -2
  3. package/examples/check/auroracare.pl +17 -10
  4. package/examples/check/chart-parser.pl +9 -9
  5. package/examples/check/composition-of-injective-functions-is-injective.pl +14 -11
  6. package/examples/check/delfour.pl +8 -8
  7. package/examples/check/flandor.pl +7 -7
  8. package/examples/check/gd-step-certified.pl +10 -10
  9. package/examples/check/lldm.pl +1 -1
  10. package/examples/check/quine-mccluskey.pl +7 -6
  11. package/examples/composition-of-injective-functions-is-injective.pl +35 -27
  12. package/examples/deck/README.md +242 -9
  13. package/examples/deck/abstract-interpretation.md +138 -0
  14. package/examples/deck/access-control-policy.md +137 -0
  15. package/examples/deck/ackermann.md +144 -0
  16. package/examples/deck/age.md +108 -0
  17. package/examples/deck/aliases-and-namespaces.md +114 -0
  18. package/examples/deck/alignment-demo.md +131 -0
  19. package/examples/deck/allen-interval-calculus.md +143 -0
  20. package/examples/deck/ancestor.md +125 -0
  21. package/examples/deck/animal.md +109 -0
  22. package/examples/deck/annotation.md +122 -0
  23. package/examples/deck/attributed-variables.md +127 -0
  24. package/examples/deck/auroracare.md +170 -0
  25. package/examples/deck/backward.md +96 -0
  26. package/examples/deck/basic-monadic.md +139 -0
  27. package/examples/deck/bayes-diagnosis.md +146 -0
  28. package/examples/deck/bayes-therapy.md +147 -0
  29. package/examples/deck/beam-deflection.md +134 -0
  30. package/examples/deck/bench.md +123 -0
  31. package/examples/deck/binomial-vandermonde.md +137 -0
  32. package/examples/deck/blocks-world-planning.md +134 -0
  33. package/examples/deck/bmi.md +125 -0
  34. package/examples/deck/braking-safety-worlds.md +138 -0
  35. package/examples/deck/buck-converter-design.md +132 -0
  36. package/examples/deck/bulk-stream-write.md +133 -0
  37. package/examples/deck/cache-performance.md +127 -0
  38. package/examples/deck/canary-release.md +115 -0
  39. package/examples/deck/cat-koko.md +101 -0
  40. package/examples/deck/catalan-convolution.md +127 -0
  41. package/examples/deck/cdcl-sat-solver.md +124 -0
  42. package/examples/deck/chart-parser.md +157 -0
  43. package/examples/deck/clinical-trial-screening.md +155 -0
  44. package/examples/deck/clpb-boolean-circuit.md +123 -0
  45. package/examples/deck/clpb-cardinality.md +124 -0
  46. package/examples/deck/clpb-feature-model.md +122 -0
  47. package/examples/deck/clpb-weighted-planning.md +100 -0
  48. package/examples/deck/clpz-factorial.md +97 -0
  49. package/examples/deck/clpz-global-constraints.md +141 -0
  50. package/examples/deck/clpz-n-queens.md +121 -0
  51. package/examples/deck/clpz-resource-allocation.md +129 -0
  52. package/examples/deck/clpz-sudoku-9x9.md +121 -0
  53. package/examples/deck/collatz-1000.md +132 -0
  54. package/examples/deck/combinatorics-findall-sort.md +118 -0
  55. package/examples/deck/competitive-enzyme-kinetics.md +135 -0
  56. package/examples/deck/complex.md +123 -0
  57. package/examples/deck/composition-of-injective-functions-is-injective.md +147 -0
  58. package/examples/deck/context-association.md +148 -0
  59. package/examples/deck/context-schema-audit.md +141 -0
  60. package/examples/deck/continued-fraction-sqrt2.md +133 -0
  61. package/examples/deck/control-system.md +167 -0
  62. package/examples/deck/critical-path-schedule.md +152 -0
  63. package/examples/deck/cyclic-path.md +110 -0
  64. package/examples/deck/d3-group.md +132 -0
  65. package/examples/deck/dairy-energy-balance.md +137 -0
  66. package/examples/deck/data-negotiation.md +133 -0
  67. package/examples/deck/dcg-command-parser.md +129 -0
  68. package/examples/deck/dcg-expression-language.md +130 -0
  69. package/examples/deck/declarative-fault-localization.md +123 -0
  70. package/examples/deck/deep-taxonomy-10.md +107 -0
  71. package/examples/deck/deep-taxonomy-100.md +93 -0
  72. package/examples/deck/deep-taxonomy-1000.md +95 -0
  73. package/examples/deck/deep-taxonomy-10000.md +92 -0
  74. package/examples/deck/deep-taxonomy-100000.md +98 -0
  75. package/examples/deck/defeasible-reasoning.md +147 -0
  76. package/examples/deck/delfour.md +188 -0
  77. package/examples/deck/deontic-logic.md +146 -0
  78. package/examples/deck/derived-backward-rule.md +127 -0
  79. package/examples/deck/derived-rule.md +118 -0
  80. package/examples/deck/diamond-property.md +129 -0
  81. package/examples/deck/dif-constraints.md +107 -0
  82. package/examples/deck/dijkstra-findall-sort.md +130 -0
  83. package/examples/deck/dijkstra-risk-path.md +133 -0
  84. package/examples/deck/dijkstra.md +136 -0
  85. package/examples/deck/dining-philosophers.md +133 -0
  86. package/examples/deck/dog.md +120 -0
  87. package/examples/deck/donald-gerald-robert.md +145 -0
  88. package/examples/deck/dpv-odrl-purpose-mapping.md +131 -0
  89. package/examples/deck/drone-corridor-planner.md +125 -0
  90. package/examples/deck/easter-computus.md +143 -0
  91. package/examples/deck/electrical-rc-filter.md +126 -0
  92. package/examples/deck/enigma1225.md +124 -0
  93. package/examples/deck/epidemic-policy.md +140 -0
  94. package/examples/deck/equality-saturation.md +132 -0
  95. package/examples/deck/equivalence-classes-overlap-implies-same-class.md +114 -0
  96. package/examples/deck/eulerian-path.md +124 -0
  97. package/examples/deck/ev-range-worlds.md +137 -0
  98. package/examples/deck/evidence-demand-authority.md +136 -0
  99. package/examples/deck/existential-rule.md +94 -0
  100. package/examples/deck/exoplanet-validation-worlds.md +133 -0
  101. package/examples/deck/expression-eval.md +117 -0
  102. package/examples/deck/family-cousins.md +143 -0
  103. package/examples/deck/fast-fourier-transform.md +122 -0
  104. package/examples/deck/fastpow.md +121 -0
  105. package/examples/deck/fft8-numeric.md +125 -0
  106. package/examples/deck/fibonacci.md +155 -0
  107. package/examples/deck/field-nitrogen-balance.md +140 -0
  108. package/examples/deck/flandor.md +149 -0
  109. package/examples/deck/floating-point.md +107 -0
  110. package/examples/deck/four-color-map.md +137 -0
  111. package/examples/deck/fundamental-theorem-arithmetic.md +135 -0
  112. package/examples/deck/gd-step-certified.md +173 -0
  113. package/examples/deck/gdpr-compliance.md +137 -0
  114. package/examples/deck/goldbach.md +145 -0
  115. package/examples/deck/good-cobbler.md +92 -0
  116. package/examples/deck/gps.md +147 -0
  117. package/examples/deck/graph-reachability.md +121 -0
  118. package/examples/deck/graph.md +117 -0
  119. package/examples/deck/gray-code-counter.md +123 -0
  120. package/examples/deck/greatest-lower-bound-uniqueness.md +115 -0
  121. package/examples/deck/group-inverse-uniqueness.md +110 -0
  122. package/examples/deck/hamiltonian-path.md +137 -0
  123. package/examples/deck/hamming-code.md +148 -0
  124. package/examples/deck/hanoi.md +101 -0
  125. package/examples/deck/heat-loss.md +121 -0
  126. package/examples/deck/herbrand-semantics.md +100 -0
  127. package/examples/deck/herbrand-witnesses.md +122 -0
  128. package/examples/deck/heron-theorem.md +132 -0
  129. package/examples/deck/http-client.md +104 -0
  130. package/examples/deck/ideal-gas-law.md +120 -0
  131. package/examples/deck/illegitimate-reasoning.md +139 -0
  132. package/examples/deck/integer-partitions.md +122 -0
  133. package/examples/deck/integrity-check.md +109 -0
  134. package/examples/deck/intuitionistic-logic-kripke.md +135 -0
  135. package/examples/deck/iso-atomic-conversion.md +113 -0
  136. package/examples/deck/iso-control-and-errors.md +131 -0
  137. package/examples/deck/iso-dynamic-database.md +128 -0
  138. package/examples/deck/iso-extension-pipeline-audit.md +136 -0
  139. package/examples/deck/iso-extensions.md +113 -0
  140. package/examples/deck/iso-grouped-solutions.md +128 -0
  141. package/examples/deck/iso-integer-arithmetic.md +111 -0
  142. package/examples/deck/iso-operators.md +130 -0
  143. package/examples/deck/iso-reflective-terms.md +145 -0
  144. package/examples/deck/iso-term-io.md +134 -0
  145. package/examples/deck/job-shop-scheduling.md +123 -0
  146. package/examples/deck/json.md +114 -0
  147. package/examples/deck/knapsack-optimization.md +122 -0
  148. package/examples/deck/knights-tour-warnsdorff.md +134 -0
  149. package/examples/deck/knowledge-engineering-alignment-flow.md +133 -0
  150. package/examples/deck/knuth-bendix-completion.md +134 -0
  151. package/examples/deck/language.md +115 -0
  152. package/examples/deck/law-of-cosines.md +127 -0
  153. package/examples/deck/least-squares-regression.md +145 -0
  154. package/examples/deck/lee.md +126 -0
  155. package/examples/deck/linear-logic-resources.md +125 -0
  156. package/examples/deck/list-collection.md +129 -0
  157. package/examples/deck/lldm.md +140 -0
  158. package/examples/deck/manufacturing-quality-control.md +138 -0
  159. package/examples/deck/map-four-color-search.md +126 -0
  160. package/examples/deck/markov-logic-network.md +134 -0
  161. package/examples/deck/matrix-chain-order.md +137 -0
  162. package/examples/deck/matrix-noncommutativity.md +125 -0
  163. package/examples/deck/microgrid-dispatch.md +137 -0
  164. package/examples/deck/missionaries-cannibals.md +125 -0
  165. package/examples/deck/modal-logic-kripke.md +128 -0
  166. package/examples/deck/modular-exponentiation.md +143 -0
  167. package/examples/deck/monkey-bananas.md +138 -0
  168. package/examples/deck/network-sla.md +123 -0
  169. package/examples/deck/newton-raphson.md +146 -0
  170. package/examples/deck/nixon-diamond.md +125 -0
  171. package/examples/deck/observability-log-correlation.md +132 -0
  172. package/examples/deck/odrl-dpv-fpv-trust-flow.md +140 -0
  173. package/examples/deck/odrl-dpv-healthcare-risk-ranked.md +133 -0
  174. package/examples/deck/odrl-dpv-risk-ranked.md +138 -0
  175. package/examples/deck/odrl-policy-advanced.md +134 -0
  176. package/examples/deck/odrl-policy.md +129 -0
  177. package/examples/deck/orbital-transfer-design.md +136 -0
  178. package/examples/deck/partial-evaluator.md +139 -0
  179. package/examples/deck/path-discovery.md +128 -0
  180. package/examples/deck/peano-arithmetic.md +118 -0
  181. package/examples/deck/peano-calculus.md +122 -0
  182. package/examples/deck/peasant.md +129 -0
  183. package/examples/deck/pell-equation.md +132 -0
  184. package/examples/deck/pendulum-period.md +144 -0
  185. package/examples/deck/pi.md +110 -0
  186. package/examples/deck/pointer-analysis.md +143 -0
  187. package/examples/deck/polynomial.md +151 -0
  188. package/examples/deck/portable-library-overlap.md +140 -0
  189. package/examples/deck/prime-range.md +133 -0
  190. package/examples/deck/proof-contrapositive.md +114 -0
  191. package/examples/deck/propositional-dynamic-logic.md +133 -0
  192. package/examples/deck/quadratic-formula.md +116 -0
  193. package/examples/deck/quine-mccluskey.md +165 -0
  194. package/examples/deck/radioactive-decay.md +123 -0
  195. package/examples/deck/rdf12-annotated-claims.md +144 -0
  196. package/examples/deck/rdf12-annotation.md +131 -0
  197. package/examples/deck/rdf12-directional-language.md +103 -0
  198. package/examples/deck/rdf12-nested-triple-term.md +106 -0
  199. package/examples/deck/rdf12-trig-graph-join.md +109 -0
  200. package/examples/deck/rdf12-trig-named-graph.md +108 -0
  201. package/examples/deck/rdf12-trig-triple-term.md +107 -0
  202. package/examples/deck/rdf12-triple-term.md +118 -0
  203. package/examples/deck/register-allocation.md +148 -0
  204. package/examples/deck/reified-conditionals.md +120 -0
  205. package/examples/deck/relational-cube-lookup.md +122 -0
  206. package/examples/deck/reusable-builtins.md +127 -0
  207. package/examples/deck/riemann-hypothesis.md +138 -0
  208. package/examples/deck/route-planning.md +117 -0
  209. package/examples/deck/sat-solver-dpll.md +128 -0
  210. package/examples/deck/security-incident-correlation.md +129 -0
  211. package/examples/deck/send-more-money.md +128 -0
  212. package/examples/deck/service-impact.md +133 -0
  213. package/examples/deck/shoelace-polygon-area.md +121 -0
  214. package/examples/deck/sieve.md +127 -0
  215. package/examples/deck/skolem-functions.md +125 -0
  216. package/examples/deck/snaf.md +89 -0
  217. package/examples/deck/socrates.md +102 -0
  218. package/examples/deck/spacecraft-battery-diagnosis.md +136 -0
  219. package/examples/deck/stable-marriage.md +121 -0
  220. package/examples/deck/statistics-summary.md +144 -0
  221. package/examples/deck/stirling-bell-numbers.md +130 -0
  222. package/examples/deck/superdense-coding.md +149 -0
  223. package/examples/deck/symbolic-derivative.md +115 -0
  224. package/examples/deck/takeuchi.md +105 -0
  225. package/examples/deck/term-tools.md +125 -0
  226. package/examples/deck/totient-summatory.md +111 -0
  227. package/examples/deck/trust-flow-provenance-threshold.md +125 -0
  228. package/examples/deck/truth-maintenance-system.md +129 -0
  229. package/examples/deck/turing.md +121 -0
  230. package/examples/deck/type-inference.md +125 -0
  231. package/examples/deck/universal-vs-existential-termination.md +98 -0
  232. package/examples/deck/uuid.md +98 -0
  233. package/examples/deck/vanilla-meta-interpreter.md +119 -0
  234. package/examples/deck/vector-similarity.md +107 -0
  235. package/examples/deck/vulnerability-impact.md +129 -0
  236. package/examples/deck/web-names.md +115 -0
  237. package/examples/deck/weighted-interval-scheduling.md +128 -0
  238. package/examples/deck/witch.md +140 -0
  239. package/examples/deck/wolf-goat-cabbage.md +152 -0
  240. package/examples/deck/workplace-compliance.md +147 -0
  241. package/examples/deck/zebra.md +142 -0
  242. package/examples/delfour.pl +20 -9
  243. package/examples/flandor.pl +18 -8
  244. package/examples/gd-step-certified.pl +12 -8
  245. package/examples/gps.pl +3 -2
  246. package/examples/hamiltonian-path.pl +3 -2
  247. package/examples/iso-integer-arithmetic.pl +3 -2
  248. package/examples/lldm.pl +3 -1
  249. package/examples/output/auroracare.pl +1 -1
  250. package/examples/output/chart-parser.pl +1 -1
  251. package/examples/output/composition-of-injective-functions-is-injective.pl +5 -2
  252. package/examples/output/delfour.pl +1 -1
  253. package/examples/output/flandor.pl +2 -2
  254. package/examples/output/gd-step-certified.pl +80 -70
  255. package/examples/proof/auroracare.pl +252 -222
  256. package/examples/proof/chart-parser.pl +27 -16
  257. package/examples/proof/composition-of-injective-functions-is-injective.pl +71 -72
  258. package/examples/proof/delfour.pl +347 -347
  259. package/examples/proof/flandor.pl +37 -15
  260. package/examples/proof/gd-step-certified.pl +1256 -1157
  261. package/examples/proof/lldm.pl +11 -3
  262. package/examples/proof/quine-mccluskey.pl +171 -165
  263. package/examples/quine-mccluskey.pl +10 -3
  264. package/package.json +1 -1
  265. package/src/cli.js +1 -1
  266. package/src/execute.js +12 -0
  267. package/src/index.js +2 -2
  268. package/src/solver.js +9 -10
  269. package/test/goal-metadata.mjs +0 -14
  270. package/test/regression/cases-white-box.mjs +24 -0
  271. package/test/run-examples.mjs +2 -2
  272. package/the-art-of-eyeprolog.md +566 -154
@@ -231,6 +231,7 @@ research_policy_match(S) :-
231
231
  environment(S, "secure_env"),
232
232
  tom(S, anonymisation),
233
233
  subject_opt_in(S),
234
+ \+ subject_opt_out(S),
234
235
  category(S, labResults).
235
236
 
236
237
  insurance_prohibition_match(S) :-
@@ -241,18 +242,30 @@ ai_training_opt_out_match(S) :-
241
242
  purpose(S, trainTestAndEvaluateAiSystemsAlgorithms),
242
243
  subject_opt_out(S).
243
244
 
245
+ % A scenario is permitted when some permission policy matches, and prohibited
246
+ % when a prohibition or the subject's opt-out applies.
247
+ permission_match(S) :- primary_policy_match(S).
248
+ permission_match(S) :- qi_policy_match(S).
249
+ permission_match(S) :- research_policy_match(S).
250
+
251
+ prohibition_match(S) :- insurance_prohibition_match(S).
252
+ prohibition_match(S) :- subject_opt_out(S).
253
+
254
+ % Deny by default: neither a permission nor a prohibition applies.
255
+ no_policy_match(S) :-
256
+ scenario(S),
257
+ \+ permission_match(S),
258
+ \+ prohibition_match(S).
259
+
244
260
  careTeamLinked(S, true) :- care_team_linked(S).
245
261
  subjectOptIn(S, true) :- subject_opt_in(S).
246
262
  subjectOptOut(S, true) :- subject_opt_out(S).
247
263
 
248
- % Permit when a scenario satisfies one of the allowed policy branches.
249
- decision(S, "PERMIT") :- primary_policy_match(S).
250
- decision(S, "PERMIT") :- qi_policy_match(S).
251
- decision(S, "PERMIT") :- research_policy_match(S).
252
- % Deny branches preserve the reason that will be queried for the report.
253
- decision(S, "DENY") :- insurance_prohibition_match(S).
254
- decision(S, "DENY") :- ai_training_opt_out_match(S).
255
- decision(scenarioC, "DENY") :- purpose(scenarioC, ensureQualitySafetyHealthcare).
264
+ % Permit when a permission matches and no prohibition applies; a prohibition
265
+ % always denies, and a scenario that matches nothing is denied by default.
266
+ decision(S, "PERMIT") :- permission_match(S), \+ prohibition_match(S).
267
+ decision(S, "DENY") :- prohibition_match(S).
268
+ decision(S, "DENY") :- no_policy_match(S).
256
269
 
257
270
  matchedPolicyUid(S, Uid) :- primary_policy_match(S), policyUid(policyPrimary, Uid).
258
271
  matchedPolicyUid(S, Uid) :- qi_policy_match(S), policyUid(policyQi, Uid).
@@ -264,7 +277,8 @@ reason(S, "Permitted: ODRL/DPV policy matched for secondary use.") :- qi_policy_
264
277
  reason(S, "Permitted: subject opted in and an ODRL/DPV policy matched (anonymised dataset in secure environment).") :- research_policy_match(S).
265
278
  reason(S, "Denied: the requested purpose (insurance management) is prohibited by policy.") :- insurance_prohibition_match(S).
266
279
  reason(S, "Denied: you opted out of your data being used to train AI systems.") :- ai_training_opt_out_match(S).
267
- reason(scenarioC, "Denied: no policy matched (purpose, environment, TOMs, or categories out of scope).") :- purpose(scenarioC, ensureQualitySafetyHealthcare).
280
+ reason(S, "Denied: the subject opted out of this purpose.") :- subject_opt_out(S), \+ ai_training_opt_out_match(S).
281
+ reason(S, "Denied: no policy matched (purpose, environment, TOMs, or categories out of scope).") :- no_policy_match(S).
268
282
 
269
283
  trace(S, "permit:primary_care_allowed") :- primary_policy_match(S).
270
284
  trace(S, "urn:policy:primary-care-001:permit:odrl:permission_matched") :- primary_policy_match(S).
@@ -273,7 +287,8 @@ trace(S, "urn:policy:research-aurora-diabetes:permit:odrl:permission_matched") :
273
287
  trace(S, "deny:prohibited_purpose") :- insurance_prohibition_match(S).
274
288
  trace(S, "urn:policy:deny-insurance:deny:odrl:prohibition_matched") :- insurance_prohibition_match(S).
275
289
  trace(S, "deny:subject_opted_out_ai_training") :- ai_training_opt_out_match(S).
276
- trace(scenarioC, "urn:policy:qi-2025-aurora:deny:odrl:no_permission_matched") :- purpose(scenarioC, ensureQualitySafetyHealthcare).
290
+ trace(S, "deny:subject_opted_out") :- subject_opt_out(S), \+ ai_training_opt_out_match(S).
291
+ trace(S, "deny:no_permission_matched") :- no_policy_match(S).
277
292
 
278
293
  % C1-C10 below are the ARC-style checklist lines from the upstream output.
279
294
  checkC1(scenarioA, "SKIPPED - not a prohibited purpose") :- decision(scenarioA, "PERMIT").
@@ -12,7 +12,9 @@
12
12
 
13
13
 
14
14
 
15
- % Two sample sentences share the same tiny grammar but have different parse counts.
15
+ % Two sample sentences share the same tiny grammar. The second is ambiguous: the
16
+ % prepositional phrase "with the telescope" can attach to "the box" or to "sees
17
+ % the box", so it has two parse trees where the first has one.
16
18
 
17
19
  sentence(command, 5).
18
20
  sentence(ambiguous_pp, 8).
@@ -58,12 +60,32 @@ span(Sentence, Category, Start, End) :-
58
60
  span(Sentence, Left, Start, Middle),
59
61
  span(Sentence, Right, Middle, End).
60
62
 
63
+ % The chart says which items exist; it stores each item once, however many ways
64
+ % it can be built. Counting parse trees therefore needs its own relation: an
65
+ % item's tree count is the sum, over every way to build it, of the product of
66
+ % its parts' counts. Each recursive call covers a strictly shorter interval, so
67
+ % the counting terminates without tabling.
68
+ parse_trees(Sentence, Category, Start, End, Count) :-
69
+ sumall(N, tree_count(Sentence, Category, Start, End, N), Count).
70
+
71
+ tree_count(Sentence, Category, Start, End, 1) :-
72
+ word(Sentence, Start, Token),
73
+ terminal(Category, Token),
74
+ (End =:= Start + 1).
75
+ tree_count(Sentence, Category, Start, End, N) :-
76
+ rule(Category, Left, Right),
77
+ span(Sentence, Left, Start, Middle),
78
+ span(Sentence, Right, Middle, End),
79
+ parse_trees(Sentence, Left, Start, Middle, LeftCount),
80
+ parse_trees(Sentence, Right, Middle, End, RightCount),
81
+ (N is LeftCount * RightCount).
82
+
61
83
  chart_parser_answer(parsed, Sentence) :-
62
84
  sentence(Sentence, Length),
63
85
  span(Sentence, s, 0, Length).
64
86
  chart_parser_answer(parse_count, count(Sentence, Count)) :-
65
87
  sentence(Sentence, Length),
66
- countall(span(Sentence, s, 0, Length), Count).
88
+ parse_trees(Sentence, s, 0, Length, Count).
67
89
  chart_parser_answer(noun_phrase_count, count(Sentence, Count)) :-
68
90
  sentence(Sentence, Length),
69
91
  countall(span(Sentence, np, _start, _end), Count),
@@ -1,14 +1,21 @@
1
- condition('C1', resolution, ok, 174).
2
- condition('C2', well_founded, ok, 174).
3
- condition('C3', justification, ok, 174).
4
- condition('C4', coverage, ok, 273).
1
+ condition('C1', resolution, ok, 181).
2
+ condition('C2', well_founded, ok, 188).
3
+ condition('C3', justification, ok, 188).
4
+ condition('C4', coverage, ok, 287).
5
5
  condition('C5', re_decision, ok, 0).
6
- condition('C6', boundary_consistency, ok, 0).
7
- condition('C7', relevance, ok, 291).
8
- steps(174).
9
- verified(174).
6
+ condition('C6', boundary_consistency, ok, 6).
7
+ condition('C7', relevance, ok, 305).
8
+ obligation(absent, theory_scoped, \+ prohibition_match(scenarioA)).
9
+ obligation(absent, theory_scoped, \+ prohibition_match(scenarioE)).
10
+ obligation(absent, theory_scoped, \+ prohibition_match(scenarioB)).
11
+ obligation(absent, theory_scoped, \+ subject_opt_out(scenarioF)).
12
+ obligation(absent, theory_scoped, \+ prohibition_match(scenarioF)).
13
+ obligation(absent, theory_scoped, \+ permission_match(scenarioC)).
14
+ obligation(absent, theory_scoped, \+ prohibition_match(scenarioC)).
15
+ steps(188).
16
+ verified(181).
10
17
  recomputed(0).
11
18
  composed(0).
12
- trusted(0).
19
+ trusted(7).
13
20
  claims(117).
14
- verdict(checked).
21
+ verdict(checked_with_obligations).
@@ -1,16 +1,16 @@
1
- condition('C1', resolution, ok, 57).
2
- condition('C2', well_founded, ok, 71).
3
- condition('C3', justification, ok, 71).
4
- condition('C4', coverage, ok, 92).
1
+ condition('C1', resolution, ok, 59).
2
+ condition('C2', well_founded, ok, 73).
3
+ condition('C3', justification, ok, 73).
4
+ condition('C4', coverage, ok, 94).
5
5
  condition('C5', re_decision, ok, 10).
6
6
  condition('C6', boundary_consistency, ok, 0).
7
- condition('C7', relevance, ok, 77).
8
- obligation(builtin, theory_scoped, countall(span(command, s, 0, 5), 1)).
9
- obligation(builtin, theory_scoped, countall(span(ambiguous_pp, s, 0, 8), 1)).
7
+ condition('C7', relevance, ok, 79).
8
+ obligation(builtin, theory_scoped, sumall(A, tree_count(command, s, 0, 5, A), 1)).
9
+ obligation(builtin, theory_scoped, sumall(A, tree_count(ambiguous_pp, s, 0, 8, A), 2)).
10
10
  obligation(builtin, theory_scoped, countall(span(command, np, A, B), 2)).
11
11
  obligation(builtin, theory_scoped, countall(span(ambiguous_pp, np, A, B), 4)).
12
- steps(71).
13
- verified(57).
12
+ steps(73).
13
+ verified(59).
14
14
  recomputed(10).
15
15
  composed(0).
16
16
  trusted(4).
@@ -1,14 +1,17 @@
1
- condition('C1', resolution, ok, 16).
2
- condition('C2', well_founded, ok, 19).
3
- condition('C3', justification, ok, 19).
1
+ condition('C1', resolution, ok, 19).
2
+ condition('C2', well_founded, ok, 26).
3
+ condition('C3', justification, ok, 26).
4
4
  condition('C4', coverage, ok, 33).
5
- condition('C5', re_decision, ok, 3).
5
+ condition('C5', re_decision, ok, 4).
6
6
  condition('C6', boundary_consistency, ok, 0).
7
- condition('C7', relevance, ok, 21).
8
- steps(19).
9
- verified(16).
10
- recomputed(3).
7
+ condition('C7', relevance, ok, 31).
8
+ obligation(absent, theory_scoped, \+ collision(g, A, B)).
9
+ obligation(absent, theory_scoped, \+ collision(f, A, B)).
10
+ obligation(absent, theory_scoped, \+ collision(h, A, B)).
11
+ steps(26).
12
+ verified(19).
13
+ recomputed(4).
11
14
  composed(0).
12
- trusted(0).
13
- claims(2).
14
- verdict(checked).
15
+ trusted(3).
16
+ claims(5).
17
+ verdict(checked_with_obligations).
@@ -1,14 +1,14 @@
1
- condition('C1', resolution, ok, 243).
2
- condition('C2', well_founded, ok, 295).
3
- condition('C3', justification, ok, 295).
4
- condition('C4', coverage, ok, 354).
1
+ condition('C1', resolution, ok, 244).
2
+ condition('C2', well_founded, ok, 296).
3
+ condition('C3', justification, ok, 296).
4
+ condition('C4', coverage, ok, 353).
5
5
  condition('C5', re_decision, ok, 50).
6
6
  condition('C6', boundary_consistency, ok, 2).
7
- condition('C7', relevance, ok, 326).
8
- obligation(absent, theory_scoped, \+ better_lower_sugar(120, 30)).
7
+ condition('C7', relevance, ok, 327).
8
+ obligation(absent, theory_scoped, \+ better_lower_sugar(biscuits, 120, 30)).
9
9
  obligation(absent, theory_scoped, \+ matches('createdat expiresat insight metric sugar_g_per_serving retailer delfour scopedevice self-scanner scopeevent pick_up_scanner', 'diabetes|medical')).
10
- steps(295).
11
- verified(243).
10
+ steps(296).
11
+ verified(244).
12
12
  recomputed(50).
13
13
  composed(0).
14
14
  trusted(2).
@@ -1,15 +1,15 @@
1
1
  condition('C1', resolution, ok, 97).
2
- condition('C2', well_founded, ok, 105).
3
- condition('C3', justification, ok, 105).
4
- condition('C4', coverage, ok, 153).
5
- condition('C5', re_decision, ok, 6).
2
+ condition('C2', well_founded, ok, 107).
3
+ condition('C3', justification, ok, 107).
4
+ condition('C4', coverage, ok, 157).
5
+ condition('C5', re_decision, ok, 8).
6
6
  condition('C6', boundary_consistency, ok, 2).
7
- condition('C7', relevance, ok, 148).
7
+ condition('C7', relevance, ok, 150).
8
8
  obligation(absent, theory_scoped, \+ lower_cost_eligible_package(120)).
9
9
  obligation(absent, theory_scoped, \+ matches('createdat expiresat insight metric regional_retooling_priority region flanders scopedevice economic-resilience-board scopeevent budget-prep-window suggestionpolicy lowest_cost_package_covering_all_active_needs threshold 3', 'salary|payroll|invoice|medical|firmname')).
10
- steps(105).
10
+ steps(107).
11
11
  verified(97).
12
- recomputed(6).
12
+ recomputed(8).
13
13
  composed(0).
14
14
  trusted(2).
15
15
  claims(43).
@@ -1,14 +1,14 @@
1
- condition('C1', resolution, ok, 191).
2
- condition('C2', well_founded, ok, 369).
3
- condition('C3', justification, ok, 369).
4
- condition('C4', coverage, ok, 678).
5
- condition('C5', re_decision, ok, 178).
1
+ condition('C1', resolution, ok, 211).
2
+ condition('C2', well_founded, ok, 398).
3
+ condition('C3', justification, ok, 398).
4
+ condition('C4', coverage, ok, 718).
5
+ condition('C5', re_decision, ok, 187).
6
6
  condition('C6', boundary_consistency, ok, 0).
7
- condition('C7', relevance, ok, 448).
8
- steps(369).
9
- verified(191).
10
- recomputed(178).
7
+ condition('C7', relevance, ok, 487).
8
+ steps(398).
9
+ verified(211).
10
+ recomputed(187).
11
11
  composed(0).
12
12
  trusted(0).
13
- claims(79).
13
+ claims(89).
14
14
  verdict(checked).
@@ -1,7 +1,7 @@
1
1
  condition('C1', resolution, ok, 53).
2
2
  condition('C2', well_founded, ok, 92).
3
3
  condition('C3', justification, ok, 92).
4
- condition('C4', coverage, ok, 160).
4
+ condition('C4', coverage, ok, 164).
5
5
  condition('C5', re_decision, ok, 39).
6
6
  condition('C6', boundary_consistency, ok, 0).
7
7
  condition('C7', relevance, ok, 98).
@@ -1,10 +1,10 @@
1
1
  condition('C1', resolution, ok, 145).
2
- condition('C2', well_founded, ok, 242).
3
- condition('C3', justification, ok, 242).
4
- condition('C4', coverage, ok, 307).
2
+ condition('C2', well_founded, ok, 243).
3
+ condition('C3', justification, ok, 243).
4
+ condition('C4', coverage, ok, 308).
5
5
  condition('C5', re_decision, ok, 76).
6
6
  condition('C6', boundary_consistency, ok, 1).
7
- condition('C7', relevance, ok, 249).
7
+ condition('C7', relevance, ok, 250).
8
8
  obligation(asserted, theory_scoped, solution_cache(["00xx", "0xx1", "xx11"], ["00xx", "xx11"])).
9
9
  obligation(collected, theory_scoped, findall(A, (member(B, ["00xx", "xx11"]), term_sop(B, A)), ['~A~B', 'CD'])).
10
10
  obligation(collected, theory_scoped, findall(A, minterm(A), [1, 3, 7, 11, 15])).
@@ -25,11 +25,12 @@ obligation(absent, theory_scoped, \+ covers_int("00xx", 13)).
25
25
  obligation(absent, theory_scoped, \+ covers_int("xx11", 13)).
26
26
  obligation(absent, theory_scoped, \+ covers_int("00xx", 14)).
27
27
  obligation(absent, theory_scoped, \+ covers_int("xx11", 14)).
28
+ obligation(absent, theory_scoped, \+ smaller_cover(["00xx", "0xx1", "xx11"], [1, 3, 7, 11, 15], 1, A)).
28
29
  obligation(collected, theory_scoped, findall(A, (find_combination(2, ["00xx", "0xx1", "xx11"], A), covers_all(A, [1, 3, 7, 11, 15])), [["00xx", "xx11"], ["00xx", "xx11"], ["0xx1", "xx11"], ["0xx1", "xx11"], ["0xx1", "xx11"], ["0xx1", "xx11"]])).
29
- steps(242).
30
+ steps(243).
30
31
  verified(145).
31
32
  recomputed(76).
32
33
  composed(0).
33
- trusted(21).
34
+ trusted(22).
34
35
  claims(7).
35
36
  verdict(checked_with_obligations).
@@ -1,53 +1,61 @@
1
1
  % Composition of injective functions is injective.
2
2
  %
3
+ % A function is injective when no two distinct inputs share an output. The
4
+ % finite model below checks that property for f, g, and their composite
5
+ % h = g o f, and derives that the composite inherits it. A second composite
6
+ % h2 = g2 o f, built from a g2 that is not injective, shows that the premise
7
+ % matters: h2 has a collision, so no injectivity is derived for it.
8
+ %
3
9
  % The output is:
4
- % sameInputByCompositeInjectivity(h, a, b) and the symmetric counterpart.
10
+ % compositeInjective(h, g, f), and the collisions of g2 and h2.
5
11
 
6
12
  % Output declarations: host-supplied goals select the relations written to this example's golden output.
7
- %% ?- sameInputByCompositeInjectivity(X0, X1, X2).
13
+ %% ?- compositeInjective(X0, X1, X2).
14
+
15
+ %% ?- collision(X0, X1, X2).
8
16
 
9
17
 
10
18
  :- discontiguous(app/3).
11
- :- discontiguous(sameTerm/2).
12
19
 
13
20
  % Program structure: facts set up the scenario, and rules derive the queried conclusions.
14
- inX(a).
15
- inX(b).
16
- inY(c).
17
- inY(d).
18
- inZ(e).
19
-
20
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
21
- sameTerm(X, X) :- inX(X).
22
- sameTerm(X, X) :- inY(X).
23
- sameTerm(X, X) :- inZ(X).
24
- sameTerm(Y, X) :- Y @< X, sameTerm(X, Y).
21
+ function(f).
22
+ function(g).
23
+ function(g2).
24
+ function(h).
25
+ function(h2).
25
26
 
27
+ % f maps a and b to distinct points; g and g2 map c and d onward.
26
28
  app(f, a, c).
27
29
  app(f, b, d).
28
30
  app(g, c, e).
29
- app(g, d, e).
31
+ app(g, d, k).
32
+ app(g2, c, e).
33
+ app(g2, d, e).
30
34
 
31
- injective(f).
32
- injective(g).
33
35
  compositeOf(h, g, f).
36
+ compositeOf(h2, g2, f).
34
37
 
38
+ % Derivation rules: each rule below contributes one logical step toward the displayed results.
39
+ % The composite applies F first and then G.
35
40
  app(H, X, Z) :-
36
41
  compositeOf(H, G, F),
37
42
  app(F, X, Y),
38
43
  app(G, Y, Z).
39
44
 
40
- sameTerm(X, Y) :-
41
- injective(F),
42
- app(F, X, U),
43
- app(F, Y, V),
44
- sameTerm(U, V).
45
+ % A collision is a witness against injectivity: two distinct inputs, one output.
46
+ collision(F, X, Y) :-
47
+ app(F, X, Z),
48
+ app(F, Y, Z),
49
+ (X \= Y).
45
50
 
46
- sameInputByCompositeInjectivity(H, X, Y) :-
51
+ % A function is injective in this finite model when it has no collision.
52
+ injective(F) :-
53
+ function(F),
54
+ \+ collision(F, _, _).
55
+
56
+ % The theorem instance: both parts are injective, and so is their composite.
57
+ compositeInjective(H, G, F) :-
47
58
  compositeOf(H, G, F),
48
59
  injective(G),
49
60
  injective(F),
50
- app(H, X, Z),
51
- app(H, Y, Z),
52
- sameTerm(X, Y),
53
- (X \= Y).
61
+ injective(H).