eyeprolog 1.5.97 → 1.5.99

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 (49) hide show
  1. package/examples/output/propositional-dynamic-logic.pl +1 -0
  2. package/examples/proof/attributed-variables.pl +62 -0
  3. package/examples/proof/catalan-convolution.pl +139 -0
  4. package/examples/proof/cdcl-sat-solver.pl +158 -0
  5. package/examples/proof/clpb-boolean-circuit.pl +114 -0
  6. package/examples/proof/clpb-cardinality.pl +18 -0
  7. package/examples/proof/clpb-feature-model.pl +114 -0
  8. package/examples/proof/combinatorics-findall-sort.pl +58 -0
  9. package/examples/proof/dcg-command-parser.pl +63 -0
  10. package/examples/proof/declarative-fault-localization.pl +87 -0
  11. package/examples/proof/defeasible-reasoning.pl +106 -0
  12. package/examples/proof/dif-constraints.pl +48 -0
  13. package/examples/proof/enigma1225.pl +16 -0
  14. package/examples/proof/equality-saturation.pl +101 -0
  15. package/examples/proof/four-color-map.pl +194 -0
  16. package/examples/proof/iso-control-and-errors.pl +125 -0
  17. package/examples/proof/iso-extension-pipeline-audit.pl +40 -0
  18. package/examples/proof/iso-extensions.pl +93 -0
  19. package/examples/proof/iso-grouped-solutions.pl +145 -0
  20. package/examples/proof/iso-integer-arithmetic.pl +88 -0
  21. package/examples/proof/job-shop-scheduling.pl +62 -0
  22. package/examples/proof/json.pl +38 -0
  23. package/examples/proof/knapsack-optimization.pl +85 -0
  24. package/examples/proof/language.pl +140 -0
  25. package/examples/proof/peasant.pl +200 -0
  26. package/examples/proof/propositional-dynamic-logic.pl +119 -0
  27. package/examples/proof/rdf12-annotation.pl +140 -0
  28. package/examples/proof/rdf12-directional-language.pl +32 -0
  29. package/examples/proof/rdf12-nested-triple-term.pl +16 -0
  30. package/examples/proof/rdf12-trig-graph-join.pl +20 -0
  31. package/examples/proof/rdf12-trig-named-graph.pl +52 -0
  32. package/examples/proof/rdf12-trig-triple-term.pl +16 -0
  33. package/examples/proof/rdf12-triple-term.pl +16 -0
  34. package/examples/proof/reified-conditionals.pl +28 -0
  35. package/examples/proof/route-planning.pl +158 -0
  36. package/examples/proof/sieve.pl +20 -0
  37. package/examples/proof/stable-marriage.pl +100 -0
  38. package/examples/proof/totient-summatory.pl +104 -0
  39. package/examples/proof/universal-vs-existential-termination.pl +44 -0
  40. package/examples/proof/uuid.pl +52 -0
  41. package/examples/proof/vanilla-meta-interpreter.pl +20 -0
  42. package/examples/proof/workplace-compliance.pl +92 -0
  43. package/examples/propositional-dynamic-logic.pl +102 -0
  44. package/package.json +1 -1
  45. package/playground.html +1 -0
  46. package/src/quads.js +21 -2
  47. package/test/regression/cases-regression.mjs +20 -0
  48. package/test/run-examples.mjs +41 -0
  49. package/the-art-of-eyeprolog.md +4 -4
