eyeprolog 1.6.36 → 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.
- package/examples/auroracare.pl +25 -10
- package/examples/chart-parser.pl +24 -2
- package/examples/check/auroracare.pl +17 -10
- package/examples/check/chart-parser.pl +9 -9
- package/examples/check/composition-of-injective-functions-is-injective.pl +14 -11
- package/examples/check/delfour.pl +8 -8
- package/examples/check/flandor.pl +7 -7
- package/examples/check/gd-step-certified.pl +10 -10
- package/examples/check/lldm.pl +1 -1
- package/examples/check/quine-mccluskey.pl +7 -6
- package/examples/composition-of-injective-functions-is-injective.pl +35 -27
- package/examples/deck/README.md +242 -9
- package/examples/deck/abstract-interpretation.md +138 -0
- package/examples/deck/access-control-policy.md +137 -0
- package/examples/deck/ackermann.md +144 -0
- package/examples/deck/age.md +108 -0
- package/examples/deck/aliases-and-namespaces.md +114 -0
- package/examples/deck/alignment-demo.md +131 -0
- package/examples/deck/allen-interval-calculus.md +143 -0
- package/examples/deck/ancestor.md +125 -0
- package/examples/deck/animal.md +109 -0
- package/examples/deck/annotation.md +122 -0
- package/examples/deck/attributed-variables.md +127 -0
- package/examples/deck/auroracare.md +170 -0
- package/examples/deck/backward.md +96 -0
- package/examples/deck/basic-monadic.md +139 -0
- package/examples/deck/bayes-diagnosis.md +146 -0
- package/examples/deck/bayes-therapy.md +147 -0
- package/examples/deck/beam-deflection.md +134 -0
- package/examples/deck/bench.md +123 -0
- package/examples/deck/binomial-vandermonde.md +137 -0
- package/examples/deck/blocks-world-planning.md +134 -0
- package/examples/deck/bmi.md +125 -0
- package/examples/deck/braking-safety-worlds.md +138 -0
- package/examples/deck/buck-converter-design.md +132 -0
- package/examples/deck/bulk-stream-write.md +133 -0
- package/examples/deck/cache-performance.md +127 -0
- package/examples/deck/canary-release.md +115 -0
- package/examples/deck/cat-koko.md +101 -0
- package/examples/deck/catalan-convolution.md +127 -0
- package/examples/deck/cdcl-sat-solver.md +124 -0
- package/examples/deck/chart-parser.md +157 -0
- package/examples/deck/clinical-trial-screening.md +155 -0
- package/examples/deck/clpb-boolean-circuit.md +123 -0
- package/examples/deck/clpb-cardinality.md +124 -0
- package/examples/deck/clpb-feature-model.md +122 -0
- package/examples/deck/clpb-weighted-planning.md +100 -0
- package/examples/deck/clpz-factorial.md +97 -0
- package/examples/deck/clpz-global-constraints.md +141 -0
- package/examples/deck/clpz-n-queens.md +121 -0
- package/examples/deck/clpz-resource-allocation.md +129 -0
- package/examples/deck/clpz-sudoku-9x9.md +121 -0
- package/examples/deck/collatz-1000.md +132 -0
- package/examples/deck/combinatorics-findall-sort.md +118 -0
- package/examples/deck/competitive-enzyme-kinetics.md +135 -0
- package/examples/deck/complex.md +123 -0
- package/examples/deck/composition-of-injective-functions-is-injective.md +147 -0
- package/examples/deck/context-association.md +148 -0
- package/examples/deck/context-schema-audit.md +141 -0
- package/examples/deck/continued-fraction-sqrt2.md +133 -0
- package/examples/deck/control-system.md +167 -0
- package/examples/deck/critical-path-schedule.md +152 -0
- package/examples/deck/cyclic-path.md +110 -0
- package/examples/deck/d3-group.md +132 -0
- package/examples/deck/dairy-energy-balance.md +137 -0
- package/examples/deck/data-negotiation.md +133 -0
- package/examples/deck/dcg-command-parser.md +129 -0
- package/examples/deck/dcg-expression-language.md +130 -0
- package/examples/deck/declarative-fault-localization.md +123 -0
- package/examples/deck/deep-taxonomy-10.md +107 -0
- package/examples/deck/deep-taxonomy-100.md +93 -0
- package/examples/deck/deep-taxonomy-1000.md +95 -0
- package/examples/deck/deep-taxonomy-10000.md +92 -0
- package/examples/deck/deep-taxonomy-100000.md +98 -0
- package/examples/deck/defeasible-reasoning.md +147 -0
- package/examples/deck/delfour.md +188 -0
- package/examples/deck/deontic-logic.md +146 -0
- package/examples/deck/derived-backward-rule.md +127 -0
- package/examples/deck/derived-rule.md +118 -0
- package/examples/deck/diamond-property.md +129 -0
- package/examples/deck/dif-constraints.md +107 -0
- package/examples/deck/dijkstra-findall-sort.md +130 -0
- package/examples/deck/dijkstra-risk-path.md +133 -0
- package/examples/deck/dijkstra.md +136 -0
- package/examples/deck/dining-philosophers.md +133 -0
- package/examples/deck/dog.md +120 -0
- package/examples/deck/donald-gerald-robert.md +145 -0
- package/examples/deck/dpv-odrl-purpose-mapping.md +131 -0
- package/examples/deck/drone-corridor-planner.md +125 -0
- package/examples/deck/easter-computus.md +143 -0
- package/examples/deck/electrical-rc-filter.md +126 -0
- package/examples/deck/enigma1225.md +124 -0
- package/examples/deck/epidemic-policy.md +140 -0
- package/examples/deck/equality-saturation.md +132 -0
- package/examples/deck/equivalence-classes-overlap-implies-same-class.md +114 -0
- package/examples/deck/eulerian-path.md +124 -0
- package/examples/deck/ev-range-worlds.md +137 -0
- package/examples/deck/evidence-demand-authority.md +136 -0
- package/examples/deck/existential-rule.md +94 -0
- package/examples/deck/exoplanet-validation-worlds.md +133 -0
- package/examples/deck/expression-eval.md +117 -0
- package/examples/deck/family-cousins.md +143 -0
- package/examples/deck/fast-fourier-transform.md +122 -0
- package/examples/deck/fastpow.md +121 -0
- package/examples/deck/fft8-numeric.md +125 -0
- package/examples/deck/fibonacci.md +155 -0
- package/examples/deck/field-nitrogen-balance.md +140 -0
- package/examples/deck/flandor.md +149 -0
- package/examples/deck/floating-point.md +107 -0
- package/examples/deck/four-color-map.md +137 -0
- package/examples/deck/fundamental-theorem-arithmetic.md +135 -0
- package/examples/deck/gd-step-certified.md +173 -0
- package/examples/deck/gdpr-compliance.md +137 -0
- package/examples/deck/goldbach.md +145 -0
- package/examples/deck/good-cobbler.md +92 -0
- package/examples/deck/gps.md +147 -0
- package/examples/deck/graph-reachability.md +121 -0
- package/examples/deck/graph.md +117 -0
- package/examples/deck/gray-code-counter.md +123 -0
- package/examples/deck/greatest-lower-bound-uniqueness.md +115 -0
- package/examples/deck/group-inverse-uniqueness.md +110 -0
- package/examples/deck/hamiltonian-path.md +137 -0
- package/examples/deck/hamming-code.md +148 -0
- package/examples/deck/hanoi.md +101 -0
- package/examples/deck/heat-loss.md +121 -0
- package/examples/deck/herbrand-semantics.md +100 -0
- package/examples/deck/herbrand-witnesses.md +122 -0
- package/examples/deck/heron-theorem.md +132 -0
- package/examples/deck/http-client.md +104 -0
- package/examples/deck/ideal-gas-law.md +120 -0
- package/examples/deck/illegitimate-reasoning.md +139 -0
- package/examples/deck/integer-partitions.md +122 -0
- package/examples/deck/integrity-check.md +109 -0
- package/examples/deck/intuitionistic-logic-kripke.md +135 -0
- package/examples/deck/iso-atomic-conversion.md +113 -0
- package/examples/deck/iso-control-and-errors.md +131 -0
- package/examples/deck/iso-dynamic-database.md +128 -0
- package/examples/deck/iso-extension-pipeline-audit.md +136 -0
- package/examples/deck/iso-extensions.md +113 -0
- package/examples/deck/iso-grouped-solutions.md +128 -0
- package/examples/deck/iso-integer-arithmetic.md +111 -0
- package/examples/deck/iso-operators.md +130 -0
- package/examples/deck/iso-reflective-terms.md +145 -0
- package/examples/deck/iso-term-io.md +134 -0
- package/examples/deck/job-shop-scheduling.md +123 -0
- package/examples/deck/json.md +114 -0
- package/examples/deck/knapsack-optimization.md +122 -0
- package/examples/deck/knights-tour-warnsdorff.md +134 -0
- package/examples/deck/knowledge-engineering-alignment-flow.md +133 -0
- package/examples/deck/knuth-bendix-completion.md +134 -0
- package/examples/deck/language.md +115 -0
- package/examples/deck/law-of-cosines.md +127 -0
- package/examples/deck/least-squares-regression.md +145 -0
- package/examples/deck/lee.md +126 -0
- package/examples/deck/linear-logic-resources.md +125 -0
- package/examples/deck/list-collection.md +129 -0
- package/examples/deck/lldm.md +140 -0
- package/examples/deck/manufacturing-quality-control.md +138 -0
- package/examples/deck/map-four-color-search.md +126 -0
- package/examples/deck/markov-logic-network.md +134 -0
- package/examples/deck/matrix-chain-order.md +137 -0
- package/examples/deck/matrix-noncommutativity.md +125 -0
- package/examples/deck/microgrid-dispatch.md +137 -0
- package/examples/deck/missionaries-cannibals.md +125 -0
- package/examples/deck/modal-logic-kripke.md +128 -0
- package/examples/deck/modular-exponentiation.md +143 -0
- package/examples/deck/monkey-bananas.md +138 -0
- package/examples/deck/network-sla.md +123 -0
- package/examples/deck/newton-raphson.md +146 -0
- package/examples/deck/nixon-diamond.md +125 -0
- package/examples/deck/observability-log-correlation.md +132 -0
- package/examples/deck/odrl-dpv-fpv-trust-flow.md +140 -0
- package/examples/deck/odrl-dpv-healthcare-risk-ranked.md +133 -0
- package/examples/deck/odrl-dpv-risk-ranked.md +138 -0
- package/examples/deck/odrl-policy-advanced.md +134 -0
- package/examples/deck/odrl-policy.md +129 -0
- package/examples/deck/orbital-transfer-design.md +136 -0
- package/examples/deck/partial-evaluator.md +139 -0
- package/examples/deck/path-discovery.md +128 -0
- package/examples/deck/peano-arithmetic.md +118 -0
- package/examples/deck/peano-calculus.md +122 -0
- package/examples/deck/peasant.md +129 -0
- package/examples/deck/pell-equation.md +132 -0
- package/examples/deck/pendulum-period.md +144 -0
- package/examples/deck/pi.md +110 -0
- package/examples/deck/pointer-analysis.md +143 -0
- package/examples/deck/polynomial.md +151 -0
- package/examples/deck/portable-library-overlap.md +140 -0
- package/examples/deck/prime-range.md +133 -0
- package/examples/deck/proof-contrapositive.md +114 -0
- package/examples/deck/propositional-dynamic-logic.md +133 -0
- package/examples/deck/quadratic-formula.md +116 -0
- package/examples/deck/quine-mccluskey.md +165 -0
- package/examples/deck/radioactive-decay.md +123 -0
- package/examples/deck/rdf12-annotated-claims.md +144 -0
- package/examples/deck/rdf12-annotation.md +131 -0
- package/examples/deck/rdf12-directional-language.md +103 -0
- package/examples/deck/rdf12-nested-triple-term.md +106 -0
- package/examples/deck/rdf12-trig-graph-join.md +109 -0
- package/examples/deck/rdf12-trig-named-graph.md +108 -0
- package/examples/deck/rdf12-trig-triple-term.md +107 -0
- package/examples/deck/rdf12-triple-term.md +118 -0
- package/examples/deck/register-allocation.md +148 -0
- package/examples/deck/reified-conditionals.md +120 -0
- package/examples/deck/relational-cube-lookup.md +122 -0
- package/examples/deck/reusable-builtins.md +127 -0
- package/examples/deck/riemann-hypothesis.md +138 -0
- package/examples/deck/route-planning.md +117 -0
- package/examples/deck/sat-solver-dpll.md +128 -0
- package/examples/deck/security-incident-correlation.md +129 -0
- package/examples/deck/send-more-money.md +128 -0
- package/examples/deck/service-impact.md +133 -0
- package/examples/deck/shoelace-polygon-area.md +121 -0
- package/examples/deck/sieve.md +127 -0
- package/examples/deck/skolem-functions.md +125 -0
- package/examples/deck/snaf.md +89 -0
- package/examples/deck/socrates.md +102 -0
- package/examples/deck/spacecraft-battery-diagnosis.md +136 -0
- package/examples/deck/stable-marriage.md +121 -0
- package/examples/deck/statistics-summary.md +144 -0
- package/examples/deck/stirling-bell-numbers.md +130 -0
- package/examples/deck/superdense-coding.md +149 -0
- package/examples/deck/symbolic-derivative.md +115 -0
- package/examples/deck/takeuchi.md +105 -0
- package/examples/deck/term-tools.md +125 -0
- package/examples/deck/totient-summatory.md +111 -0
- package/examples/deck/trust-flow-provenance-threshold.md +125 -0
- package/examples/deck/truth-maintenance-system.md +129 -0
- package/examples/deck/turing.md +121 -0
- package/examples/deck/type-inference.md +125 -0
- package/examples/deck/universal-vs-existential-termination.md +98 -0
- package/examples/deck/uuid.md +98 -0
- package/examples/deck/vanilla-meta-interpreter.md +119 -0
- package/examples/deck/vector-similarity.md +107 -0
- package/examples/deck/vulnerability-impact.md +129 -0
- package/examples/deck/web-names.md +115 -0
- package/examples/deck/weighted-interval-scheduling.md +128 -0
- package/examples/deck/witch.md +140 -0
- package/examples/deck/wolf-goat-cabbage.md +152 -0
- package/examples/deck/workplace-compliance.md +147 -0
- package/examples/deck/zebra.md +142 -0
- package/examples/delfour.pl +20 -9
- package/examples/flandor.pl +18 -8
- package/examples/gd-step-certified.pl +12 -8
- package/examples/gps.pl +3 -2
- package/examples/hamiltonian-path.pl +3 -2
- package/examples/iso-integer-arithmetic.pl +3 -2
- package/examples/lldm.pl +3 -1
- package/examples/output/auroracare.pl +1 -1
- package/examples/output/chart-parser.pl +1 -1
- package/examples/output/composition-of-injective-functions-is-injective.pl +5 -2
- package/examples/output/delfour.pl +1 -1
- package/examples/output/flandor.pl +2 -2
- package/examples/output/gd-step-certified.pl +80 -70
- package/examples/proof/auroracare.pl +252 -222
- package/examples/proof/chart-parser.pl +27 -16
- package/examples/proof/composition-of-injective-functions-is-injective.pl +71 -72
- package/examples/proof/delfour.pl +347 -347
- package/examples/proof/flandor.pl +37 -15
- package/examples/proof/gd-step-certified.pl +1256 -1157
- package/examples/proof/lldm.pl +11 -3
- package/examples/proof/quine-mccluskey.pl +171 -165
- package/examples/quine-mccluskey.pl +10 -3
- package/package.json +1 -1
- package/src/cli.js +1 -1
- package/src/execute.js +12 -0
- package/src/index.js +2 -2
- package/src/solver.js +9 -10
- package/test/goal-metadata.mjs +0 -14
- package/test/regression/cases-white-box.mjs +24 -0
- package/test/run-examples.mjs +2 -2
- package/the-art-of-eyeprolog.md +10 -6
package/examples/auroracare.pl
CHANGED
|
@@ -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
|
|
249
|
-
|
|
250
|
-
decision(S, "PERMIT") :-
|
|
251
|
-
decision(S, "
|
|
252
|
-
|
|
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(
|
|
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(
|
|
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").
|
package/examples/chart-parser.pl
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
% Two sample sentences share the same tiny grammar
|
|
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
|
-
|
|
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,
|
|
2
|
-
condition('C2', well_founded, ok,
|
|
3
|
-
condition('C3', justification, ok,
|
|
4
|
-
condition('C4', coverage, ok,
|
|
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,
|
|
7
|
-
condition('C7', relevance, ok,
|
|
8
|
-
|
|
9
|
-
|
|
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(
|
|
19
|
+
trusted(7).
|
|
13
20
|
claims(117).
|
|
14
|
-
verdict(
|
|
21
|
+
verdict(checked_with_obligations).
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
condition('C1', resolution, ok,
|
|
2
|
-
condition('C2', well_founded, ok,
|
|
3
|
-
condition('C3', justification, ok,
|
|
4
|
-
condition('C4', coverage, ok,
|
|
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,
|
|
8
|
-
obligation(builtin, theory_scoped,
|
|
9
|
-
obligation(builtin, theory_scoped,
|
|
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(
|
|
13
|
-
verified(
|
|
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,
|
|
2
|
-
condition('C2', well_founded, ok,
|
|
3
|
-
condition('C3', justification, ok,
|
|
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,
|
|
5
|
+
condition('C5', re_decision, ok, 4).
|
|
6
6
|
condition('C6', boundary_consistency, ok, 0).
|
|
7
|
-
condition('C7', relevance, ok,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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(
|
|
13
|
-
claims(
|
|
14
|
-
verdict(
|
|
15
|
+
trusted(3).
|
|
16
|
+
claims(5).
|
|
17
|
+
verdict(checked_with_obligations).
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
condition('C1', resolution, ok,
|
|
2
|
-
condition('C2', well_founded, ok,
|
|
3
|
-
condition('C3', justification, ok,
|
|
4
|
-
condition('C4', coverage, ok,
|
|
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,
|
|
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(
|
|
11
|
-
verified(
|
|
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,
|
|
3
|
-
condition('C3', justification, ok,
|
|
4
|
-
condition('C4', coverage, ok,
|
|
5
|
-
condition('C5', re_decision, ok,
|
|
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,
|
|
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(
|
|
10
|
+
steps(107).
|
|
11
11
|
verified(97).
|
|
12
|
-
recomputed(
|
|
12
|
+
recomputed(8).
|
|
13
13
|
composed(0).
|
|
14
14
|
trusted(2).
|
|
15
15
|
claims(43).
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
condition('C1', resolution, ok,
|
|
2
|
-
condition('C2', well_founded, ok,
|
|
3
|
-
condition('C3', justification, ok,
|
|
4
|
-
condition('C4', coverage, ok,
|
|
5
|
-
condition('C5', re_decision, ok,
|
|
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,
|
|
8
|
-
steps(
|
|
9
|
-
verified(
|
|
10
|
-
recomputed(
|
|
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(
|
|
13
|
+
claims(89).
|
|
14
14
|
verdict(checked).
|
package/examples/check/lldm.pl
CHANGED
|
@@ -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,
|
|
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,
|
|
3
|
-
condition('C3', justification, ok,
|
|
4
|
-
condition('C4', coverage, ok,
|
|
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,
|
|
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(
|
|
30
|
+
steps(243).
|
|
30
31
|
verified(145).
|
|
31
32
|
recomputed(76).
|
|
32
33
|
composed(0).
|
|
33
|
-
trusted(
|
|
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
|
-
%
|
|
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
|
-
%% ?-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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,
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
app(F, X,
|
|
43
|
-
app(F, Y,
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
app(H, Y, Z),
|
|
52
|
-
sameTerm(X, Y),
|
|
53
|
-
(X \= Y).
|
|
61
|
+
injective(H).
|