eyeprolog 1.6.0 → 1.6.2

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 (132) hide show
  1. package/examples/book/chapter-11/01-why.pl +7 -10
  2. package/examples/proof/access-control-policy.pl +80 -138
  3. package/examples/proof/age.pl +28 -58
  4. package/examples/proof/aliases-and-namespaces.pl +35 -48
  5. package/examples/proof/ancestor.pl +70 -100
  6. package/examples/proof/animal.pl +34 -43
  7. package/examples/proof/annotation.pl +92 -116
  8. package/examples/proof/attributed-variables.pl +30 -48
  9. package/examples/proof/backward.pl +13 -15
  10. package/examples/proof/bayes-diagnosis.pl +119 -170
  11. package/examples/proof/beam-deflection.pl +93 -192
  12. package/examples/proof/cache-performance.pl +159 -282
  13. package/examples/proof/canary-release.pl +92 -134
  14. package/examples/proof/cat-koko.pl +39 -66
  15. package/examples/proof/catalan-convolution.pl +68 -110
  16. package/examples/proof/cdcl-sat-solver.pl +83 -111
  17. package/examples/proof/chart-parser.pl +242 -428
  18. package/examples/proof/clinical-trial-screening.pl +205 -316
  19. package/examples/proof/clpb-boolean-circuit.pl +56 -80
  20. package/examples/proof/clpb-feature-model.pl +56 -80
  21. package/examples/proof/combinatorics-findall-sort.pl +29 -44
  22. package/examples/proof/composition-of-injective-functions-is-injective.pl +113 -218
  23. package/examples/proof/context-association.pl +75 -99
  24. package/examples/proof/d3-group.pl +29 -44
  25. package/examples/proof/data-negotiation.pl +39 -66
  26. package/examples/proof/dcg-command-parser.pl +28 -39
  27. package/examples/proof/declarative-fault-localization.pl +45 -76
  28. package/examples/proof/defeasible-reasoning.pl +49 -69
  29. package/examples/proof/deontic-logic.pl +52 -82
  30. package/examples/proof/derived-backward-rule.pl +41 -53
  31. package/examples/proof/derived-rule.pl +21 -30
  32. package/examples/proof/diamond-property.pl +208 -255
  33. package/examples/proof/dif-constraints.pl +18 -36
  34. package/examples/proof/dog.pl +15 -24
  35. package/examples/proof/electrical-rc-filter.pl +48 -84
  36. package/examples/proof/enigma1225.pl +7 -10
  37. package/examples/proof/epidemic-policy.pl +358 -670
  38. package/examples/proof/equality-saturation.pl +53 -68
  39. package/examples/proof/equivalence-classes-overlap-implies-same-class.pl +612 -990
  40. package/examples/proof/existential-rule.pl +14 -20
  41. package/examples/proof/expression-eval.pl +59 -92
  42. package/examples/proof/floating-point.pl +67 -106
  43. package/examples/proof/four-color-map.pl +97 -167
  44. package/examples/proof/gdpr-compliance.pl +106 -154
  45. package/examples/proof/good-cobbler.pl +7 -10
  46. package/examples/proof/graph-reachability.pl +81 -125
  47. package/examples/proof/greatest-lower-bound-uniqueness.pl +86 -128
  48. package/examples/proof/group-inverse-uniqueness.pl +44 -68
  49. package/examples/proof/hanoi.pl +77 -172
  50. package/examples/proof/heat-loss.pl +106 -190
  51. package/examples/proof/herbrand-semantics.pl +14 -18
  52. package/examples/proof/herbrand-witnesses.pl +49 -68
  53. package/examples/proof/ideal-gas-law.pl +68 -128
  54. package/examples/proof/integrity-check.pl +22 -34
  55. package/examples/proof/intuitionistic-logic-kripke.pl +75 -97
  56. package/examples/proof/iso-control-and-errors.pl +72 -89
  57. package/examples/proof/iso-dynamic-database.pl +34 -43
  58. package/examples/proof/iso-extension-pipeline-audit.pl +13 -34
  59. package/examples/proof/iso-extensions.pl +42 -57
  60. package/examples/proof/iso-grouped-solutions.pl +77 -109
  61. package/examples/proof/iso-integer-arithmetic.pl +37 -58
  62. package/examples/proof/iso-operators.pl +29 -44
  63. package/examples/proof/job-shop-scheduling.pl +33 -42
  64. package/examples/proof/json.pl +20 -25
  65. package/examples/proof/knapsack-optimization.pl +46 -58
  66. package/examples/proof/knights-tour-warnsdorff.pl +240 -474
  67. package/examples/proof/language.pl +70 -100
  68. package/examples/proof/linear-logic-resources.pl +103 -182
  69. package/examples/proof/list-collection.pl +54 -90
  70. package/examples/proof/modal-logic-kripke.pl +74 -94
  71. package/examples/proof/nixon-diamond.pl +107 -140
  72. package/examples/proof/partial-evaluator.pl +265 -370
  73. package/examples/proof/peasant.pl +80 -140
  74. package/examples/proof/prime-range.pl +27 -36
  75. package/examples/proof/proof-contrapositive.pl +42 -57
  76. package/examples/proof/propositional-dynamic-logic.pl +58 -107
  77. package/examples/proof/rdf12-annotation.pl +64 -112
  78. package/examples/proof/rdf12-directional-language.pl +14 -20
  79. package/examples/proof/rdf12-nested-triple-term.pl +7 -10
  80. package/examples/proof/rdf12-trig-graph-join.pl +8 -14
  81. package/examples/proof/rdf12-trig-named-graph.pl +22 -34
  82. package/examples/proof/rdf12-trig-triple-term.pl +7 -10
  83. package/examples/proof/rdf12-triple-term.pl +7 -10
  84. package/examples/proof/reified-conditionals.pl +10 -22
  85. package/examples/proof/reusable-builtins.pl +46 -94
  86. package/examples/proof/route-planning.pl +94 -124
  87. package/examples/proof/security-incident-correlation.pl +153 -234
  88. package/examples/proof/sieve.pl +8 -14
  89. package/examples/proof/snaf.pl +8 -14
  90. package/examples/proof/socrates.pl +20 -25
  91. package/examples/proof/spacecraft-battery-diagnosis.pl +138 -264
  92. package/examples/proof/stable-marriage.pl +61 -81
  93. package/examples/proof/symbolic-derivative.pl +107 -169
  94. package/examples/proof/term-tools.pl +42 -59
  95. package/examples/proof/totient-summatory.pl +55 -76
  96. package/examples/proof/trust-flow-provenance-threshold.pl +124 -268
  97. package/examples/proof/universal-vs-existential-termination.pl +23 -36
  98. package/examples/proof/uuid.pl +16 -46
  99. package/examples/proof/vanilla-meta-interpreter.pl +8 -14
  100. package/examples/proof/web-names.pl +29 -44
  101. package/examples/proof/weighted-interval-scheduling.pl +3864 -8379
  102. package/examples/proof/witch.pl +122 -163
  103. package/examples/proof/workplace-compliance.pl +35 -68
  104. package/package.json +1 -1
  105. package/src/explain.js +49 -43
  106. package/src/parser.js +12 -3
  107. package/src/write.js +8 -4
  108. package/test/conformance/expected-proofs/proofs/bindings_nested_term.pl +7 -10
  109. package/test/conformance/expected-proofs/proofs/builtin_numeric.pl +7 -10
  110. package/test/conformance/expected-proofs/proofs/conjunction_order.pl +8 -13
  111. package/test/conformance/expected-proofs/proofs/explicit_recursive.pl +28 -40
  112. package/test/conformance/expected-proofs/proofs/extra_aggregate_min.pl +7 -10
  113. package/test/conformance/expected-proofs/proofs/extra_compound_name_arguments.pl +7 -10
  114. package/test/conformance/expected-proofs/proofs/extra_context_parts.pl +30 -48
  115. package/test/conformance/expected-proofs/proofs/extra_eq_builtin.pl +7 -10
  116. package/test/conformance/expected-proofs/proofs/extra_explicit_path_bound.pl +33 -42
  117. package/test/conformance/expected-proofs/proofs/extra_findall_builtin.pl +7 -10
  118. package/test/conformance/expected-proofs/proofs/extra_forall_builtin.pl +7 -9
  119. package/test/conformance/expected-proofs/proofs/extra_iri_join.pl +7 -10
  120. package/test/conformance/expected-proofs/proofs/extra_negation_success.pl +7 -9
  121. package/test/conformance/expected-proofs/proofs/extra_nested_list_binding.pl +7 -10
  122. package/test/conformance/expected-proofs/proofs/extra_once_member.pl +13 -15
  123. package/test/conformance/expected-proofs/proofs/extra_recursive_path.pl +28 -40
  124. package/test/conformance/expected-proofs/proofs/herbrand_witness.pl +7 -10
  125. package/test/conformance/expected-proofs/proofs/iri_atom.pl +7 -10
  126. package/test/conformance/expected-proofs/proofs/list_builtin.pl +8 -14
  127. package/test/conformance/expected-proofs/proofs/once_child.pl +13 -15
  128. package/test/conformance/expected-proofs/proofs/rule_fact.pl +7 -10
  129. package/test/regression/cases-regression.mjs +28 -37
  130. package/test/regression/cases-white-box.mjs +54 -0
  131. package/test/regression/support.mjs +2 -2
  132. package/the-art-of-eyeprolog.md +26 -14