@@ -0,0 +1 @@
1
+ answer(true, true, true, false, true, true, true).
@@ -0,0 +1,62 @@
1
+ accepts_required_value(ok).
2
+ why(
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
+ ])
19
+ ),
20
+ proof(
21
+ goal(=(7, 7)),
22
+ by(builtin(=, 2))
23
+ )
24
+ ])
25
+ )
26
+ ).
27
+
28
+ alias_preserves_attribute(ok).
29
+ why(
30
+ 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
+ ])
46
+ ),
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
+ ])
60
+ )
61
+ ).
62
+
@@ -0,0 +1,139 @@
1
+ catalan_answer(catalan_12, 208012).
2
+ why(
3
+ catalan_answer(catalan_12, 208012),
4
+ proof(
5
+ goal(catalan_answer(catalan_12, 208012)),
6
+ by(rule("catalan-convolution.pl", clause(6))),
7
+ bindings([binding("C", 208012)]),
8
+ uses([
9
+ proof(
10
+ goal(catalan(12, 208012)),
11
+ by(rule("catalan-convolution.pl", clause(3))),
12
+ bindings([binding("N", 12), binding("C", 208012), binding("N1", 11)]),
13
+ uses([
14
+ proof(
15
+ goal(>(12, 0)),
16
+ by(builtin(>, 2))
17
+ ),
18
+ proof(
19
+ goal(is(11, '-'(12, 1))),
20
+ by(builtin(is, 2))
21
+ ),
22
+ proof(
23
+ goal(sumall(Expression, (between(0, 11, I), is(J, '-'(11, I)), catalan(I, A), catalan(J, B), is(Expression, *(A, B))), 208012)),
24
+ by(library(sumall, 3))
25
+ )
26
+ ])
27
+ )
28
+ ])
29
+ )
30
+ ).
31
+
32
+ catalan_answer(triangulations_14_gon, 208012).
33
+ why(
34
+ catalan_answer(triangulations_14_gon, 208012),
35
+ proof(
36
+ goal(catalan_answer(triangulations_14_gon, 208012)),
37
+ by(rule("catalan-convolution.pl", clause(7))),
38
+ bindings([binding("Count", 208012)]),
39
+ uses([
40
+ proof(
41
+ goal(polygon_triangulations(14, 208012)),
42
+ by(rule("catalan-convolution.pl", clause(4))),
43
+ bindings([binding("Sides", 14), binding("Count", 208012), binding("N", 12)]),
44
+ uses([
45
+ proof(
46
+ goal(>=(14, 3)),
47
+ by(builtin(>=, 2))
48
+ ),
49
+ proof(
50
+ goal(is(12, '-'(14, 2))),
51
+ by(builtin(is, 2))
52
+ ),
53
+ proof(
54
+ goal(catalan(12, 208012)),
55
+ by(rule("catalan-convolution.pl", clause(3))),
56
+ bindings([binding("N", 12), binding("C", 208012), binding("N1", 11)]),
57
+ uses([
58
+ proof(
59
+ goal(>(12, 0)),
60
+ by(builtin(>, 2))
61
+ ),
62
+ proof(
63
+ goal(is(11, '-'(12, 1))),
64
+ by(builtin(is, 2))
65
+ ),
66
+ proof(
67
+ goal(sumall(Expression, (between(0, 11, I), is(J, '-'(11, I)), catalan(I, A), catalan(J, B), is(Expression, *(A, B))), 208012)),
68
+ by(library(sumall, 3))
69
+ )
70
+ ])
71
+ )
72
+ ])
73
+ )
74
+ ])
75
+ )
76
+ ).
77
+
78
+ catalan_answer(parenthesizations_13_factors, 208012).
79
+ why(
80
+ catalan_answer(parenthesizations_13_factors, 208012),
81
+ proof(
82
+ goal(catalan_answer(parenthesizations_13_factors, 208012)),
83
+ by(rule("catalan-convolution.pl", clause(8))),
84
+ bindings([binding("Count", 208012)]),
85
+ uses([
86
+ proof(
87
+ goal(parenthesizations(13, 208012)),
88
+ by(rule("catalan-convolution.pl", clause(5))),
89
+ bindings([binding("Factors", 13), binding("Count", 208012), binding("N", 12)]),
90
+ uses([
91
+ proof(
92
+ goal(>=(13, 1)),
93
+ by(builtin(>=, 2))
94
+ ),
95
+ proof(
96
+ goal(is(12, '-'(13, 1))),
97
+ by(builtin(is, 2))
98
+ ),
99
+ proof(
100
+ goal(catalan(12, 208012)),
101
+ by(rule("catalan-convolution.pl", clause(3))),
102
+ bindings([binding("N", 12), binding("C", 208012), binding("N1", 11)]),
103
+ uses([
104
+ proof(
105
+ goal(>(12, 0)),
106
+ by(builtin(>, 2))
107
+ ),
108
+ proof(
109
+ goal(is(11, '-'(12, 1))),
110
+ by(builtin(is, 2))
111
+ ),
112
+ proof(
113
+ goal(sumall(Expression, (between(0, 11, I), is(J, '-'(11, I)), catalan(I, A), catalan(J, B), is(Expression, *(A, B))), 208012)),
114
+ by(library(sumall, 3))
115
+ )
116
+ ])
117
+ )
118
+ ])
119
+ )
120
+ ])
121
+ )
122
+ ).
123
+
124
+ catalan_answer(first_ten_sum, 6918).
125
+ why(
126
+ catalan_answer(first_ten_sum, 6918),
127
+ proof(
128
+ goal(catalan_answer(first_ten_sum, 6918)),
129
+ by(rule("catalan-convolution.pl", clause(9))),
130
+ bindings([binding("Sum", 6918)]),
131
+ uses([
132
+ proof(
133
+ goal(sumall(Expression, (between(0, 9, N), catalan(N, Expression)), 6918)),
134
+ by(library(sumall, 3))
135
+ )
136
+ ])
137
+ )
138
+ ).
139
+
@@ -0,0 +1,158 @@
1
+ cdclAnswer(conflict_clause, c2).
2
+ why(
3
+ cdclAnswer(conflict_clause, c2),
4
+ proof(
5
+ goal(cdclAnswer(conflict_clause, c2)),
6
+ by(rule("cdcl-sat-solver.pl", clause(22))),
7
+ bindings([binding("Clause", c2)]),
8
+ uses([
9
+ proof(
10
+ goal(conflict(initial, c2)),
11
+ by(rule("cdcl-sat-solver.pl", clause(12))),
12
+ bindings([binding("Trail", initial), binding("Clause", c2), binding("Literals", [neg(c)])]),
13
+ uses([
14
+ proof(
15
+ goal(sat_clause(c2, [neg(c)])),
16
+ by(fact("cdcl-sat-solver.pl", clause(2)))
17
+ ),
18
+ proof(
19
+ goal('\\+'(nonfalse_literal(initial, [neg(c)]))),
20
+ by(builtin('\\+', 1))
21
+ )
22
+ ])
23
+ )
24
+ ])
25
+ )
26
+ ).
27
+
28
+ cdclAnswer(learned_clause, [neg(a)]).
29
+ why(
30
+ cdclAnswer(learned_clause, [neg(a)]),
31
+ proof(
32
+ goal(cdclAnswer(learned_clause, [neg(a)])),
33
+ by(rule("cdcl-sat-solver.pl", clause(23))),
34
+ bindings([binding("Literals", [neg(a)])]),
35
+ uses([
36
+ proof(
37
+ goal(learned_clause(l1, [neg(a)])),
38
+ by(fact("cdcl-sat-solver.pl", clause(14)))
39
+ )
40
+ ])
41
+ )
42
+ ).
43
+
44
+ cdclAnswer(learned_from, resolve(c2, c1, pivot(c))).
45
+ why(
46
+ cdclAnswer(learned_from, resolve(c2, c1, pivot(c))),
47
+ proof(
48
+ goal(cdclAnswer(learned_from, resolve(c2, c1, pivot(c)))),
49
+ by(rule("cdcl-sat-solver.pl", clause(24))),
50
+ bindings([binding("Reason", resolve(c2, c1, pivot(c)))]),
51
+ uses([
52
+ proof(
53
+ goal(learned_from(l1, resolve(c2, c1, pivot(c)))),
54
+ by(fact("cdcl-sat-solver.pl", clause(15)))
55
+ )
56
+ ])
57
+ )
58
+ ).
59
+
60
+ cdclAnswer(final_value(a), false).
61
+ why(
62
+ cdclAnswer(final_value(a), false),
63
+ proof(
64
+ goal(cdclAnswer(final_value(a), false)),
65
+ by(rule("cdcl-sat-solver.pl", clause(25))),
66
+ bindings([binding("Var", a), binding("Value", false), binding("__anon5", learned(l1))]),
67
+ uses([
68
+ proof(
69
+ goal(final_model_ok(ok)),
70
+ by(rule("cdcl-sat-solver.pl", clause(20))),
71
+ uses([
72
+ proof(
73
+ goal('\\+'(unsatisfied_final_clause)),
74
+ by(builtin('\\+', 1))
75
+ )
76
+ ])
77
+ ),
78
+ proof(
79
+ goal(final_value(a, false, learned(l1))),
80
+ by(fact("cdcl-sat-solver.pl", clause(16)))
81
+ )
82
+ ])
83
+ )
84
+ ).
85
+
86
+ cdclAnswer(final_value(c), false).
87
+ why(
88
+ cdclAnswer(final_value(c), false),
89
+ proof(
90
+ goal(cdclAnswer(final_value(c), false)),
91
+ by(rule("cdcl-sat-solver.pl", clause(25))),
92
+ bindings([binding("Var", c), binding("Value", false), binding("__anon5", unit(c2))]),
93
+ uses([
94
+ proof(
95
+ goal(final_model_ok(ok)),
96
+ by(rule("cdcl-sat-solver.pl", clause(20))),
97
+ uses([
98
+ proof(
99
+ goal('\\+'(unsatisfied_final_clause)),
100
+ by(builtin('\\+', 1))
101
+ )
102
+ ])
103
+ ),
104
+ proof(
105
+ goal(final_value(c, false, unit(c2))),
106
+ by(fact("cdcl-sat-solver.pl", clause(17)))
107
+ )
108
+ ])
109
+ )
110
+ ).
111
+
112
+ cdclAnswer(final_value(b), true).
113
+ why(
114
+ cdclAnswer(final_value(b), true),
115
+ proof(
116
+ goal(cdclAnswer(final_value(b), true)),
117
+ by(rule("cdcl-sat-solver.pl", clause(25))),
118
+ bindings([binding("Var", b), binding("Value", true), binding("__anon5", unit(c3))]),
119
+ uses([
120
+ proof(
121
+ goal(final_model_ok(ok)),
122
+ by(rule("cdcl-sat-solver.pl", clause(20))),
123
+ uses([
124
+ proof(
125
+ goal('\\+'(unsatisfied_final_clause)),
126
+ by(builtin('\\+', 1))
127
+ )
128
+ ])
129
+ ),
130
+ proof(
131
+ goal(final_value(b, true, unit(c3))),
132
+ by(fact("cdcl-sat-solver.pl", clause(18)))
133
+ )
134
+ ])
135
+ )
136
+ ).
137
+
138
+ cdclAnswer(note, "one learned clause makes the final model satisfy all original clauses").
139
+ why(
140
+ cdclAnswer(note, "one learned clause makes the final model satisfy all original clauses"),
141
+ proof(
142
+ goal(cdclAnswer(note, "one learned clause makes the final model satisfy all original clauses")),
143
+ by(rule("cdcl-sat-solver.pl", clause(26))),
144
+ uses([
145
+ proof(
146
+ goal(final_model_ok(ok)),
147
+ by(rule("cdcl-sat-solver.pl", clause(20))),
148
+ uses([
149
+ proof(
150
+ goal('\\+'(unsatisfied_final_clause)),
151
+ by(builtin('\\+', 1))
152
+ )
153
+ ])
154
+ )
155
+ ])
156
+ )
157
+ ).
158
+
@@ -0,0 +1,114 @@
1
+ xor_row(row(0, 0, 0)).
2
+ why(
3
+ xor_row(row(0, 0, 0)),
4
+ proof(
5
+ goal(xor_row(row(0, 0, 0))),
6
+ by(rule("clpb-boolean-circuit.pl", clause(2))),
7
+ bindings([binding("X", 0), binding("Y", 0), binding("Z", 0)]),
8
+ uses([
9
+ proof(
10
+ goal(xor_circuit(0, 0, 0)),
11
+ by(rule("clpb-boolean-circuit.pl", clause(1))),
12
+ bindings([binding("X", 0), binding("Y", 0), binding("Z", 0)]),
13
+ uses([
14
+ proof(
15
+ goal(sat('=:='(0, '+'(*(0, ~(0)), *(~(0), 0))))),
16
+ by(library(sat, 1))
17
+ )
18
+ ])
19
+ ),
20
+ proof(
21
+ goal(labeling([0, 0, 0])),
22
+ by(library(labeling, 1))
23
+ )
24
+ ])
25
+ )
26
+ ).
27
+
28
+ xor_row(row(1, 1, 0)).
29
+ why(
30
+ xor_row(row(1, 1, 0)),
31
+ proof(
32
+ goal(xor_row(row(1, 1, 0))),
33
+ by(rule("clpb-boolean-circuit.pl", clause(2))),
34
+ bindings([binding("X", 1), binding("Y", 1), binding("Z", 0)]),
35
+ uses([
36
+ proof(
37
+ goal(xor_circuit(1, 1, 0)),
38
+ by(rule("clpb-boolean-circuit.pl", clause(1))),
39
+ bindings([binding("X", 1), binding("Y", 1), binding("Z", 0)]),
40
+ uses([
41
+ proof(
42
+ goal(sat('=:='(0, '+'(*(1, ~(1)), *(~(1), 1))))),
43
+ by(library(sat, 1))
44
+ )
45
+ ])
46
+ ),
47
+ proof(
48
+ goal(labeling([1, 1, 0])),
49
+ by(library(labeling, 1))
50
+ )
51
+ ])
52
+ )
53
+ ).
54
+
55
+ xor_row(row(0, 1, 1)).
56
+ why(
57
+ xor_row(row(0, 1, 1)),
58
+ proof(
59
+ goal(xor_row(row(0, 1, 1))),
60
+ by(rule("clpb-boolean-circuit.pl", clause(2))),
61
+ bindings([binding("X", 0), binding("Y", 1), binding("Z", 1)]),
62
+ uses([
63
+ proof(
64
+ goal(xor_circuit(0, 1, 1)),
65
+ by(rule("clpb-boolean-circuit.pl", clause(1))),
66
+ bindings([binding("X", 0), binding("Y", 1), binding("Z", 1)]),
67
+ uses([
68
+ proof(
69
+ goal(sat('=:='(1, '+'(*(0, ~(1)), *(~(0), 1))))),
70
+ by(library(sat, 1))
71
+ )
72
+ ])
73
+ ),
74
+ proof(
75
+ goal(labeling([0, 1, 1])),
76
+ by(library(labeling, 1))
77
+ )
78
+ ])
79
+ )
80
+ ).
81
+
82
+ xor_row(row(1, 0, 1)).
83
+ why(
84
+ xor_row(row(1, 0, 1)),
85
+ proof(
86
+ goal(xor_row(row(1, 0, 1))),
87
+ by(rule("clpb-boolean-circuit.pl", clause(2))),
88
+ bindings([binding("X", 1), binding("Y", 0), binding("Z", 1)]),
89
+ uses([
90
+ proof(
91
+ goal(xor_circuit(1, 0, 1)),
92
+ by(rule("clpb-boolean-circuit.pl", clause(1))),
93
+ bindings([binding("X", 1), binding("Y", 0), binding("Z", 1)]),
94
+ uses([
95
+ proof(
96
+ goal(sat('=:='(1, '+'(*(1, ~(0)), *(~(1), 0))))),
97
+ by(library(sat, 1))
98
+ )
99
+ ])
100
+ ),
101
+ proof(
102
+ goal(labeling([1, 0, 1])),
103
+ by(library(labeling, 1))
104
+ )
105
+ ])
106
+ )
107
+ ).
108
+
109
+ xor_circuit_verified(1).
110
+ why(
111
+ xor_circuit_verified(1),
112
+ no_proof
113
+ ).
114
+
@@ -0,0 +1,18 @@
1
+ review_quorum(selection(alice(0), bob(0), carol(1), dan(1))).
2
+ why(
3
+ review_quorum(selection(alice(0), bob(0), carol(1), dan(1))),
4
+ no_proof
5
+ ).
6
+
7
+ review_quorum(selection(alice(0), bob(1), carol(1), dan(0))).
8
+ why(
9
+ review_quorum(selection(alice(0), bob(1), carol(1), dan(0))),
10
+ no_proof
11
+ ).
12
+
13
+ review_quorum_count(2).
14
+ why(
15
+ review_quorum_count(2),
16
+ no_proof
17
+ ).
18
+
@@ -0,0 +1,114 @@
1
+ feature_plan(features(cloud(0), edge(1), audit(1), encryption(1))).
2
+ why(
3
+ feature_plan(features(cloud(0), edge(1), audit(1), encryption(1))),
4
+ proof(
5
+ goal(feature_plan(features(cloud(0), edge(1), audit(1), encryption(1)))),
6
+ by(rule("clpb-feature-model.pl", clause(2))),
7
+ bindings([binding("Cloud", 0), binding("Edge", 1), binding("Audit", 1), binding("Encryption", 1)]),
8
+ uses([
9
+ proof(
10
+ goal(feature_constraints(0, 1, 1, 1)),
11
+ by(rule("clpb-feature-model.pl", clause(1))),
12
+ bindings([binding("Cloud", 0), binding("Edge", 1), binding("Audit", 1), binding("Encryption", 1)]),
13
+ uses([
14
+ proof(
15
+ goal(sat(*(*(#(0, 1), =<(1, 1)), =<(1, 1)))),
16
+ by(library(sat, 1))
17
+ )
18
+ ])
19
+ ),
20
+ proof(
21
+ goal(labeling([0, 1, 1, 1])),
22
+ by(library(labeling, 1))
23
+ )
24
+ ])
25
+ )
26
+ ).
27
+
28
+ feature_plan(features(cloud(1), edge(0), audit(0), encryption(0))).
29
+ why(
30
+ feature_plan(features(cloud(1), edge(0), audit(0), encryption(0))),
31
+ proof(
32
+ goal(feature_plan(features(cloud(1), edge(0), audit(0), encryption(0)))),
33
+ by(rule("clpb-feature-model.pl", clause(2))),
34
+ bindings([binding("Cloud", 1), binding("Edge", 0), binding("Audit", 0), binding("Encryption", 0)]),
35
+ uses([
36
+ proof(
37
+ goal(feature_constraints(1, 0, 0, 0)),
38
+ by(rule("clpb-feature-model.pl", clause(1))),
39
+ bindings([binding("Cloud", 1), binding("Edge", 0), binding("Audit", 0), binding("Encryption", 0)]),
40
+ uses([
41
+ proof(
42
+ goal(sat(*(*(#(1, 0), =<(0, 0)), =<(0, 0)))),
43
+ by(library(sat, 1))
44
+ )
45
+ ])
46
+ ),
47
+ proof(
48
+ goal(labeling([1, 0, 0, 0])),
49
+ by(library(labeling, 1))
50
+ )
51
+ ])
52
+ )
53
+ ).
54
+
55
+ feature_plan(features(cloud(1), edge(0), audit(0), encryption(1))).
56
+ why(
57
+ feature_plan(features(cloud(1), edge(0), audit(0), encryption(1))),
58
+ proof(
59
+ goal(feature_plan(features(cloud(1), edge(0), audit(0), encryption(1)))),
60
+ by(rule("clpb-feature-model.pl", clause(2))),
61
+ bindings([binding("Cloud", 1), binding("Edge", 0), binding("Audit", 0), binding("Encryption", 1)]),
62
+ uses([
63
+ proof(
64
+ goal(feature_constraints(1, 0, 0, 1)),
65
+ by(rule("clpb-feature-model.pl", clause(1))),
66
+ bindings([binding("Cloud", 1), binding("Edge", 0), binding("Audit", 0), binding("Encryption", 1)]),
67
+ uses([
68
+ proof(
69
+ goal(sat(*(*(#(1, 0), =<(0, 1)), =<(0, 0)))),
70
+ by(library(sat, 1))
71
+ )
72
+ ])
73
+ ),
74
+ proof(
75
+ goal(labeling([1, 0, 0, 1])),
76
+ by(library(labeling, 1))
77
+ )
78
+ ])
79
+ )
80
+ ).
81
+
82
+ feature_plan(features(cloud(1), edge(0), audit(1), encryption(1))).
83
+ why(
84
+ feature_plan(features(cloud(1), edge(0), audit(1), encryption(1))),
85
+ proof(
86
+ goal(feature_plan(features(cloud(1), edge(0), audit(1), encryption(1)))),
87
+ by(rule("clpb-feature-model.pl", clause(2))),
88
+ bindings([binding("Cloud", 1), binding("Edge", 0), binding("Audit", 1), binding("Encryption", 1)]),
89
+ uses([
90
+ proof(
91
+ goal(feature_constraints(1, 0, 1, 1)),
92
+ by(rule("clpb-feature-model.pl", clause(1))),
93
+ bindings([binding("Cloud", 1), binding("Edge", 0), binding("Audit", 1), binding("Encryption", 1)]),
94
+ uses([
95
+ proof(
96
+ goal(sat(*(*(#(1, 0), =<(1, 1)), =<(0, 1)))),
97
+ by(library(sat, 1))
98
+ )
99
+ ])
100
+ ),
101
+ proof(
102
+ goal(labeling([1, 0, 1, 1])),
103
+ by(library(labeling, 1))
104
+ )
105
+ ])
106
+ )
107
+ ).
108
+
109
+ feature_plan_count(4).
110
+ why(
111
+ feature_plan_count(4),
112
+ no_proof
113
+ ).
114
+
@@ -0,0 +1,58 @@
1
+ combinations(combinations_5_choose_3, [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]]).
2
+ why(
3
+ combinations(combinations_5_choose_3, [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]]),
4
+ proof(
5
+ goal(combinations(combinations_5_choose_3, [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]])),
6
+ by(rule("combinatorics-findall-sort.pl", clause(6))),
7
+ bindings([binding("Unique", [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]])]),
8
+ uses([
9
+ proof(
10
+ goal(unique_combinations(3, [1, 2, 3, 4, 5], [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]])),
11
+ by(rule("combinatorics-findall-sort.pl", clause(5))),
12
+ bindings([binding("K", 3), binding("Items", [1, 2, 3, 4, 5]), binding("Unique", [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]]), binding("All", [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5]])]),
13
+ uses([
14
+ proof(
15
+ goal(findall(C, combination(3, [1, 2, 3, 4, 5], C), [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5]])),
16
+ by(builtin(findall, 3))
17
+ ),
18
+ proof(
19
+ goal(sort([[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5]], [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]])),
20
+ by(builtin(sort, 2))
21
+ )
22
+ ])
23
+ )
24
+ ])
25
+ )
26
+ ).
27
+
28
+ count(combinations_5_choose_3, 10).
29
+ why(
30
+ count(combinations_5_choose_3, 10),
31
+ proof(
32
+ goal(count(combinations_5_choose_3, 10)),
33
+ by(rule("combinatorics-findall-sort.pl", clause(7))),
34
+ bindings([binding("Count", 10), binding("Unique", [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]])]),
35
+ uses([
36
+ proof(
37
+ goal(unique_combinations(3, [1, 2, 3, 4, 5], [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]])),
38
+ by(rule("combinatorics-findall-sort.pl", clause(5))),
39
+ bindings([binding("K", 3), binding("Items", [1, 2, 3, 4, 5]), binding("Unique", [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]]), binding("All", [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5]])]),
40
+ uses([
41
+ proof(
42
+ goal(findall(C, combination(3, [1, 2, 3, 4, 5], C), [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5]])),
43
+ by(builtin(findall, 3))
44
+ ),
45
+ proof(
46
+ goal(sort([[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 2, 3], [1, 3, 4], [1, 3, 5], [1, 2, 3], [2, 3, 4], [2, 3, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 2, 4], [1, 3, 4], [1, 4, 5], [1, 2, 4], [2, 3, 4], [2, 4, 5], [1, 3, 4], [2, 3, 4], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5], [1, 2, 5], [1, 3, 5], [1, 4, 5], [1, 2, 5], [2, 3, 5], [2, 4, 5], [1, 3, 5], [2, 3, 5], [3, 4, 5], [1, 4, 5], [2, 4, 5], [3, 4, 5]], [[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]])),
47
+ by(builtin(sort, 2))
48
+ )
49
+ ])
50
+ ),
51
+ proof(
52
+ goal(length([[1, 2, 3], [1, 2, 4], [1, 2, 5], [1, 3, 4], [1, 3, 5], [1, 4, 5], [2, 3, 4], [2, 3, 5], [2, 4, 5], [3, 4, 5]], 10)),
53
+ by(library(length, 2))
54
+ )
55
+ ])
56
+ )
57
+ ).
58
+