@@ -1,140 +1,110 @@
1
1
  ancestor(pat, jan).
2
2
  why(
3
3
  ancestor(pat, jan),
4
- proof(
5
- goal(ancestor(pat, jan)),
6
- by(rule("ancestor.pl", clause(4))),
7
- bindings([binding("X", pat), binding("Y", jan)]),
8
- uses([
9
- proof(
10
- goal(parent(pat, jan)),
11
- by(fact("ancestor.pl", clause(1)))
12
- )
13
- ])
4
+ step(
5
+ ancestor(pat, jan),
6
+ rule("ancestor.pl", clause(4)),
7
+ ['X' = pat, 'Y' = jan],
8
+ [
9
+ step(parent(pat, jan), fact("ancestor.pl", clause(1)), [], [])
10
+ ]
14
11
  )
15
12
  ).
16
13
 
17
14
  ancestor(jan, lies).
18
15
  why(
19
16
  ancestor(jan, lies),
20
- proof(
21
- goal(ancestor(jan, lies)),
22
- by(rule("ancestor.pl", clause(4))),
23
- bindings([binding("X", jan), binding("Y", lies)]),
24
- uses([
25
- proof(
26
- goal(parent(jan, lies)),
27
- by(fact("ancestor.pl", clause(2)))
28
- )
29
- ])
17
+ step(
18
+ ancestor(jan, lies),
19
+ rule("ancestor.pl", clause(4)),
20
+ ['X' = jan, 'Y' = lies],
21
+ [
22
+ step(parent(jan, lies), fact("ancestor.pl", clause(2)), [], [])
23
+ ]
30
24
  )
31
25
  ).
32
26
 
33
27
  ancestor(lies, emma).
34
28
  why(
35
29
  ancestor(lies, emma),
36
- proof(
37
- goal(ancestor(lies, emma)),
38
- by(rule("ancestor.pl", clause(4))),
39
- bindings([binding("X", lies), binding("Y", emma)]),
40
- uses([
41
- proof(
42
- goal(parent(lies, emma)),
43
- by(fact("ancestor.pl", clause(3)))
44
- )
45
- ])
30
+ step(
31
+ ancestor(lies, emma),
32
+ rule("ancestor.pl", clause(4)),
33
+ ['X' = lies, 'Y' = emma],
34
+ [
35
+ step(parent(lies, emma), fact("ancestor.pl", clause(3)), [], [])
36
+ ]
46
37
  )
47
38
  ).
48
39
 
49
40
  ancestor(pat, lies).
50
41
  why(
51
42
  ancestor(pat, lies),
52
- proof(
53
- goal(ancestor(pat, lies)),
54
- by(rule("ancestor.pl", clause(5))),
55
- bindings([binding("X", pat), binding("Z", lies), binding("Y", jan)]),
56
- uses([
57
- proof(
58
- goal(parent(pat, jan)),
59
- by(fact("ancestor.pl", clause(1)))
60
- ),
61
- proof(
62
- goal(ancestor(jan, lies)),
63
- by(rule("ancestor.pl", clause(4))),
64
- bindings([binding("X", jan), binding("Y", lies)]),
65
- uses([
66
- proof(
67
- goal(parent(jan, lies)),
68
- by(fact("ancestor.pl", clause(2)))
69
- )
70
- ])
43
+ step(
44
+ ancestor(pat, lies),
45
+ rule("ancestor.pl", clause(5)),
46
+ ['X' = pat, 'Z' = lies, 'Y' = jan],
47
+ [
48
+ step(parent(pat, jan), fact("ancestor.pl", clause(1)), [], []),
49
+ step(
50
+ ancestor(jan, lies),
51
+ rule("ancestor.pl", clause(4)),
52
+ ['X' = jan, 'Y' = lies],
53
+ [
54
+ step(parent(jan, lies), fact("ancestor.pl", clause(2)), [], [])
55
+ ]
71
56
  )
72
- ])
57
+ ]
73
58
  )
74
59
  ).
75
60
 
76
61
  ancestor(pat, emma).
77
62
  why(
78
63
  ancestor(pat, emma),
79
- proof(
80
- goal(ancestor(pat, emma)),
81
- by(rule("ancestor.pl", clause(5))),
82
- bindings([binding("X", pat), binding("Z", emma), binding("Y", jan)]),
83
- uses([
84
- proof(
85
- goal(parent(pat, jan)),
86
- by(fact("ancestor.pl", clause(1)))
87
- ),
88
- proof(
89
- goal(ancestor(jan, emma)),
90
- by(rule("ancestor.pl", clause(5))),
91
- bindings([binding("X", jan), binding("Z", emma), binding("Y", lies)]),
92
- uses([
93
- proof(
94
- goal(parent(jan, lies)),
95
- by(fact("ancestor.pl", clause(2)))
96
- ),
97
- proof(
98
- goal(ancestor(lies, emma)),
99
- by(rule("ancestor.pl", clause(4))),
100
- bindings([binding("X", lies), binding("Y", emma)]),
101
- uses([
102
- proof(
103
- goal(parent(lies, emma)),
104
- by(fact("ancestor.pl", clause(3)))
105
- )
106
- ])
64
+ step(
65
+ ancestor(pat, emma),
66
+ rule("ancestor.pl", clause(5)),
67
+ ['X' = pat, 'Z' = emma, 'Y' = jan],
68
+ [
69
+ step(parent(pat, jan), fact("ancestor.pl", clause(1)), [], []),
70
+ step(
71
+ ancestor(jan, emma),
72
+ rule("ancestor.pl", clause(5)),
73
+ ['X' = jan, 'Z' = emma, 'Y' = lies],
74
+ [
75
+ step(parent(jan, lies), fact("ancestor.pl", clause(2)), [], []),
76
+ step(
77
+ ancestor(lies, emma),
78
+ rule("ancestor.pl", clause(4)),
79
+ ['X' = lies, 'Y' = emma],
80
+ [
81
+ step(parent(lies, emma), fact("ancestor.pl", clause(3)), [], [])
82
+ ]
107
83
  )
108
- ])
84
+ ]
109
85
  )
110
- ])
86
+ ]
111
87
  )
112
88
  ).
113
89
 
114
90
  ancestor(jan, emma).
115
91
  why(
116
92
  ancestor(jan, emma),
117
- proof(
118
- goal(ancestor(jan, emma)),
119
- by(rule("ancestor.pl", clause(5))),
120
- bindings([binding("X", jan), binding("Z", emma), binding("Y", lies)]),
121
- uses([
122
- proof(
123
- goal(parent(jan, lies)),
124
- by(fact("ancestor.pl", clause(2)))
125
- ),
126
- proof(
127
- goal(ancestor(lies, emma)),
128
- by(rule("ancestor.pl", clause(4))),
129
- bindings([binding("X", lies), binding("Y", emma)]),
130
- uses([
131
- proof(
132
- goal(parent(lies, emma)),
133
- by(fact("ancestor.pl", clause(3)))
134
- )
135
- ])
93
+ step(
94
+ ancestor(jan, emma),
95
+ rule("ancestor.pl", clause(5)),
96
+ ['X' = jan, 'Z' = emma, 'Y' = lies],
97
+ [
98
+ step(parent(jan, lies), fact("ancestor.pl", clause(2)), [], []),
99
+ step(
100
+ ancestor(lies, emma),
101
+ rule("ancestor.pl", clause(4)),
102
+ ['X' = lies, 'Y' = emma],
103
+ [
104
+ step(parent(lies, emma), fact("ancestor.pl", clause(3)), [], [])
105
+ ]
136
106
  )
137
- ])
107
+ ]
138
108
  )
139
109
  ).
140
110
 
@@ -1,68 +1,59 @@
1
1
  type(joe, human).
2
2
  why(
3
3
  type(joe, human),
4
- proof(
5
- goal(type(joe, human)),
6
- by(rule("animal.pl", clause(4))),
7
- uses([
8
- proof(
9
- goal(human(joe)),
10
- by(fact("animal.pl", clause(1)))
11
- )
12
- ])
4
+ step(
5
+ type(joe, human),
6
+ rule("animal.pl", clause(4)),
7
+ [],
8
+ [
9
+ step(human(joe), fact("animal.pl", clause(1)), [], [])
10
+ ]
13
11
  )
14
12
  ).
15
13
 
16
14
  type(joe, animal).
17
15
  why(
18
16
  type(joe, animal),
19
- proof(
20
- goal(type(joe, animal)),
21
- by(rule("animal.pl", clause(5))),
22
- uses([
23
- proof(
24
- goal(animal(joe)),
25
- by(rule("animal.pl", clause(3))),
26
- bindings([binding("X", joe)]),
27
- uses([
28
- proof(
29
- goal(human(joe)),
30
- by(fact("animal.pl", clause(1)))
31
- )
32
- ])
17
+ step(
18
+ type(joe, animal),
19
+ rule("animal.pl", clause(5)),
20
+ [],
21
+ [
22
+ step(
23
+ animal(joe),
24
+ rule("animal.pl", clause(3)),
25
+ ['X' = joe],
26
+ [
27
+ step(human(joe), fact("animal.pl", clause(1)), [], [])
28
+ ]
33
29
  )
34
- ])
30
+ ]
35
31
  )
36
32
  ).
37
33
 
38
34
  subclassOf(human, animal).
39
35
  why(
40
36
  subclassOf(human, animal),
41
- proof(
42
- goal(subclassOf(human, animal)),
43
- by(rule("animal.pl", clause(6))),
44
- uses([
45
- proof(
46
- goal(animal(human)),
47
- by(fact("animal.pl", clause(2)))
48
- )
49
- ])
37
+ step(
38
+ subclassOf(human, animal),
39
+ rule("animal.pl", clause(6)),
40
+ [],
41
+ [
42
+ step(animal(human), fact("animal.pl", clause(2)), [], [])
43
+ ]
50
44
  )
51
45
  ).
52
46
 
53
47
  succeeds(animalExample, true).
54
48
  why(
55
49
  succeeds(animalExample, true),
56
- proof(
57
- goal(succeeds(animalExample, true)),
58
- by(rule("animal.pl", clause(7))),
59
- bindings([binding("__anon0", human)]),
60
- uses([
61
- proof(
62
- goal(animal(human)),
63
- by(fact("animal.pl", clause(2)))
64
- )
65
- ])
50
+ step(
51
+ succeeds(animalExample, true),
52
+ rule("animal.pl", clause(7)),
53
+ ['__anon0' = human],
54
+ [
55
+ step(animal(human), fact("animal.pl", clause(2)), [], [])
56
+ ]
66
57
  )
67
58
  ).
68
59
 
@@ -1,150 +1,126 @@
1
1
  name(a, "Alice").
2
2
  why(
3
3
  name(a, "Alice"),
4
- proof(
5
- goal(name(a, "Alice")),
6
- by(rule("annotation.pl", clause(5))),
7
- bindings([binding("S", a), binding("O", "Alice"), binding("_t", t), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
8
- uses([
9
- proof(
10
- goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
11
- by(fact("annotation.pl", clause(1)))
12
- ),
13
- proof(
14
- goal(context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), name(a, "Alice"))),
15
- by(rule("annotation.pl", clause(2))),
16
- bindings([binding("Left", name(a, "Alice")), binding("_right", (statedBy(t, bob), recorded(t, "2021-07-07"))), binding("Member", name(a, "Alice"))]),
17
- uses([
18
- proof(
19
- goal(context_member(name(a, "Alice"), name(a, "Alice"))),
20
- by(rule("annotation.pl", clause(4))),
21
- bindings([binding("Member", name(a, "Alice"))]),
22
- uses([
23
- proof(
24
- goal(\=(name(a, "Alice"), (_left, _right))),
25
- by(builtin(\=, 2))
26
- )
27
- ])
4
+ step(
5
+ name(a, "Alice"),
6
+ rule("annotation.pl", clause(5)),
7
+ ['S' = a, 'O' = "Alice", '_t' = t, 'Context' = (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))],
8
+ [
9
+ step(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))), fact("annotation.pl", clause(1)), [], []),
10
+ step(
11
+ context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), name(a, "Alice")),
12
+ rule("annotation.pl", clause(2)),
13
+ ['Left' = name(a, "Alice"), '_right' = (statedBy(t, bob), recorded(t, "2021-07-07")), 'Member' = name(a, "Alice")],
14
+ [
15
+ step(
16
+ context_member(name(a, "Alice"), name(a, "Alice")),
17
+ rule("annotation.pl", clause(4)),
18
+ ['Member' = name(a, "Alice")],
19
+ [
20
+ step(\=(name(a, "Alice"), (_left, _right)), builtin(\=, 2), [], [])
21
+ ]
28
22
  )
29
- ])
23
+ ]
30
24
  )
31
- ])
25
+ ]
32
26
  )
33
27
  ).
34
28
 
35
29
  log_nameOf(t, name(a, "Alice")).
36
30
  why(
37
31
  log_nameOf(t, name(a, "Alice")),
38
- proof(
39
- goal(log_nameOf(t, name(a, "Alice"))),
40
- by(rule("annotation.pl", clause(6))),
41
- bindings([binding("T", t), binding("S", a), binding("O", "Alice"), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
42
- uses([
43
- proof(
44
- goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
45
- by(fact("annotation.pl", clause(1)))
46
- ),
47
- proof(
48
- goal(context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), name(a, "Alice"))),
49
- by(rule("annotation.pl", clause(2))),
50
- bindings([binding("Left", name(a, "Alice")), binding("_right", (statedBy(t, bob), recorded(t, "2021-07-07"))), binding("Member", name(a, "Alice"))]),
51
- uses([
52
- proof(
53
- goal(context_member(name(a, "Alice"), name(a, "Alice"))),
54
- by(rule("annotation.pl", clause(4))),
55
- bindings([binding("Member", name(a, "Alice"))]),
56
- uses([
57
- proof(
58
- goal(\=(name(a, "Alice"), (_left, _right))),
59
- by(builtin(\=, 2))
60
- )
61
- ])
32
+ step(
33
+ log_nameOf(t, name(a, "Alice")),
34
+ rule("annotation.pl", clause(6)),
35
+ ['T' = t, 'S' = a, 'O' = "Alice", 'Context' = (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))],
36
+ [
37
+ step(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))), fact("annotation.pl", clause(1)), [], []),
38
+ step(
39
+ context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), name(a, "Alice")),
40
+ rule("annotation.pl", clause(2)),
41
+ ['Left' = name(a, "Alice"), '_right' = (statedBy(t, bob), recorded(t, "2021-07-07")), 'Member' = name(a, "Alice")],
42
+ [
43
+ step(
44
+ context_member(name(a, "Alice"), name(a, "Alice")),
45
+ rule("annotation.pl", clause(4)),
46
+ ['Member' = name(a, "Alice")],
47
+ [
48
+ step(\=(name(a, "Alice"), (_left, _right)), builtin(\=, 2), [], [])
49
+ ]
62
50
  )
63
- ])
51
+ ]
64
52
  )
65
- ])
53
+ ]
66
54
  )
67
55
  ).
68
56
 
69
57
  statedBy(t, bob).
70
58
  why(
71
59
  statedBy(t, bob),
72
- proof(
73
- goal(statedBy(t, bob)),
74
- by(rule("annotation.pl", clause(7))),
75
- bindings([binding("S", t), binding("O", bob), binding("_t", t), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
76
- uses([
77
- proof(
78
- goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
79
- by(fact("annotation.pl", clause(1)))
80
- ),
81
- proof(
82
- goal(context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), statedBy(t, bob))),
83
- by(rule("annotation.pl", clause(3))),
84
- bindings([binding("_left", name(a, "Alice")), binding("Right", (statedBy(t, bob), recorded(t, "2021-07-07"))), binding("Member", statedBy(t, bob))]),
85
- uses([
86
- proof(
87
- goal(context_member((statedBy(t, bob), recorded(t, "2021-07-07")), statedBy(t, bob))),
88
- by(rule("annotation.pl", clause(2))),
89
- bindings([binding("Left", statedBy(t, bob)), binding("_right", recorded(t, "2021-07-07")), binding("Member", statedBy(t, bob))]),
90
- uses([
91
- proof(
92
- goal(context_member(statedBy(t, bob), statedBy(t, bob))),
93
- by(rule("annotation.pl", clause(4))),
94
- bindings([binding("Member", statedBy(t, bob))]),
95
- uses([
96
- proof(
97
- goal(\=(statedBy(t, bob), (_left, _right))),
98
- by(builtin(\=, 2))
99
- )
100
- ])
60
+ step(
61
+ statedBy(t, bob),
62
+ rule("annotation.pl", clause(7)),
63
+ ['S' = t, 'O' = bob, '_t' = t, 'Context' = (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))],
64
+ [
65
+ step(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))), fact("annotation.pl", clause(1)), [], []),
66
+ step(
67
+ context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), statedBy(t, bob)),
68
+ rule("annotation.pl", clause(3)),
69
+ ['_left' = name(a, "Alice"), 'Right' = (statedBy(t, bob), recorded(t, "2021-07-07")), 'Member' = statedBy(t, bob)],
70
+ [
71
+ step(
72
+ context_member((statedBy(t, bob), recorded(t, "2021-07-07")), statedBy(t, bob)),
73
+ rule("annotation.pl", clause(2)),
74
+ ['Left' = statedBy(t, bob), '_right' = recorded(t, "2021-07-07"), 'Member' = statedBy(t, bob)],
75
+ [
76
+ step(
77
+ context_member(statedBy(t, bob), statedBy(t, bob)),
78
+ rule("annotation.pl", clause(4)),
79
+ ['Member' = statedBy(t, bob)],
80
+ [
81
+ step(\=(statedBy(t, bob), (_left, _right)), builtin(\=, 2), [], [])
82
+ ]
101
83
  )
102
- ])
84
+ ]
103
85
  )
104
- ])
86
+ ]
105
87
  )
106
- ])
88
+ ]
107
89
  )
108
90
  ).
109
91
 
110
92
  recorded(t, "2021-07-07").
111
93
  why(
112
94
  recorded(t, "2021-07-07"),
113
- proof(
114
- goal(recorded(t, "2021-07-07")),
115
- by(rule("annotation.pl", clause(8))),
116
- bindings([binding("S", t), binding("O", "2021-07-07"), binding("_t", t), binding("Context", (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))]),
117
- uses([
118
- proof(
119
- goal(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")))),
120
- by(fact("annotation.pl", clause(1)))
121
- ),
122
- proof(
123
- goal(context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), recorded(t, "2021-07-07"))),
124
- by(rule("annotation.pl", clause(3))),
125
- bindings([binding("_left", name(a, "Alice")), binding("Right", (statedBy(t, bob), recorded(t, "2021-07-07"))), binding("Member", recorded(t, "2021-07-07"))]),
126
- uses([
127
- proof(
128
- goal(context_member((statedBy(t, bob), recorded(t, "2021-07-07")), recorded(t, "2021-07-07"))),
129
- by(rule("annotation.pl", clause(3))),
130
- bindings([binding("_left", statedBy(t, bob)), binding("Right", recorded(t, "2021-07-07")), binding("Member", recorded(t, "2021-07-07"))]),
131
- uses([
132
- proof(
133
- goal(context_member(recorded(t, "2021-07-07"), recorded(t, "2021-07-07"))),
134
- by(rule("annotation.pl", clause(4))),
135
- bindings([binding("Member", recorded(t, "2021-07-07"))]),
136
- uses([
137
- proof(
138
- goal(\=(recorded(t, "2021-07-07"), (_left, _right))),
139
- by(builtin(\=, 2))
140
- )
141
- ])
95
+ step(
96
+ recorded(t, "2021-07-07"),
97
+ rule("annotation.pl", clause(8)),
98
+ ['S' = t, 'O' = "2021-07-07", '_t' = t, 'Context' = (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))],
99
+ [
100
+ step(annotation(t, (name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07"))), fact("annotation.pl", clause(1)), [], []),
101
+ step(
102
+ context_member((name(a, "Alice"), statedBy(t, bob), recorded(t, "2021-07-07")), recorded(t, "2021-07-07")),
103
+ rule("annotation.pl", clause(3)),
104
+ ['_left' = name(a, "Alice"), 'Right' = (statedBy(t, bob), recorded(t, "2021-07-07")), 'Member' = recorded(t, "2021-07-07")],
105
+ [
106
+ step(
107
+ context_member((statedBy(t, bob), recorded(t, "2021-07-07")), recorded(t, "2021-07-07")),
108
+ rule("annotation.pl", clause(3)),
109
+ ['_left' = statedBy(t, bob), 'Right' = recorded(t, "2021-07-07"), 'Member' = recorded(t, "2021-07-07")],
110
+ [
111
+ step(
112
+ context_member(recorded(t, "2021-07-07"), recorded(t, "2021-07-07")),
113
+ rule("annotation.pl", clause(4)),
114
+ ['Member' = recorded(t, "2021-07-07")],
115
+ [
116
+ step(\=(recorded(t, "2021-07-07"), (_left, _right)), builtin(\=, 2), [], [])
117
+ ]
142
118
  )
143
- ])
119
+ ]
144
120
  )
145
- ])
121
+ ]
146
122
  )
147
- ])
123
+ ]
148
124
  )
149
125
  ).
150
126
 
@@ -1,62 +1,44 @@
1
1
  accepts_required_value(ok).
2
2
  why(
3
3
  accepts_required_value(ok),
4
- proof(
5
- goal(accepts_required_value(ok)),
6
- by(rule("attributed-variables.pl", clause(4))),
7
- bindings([binding("X", 7)]),
8
- uses([
9
- proof(
10
- goal(attach_required(Variable, 7)),
11
- by(rule("attributed-variables.pl", clause(1))),
12
- bindings([binding("Value", 7)]),
13
- uses([
14
- proof(
15
- goal(put_atts(Variable, required(7))),
16
- by(builtin(put_atts, 2))
17
- )
18
- ])
4
+ step(
5
+ accepts_required_value(ok),
6
+ rule("attributed-variables.pl", clause(4)),
7
+ ['X' = 7],
8
+ [
9
+ step(
10
+ attach_required(Variable, 7),
11
+ rule("attributed-variables.pl", clause(1)),
12
+ ['Value' = 7],
13
+ [
14
+ step(put_atts(Variable, required(7)), builtin(put_atts, 2), [], [])
15
+ ]
19
16
  ),
20
- proof(
21
- goal(=(7, 7)),
22
- by(builtin(=, 2))
23
- )
24
- ])
17
+ step(=(7, 7), builtin(=, 2), [], [])
18
+ ]
25
19
  )
26
20
  ).
27
21
 
28
22
  alias_preserves_attribute(ok).
29
23
  why(
30
24
  alias_preserves_attribute(ok),
31
- proof(
32
- goal(alias_preserves_attribute(ok)),
33
- by(rule("attributed-variables.pl", clause(5))),
34
- bindings([binding("X", ready), binding("Y", ready)]),
35
- uses([
36
- proof(
37
- goal(attach_required(Variable, ready)),
38
- by(rule("attributed-variables.pl", clause(1))),
39
- bindings([binding("Value", ready)]),
40
- uses([
41
- proof(
42
- goal(put_atts(Variable, required(ready))),
43
- by(builtin(put_atts, 2))
44
- )
45
- ])
25
+ step(
26
+ alias_preserves_attribute(ok),
27
+ rule("attributed-variables.pl", clause(5)),
28
+ ['X' = ready, 'Y' = ready],
29
+ [
30
+ step(
31
+ attach_required(Variable, ready),
32
+ rule("attributed-variables.pl", clause(1)),
33
+ ['Value' = ready],
34
+ [
35
+ step(put_atts(Variable, required(ready)), builtin(put_atts, 2), [], [])
36
+ ]
46
37
  ),
47
- proof(
48
- goal(=(Y, Y)),
49
- by(builtin(=, 2))
50
- ),
51
- proof(
52
- goal(get_atts(Y, required(ready))),
53
- by(builtin(get_atts, 2))
54
- ),
55
- proof(
56
- goal(=(ready, ready)),
57
- by(builtin(=, 2))
58
- )
59
- ])
38
+ step(=(Y, Y), builtin(=, 2), [], []),
39
+ step(get_atts(Y, required(ready)), builtin(get_atts, 2), [], []),
40
+ step(=(ready, ready), builtin(=, 2), [], [])
41
+ ]
60
42
  )
61
43
  ).
62
44