eyelang 1.3.9 → 1.4.1
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/README.md +19 -14
- package/SPEC.md +4 -4
- package/conformance/expected/core/001_fact_query.out +0 -8
- package/conformance/expected/core/002_rule_recursion.out +0 -41
- package/conformance/expected/core/003_terms_and_readback.out +0 -104
- package/conformance/expected/core/004_conjunction_and_parentheses.out +0 -25
- package/conformance/expected/core/005_list_deconstruction.out +0 -32
- package/conformance/expected/core/006_comma_formula_data.out +0 -15
- package/conformance/expected/core/007_anonymous_variables.out +0 -19
- package/conformance/expected/core/008_graphic_atoms.out +0 -24
- package/conformance/expected/core/009_comments_and_whitespace.out +0 -30
- package/conformance/expected/core/010_variable_scope_and_reuse.out +0 -52
- package/conformance/expected/core/011_predicate_arity.out +0 -30
- package/conformance/expected/core/012_nested_compound_unification.out +0 -30
- package/conformance/expected/core/013_multiple_clauses_order.out +0 -44
- package/conformance/expected/core/014_failure_filters_answers.out +0 -19
- package/conformance/expected/core/015_improper_list_unification.out +0 -45
- package/conformance/expected/core/016_zero_arity_compound.out +0 -15
- package/conformance/expected/core/017_three_step_recursion.out +0 -99
- package/conformance/expected/core/018_quoted_atom_readback.out +0 -45
- package/conformance/expected/core/019_parenthesized_three_conjuncts.out +0 -36
- package/conformance/expected/core/020_nested_list_terms.out +0 -30
- package/conformance/expected/extension/001_default_derived_output.out +0 -56
- package/conformance/expected/extension/002_materialize_focus.out +0 -22
- package/conformance/expected/extension/003_arithmetic_and_comparison.out +0 -148
- package/conformance/expected/extension/004_strings_and_atoms.out +0 -58
- package/conformance/expected/extension/005_lists_aggregation_ordering.out +0 -135
- package/conformance/expected/extension/006_formula_terms.out +0 -76
- package/conformance/expected/extension/007_negation_once_generators.out +0 -40
- package/conformance/expected/extension/008_equality_and_inequality.out +0 -58
- package/conformance/expected/extension/009_list_relations.out +0 -73
- package/conformance/expected/extension/010_append_splits.out +0 -45
- package/conformance/expected/extension/011_matching_and_comparison.out +0 -70
- package/conformance/expected/extension/012_memoize_declaration.out +0 -41
- package/conformance/expected/extension/013_numeric_functions.out +0 -105
- package/conformance/expected/extension/014_between_enumeration.out +0 -45
- package/conformance/expected/extension/015_smallest_divisor.out +0 -15
- package/conformance/expected/extension/016_negation_filter.out +0 -38
- package/conformance/expected/extension/017_once_user_predicate.out +0 -21
- package/conformance/expected/extension/018_findall_user_goal.out +0 -15
- package/conformance/expected/extension/019_sort_deduplicates_atoms.out +0 -15
- package/conformance/expected/extension/020_append_bound_prefix_suffix.out +0 -30
- package/conformance/expected/extension/021_nth0_index_generation.out +0 -15
- package/conformance/expected/extension/022_set_nth0_edges.out +0 -30
- package/conformance/expected/extension/023_select_duplicate_occurrences.out +0 -30
- package/conformance/expected/extension/024_not_member_filter.out +0 -19
- package/conformance/expected/extension/025_is_list_filter.out +0 -19
- package/conformance/expected/extension/026_nested_formula_terms.out +0 -114
- package/conformance/expected/extension/027_materialize_excludes_source_fact.out +0 -14
- package/conformance/expected/extension/028_numeric_and_lexical_comparison.out +0 -42
- package/conformance/expected/extension/029_string_matching_filters.out +0 -38
- package/conformance/expected/extension/030_string_and_atom_concat.out +0 -30
- package/conformance/expected/extension/031_countall_empty_and_nonempty.out +0 -18
- package/conformance/expected/extension/032_sumall_numeric_template.out +0 -8
- package/conformance/expected/extension/033_aggregate_min_template.out +0 -8
- package/conformance/expected/extension/034_aggregate_max_compound_key.out +0 -8
- package/examples/output/access-control-policy.pl +0 -156
- package/examples/output/ackermann.pl +0 -1240
- package/examples/output/age.pl +0 -69
- package/examples/output/aliases-and-namespaces.pl +0 -73
- package/examples/output/alignment-demo.pl +0 -862
- package/examples/output/allen-interval-calculus.pl +0 -9169
- package/examples/output/ancestor.pl +0 -134
- package/examples/output/animal.pl +0 -64
- package/examples/output/annotation.pl +0 -76
- package/examples/output/backward.pl +0 -21
- package/examples/output/basic-monadic.pl +0 -22770
- package/examples/output/bayes-diagnosis.pl +0 -195
- package/examples/output/bayes-therapy.pl +0 -34873
- package/examples/output/beam-deflection.pl +0 -222
- package/examples/output/blocks-world-planning.pl +0 -1339
- package/examples/output/bmi.pl +0 -1903
- package/examples/output/braking-safety-worlds.pl +0 -2452
- package/examples/output/buck-converter-design.pl +0 -663
- package/examples/output/cache-performance.pl +0 -306
- package/examples/output/canary-release.pl +0 -167
- package/examples/output/cat-koko.pl +0 -83
- package/examples/output/clinical-trial-screening.pl +0 -380
- package/examples/output/collatz-1000.pl +0 -19000
- package/examples/output/combinatorics-findall-sort.pl +0 -56
- package/examples/output/competitive-enzyme-kinetics.pl +0 -563
- package/examples/output/complex-matrix-stability.pl +0 -250
- package/examples/output/complex.pl +0 -653
- package/examples/output/composition-of-injective-functions-is-injective.pl +0 -256
- package/examples/output/context-association.pl +0 -75
- package/examples/output/control-system.pl +0 -328
- package/examples/output/cryptarithmetic-send-more-money.pl +0 -168
- package/examples/output/cyclic-path.pl +0 -504
- package/examples/output/d3-group.pl +0 -56
- package/examples/output/dairy-energy-balance.pl +0 -1034
- package/examples/output/data-negotiation.pl +0 -75
- package/examples/output/deep-taxonomy-10.pl +0 -1235
- package/examples/output/deep-taxonomy-100.pl +0 -1235
- package/examples/output/deep-taxonomy-1000.pl +0 -1235
- package/examples/output/deep-taxonomy-10000.pl +0 -2915
- package/examples/output/deep-taxonomy-100000.pl +0 -20240
- package/examples/output/delfour.pl +0 -2829
- package/examples/output/dense-hamiltonian-cycle.pl +0 -207
- package/examples/output/deontic-logic.pl +0 -105
- package/examples/output/derived-rule.pl +0 -41
- package/examples/output/diamond-property.pl +0 -303
- package/examples/output/dijkstra-findall-sort.pl +0 -484
- package/examples/output/dijkstra-risk-path.pl +0 -4841
- package/examples/output/dijkstra.pl +0 -1336
- package/examples/output/dining-philosophers.pl +0 -21646
- package/examples/output/dog.pl +0 -30
- package/examples/output/drone-corridor-planner.pl +0 -2466
- package/examples/output/easter-computus.pl +0 -5690
- package/examples/output/electrical-rc-filter.pl +0 -102
- package/examples/output/epidemic-policy.pl +0 -760
- package/examples/output/equivalence-classes-overlap-implies-same-class.pl +0 -1080
- package/examples/output/eulerian-path.pl +0 -383
- package/examples/output/ev-range-worlds.pl +0 -2294
- package/examples/output/exact-cover-sudoku.pl +0 -396
- package/examples/output/existential-rule.pl +0 -38
- package/examples/output/exoplanet-validation-worlds.pl +0 -1904
- package/examples/output/expression-eval.pl +0 -104
- package/examples/output/family-cousins.pl +0 -3852
- package/examples/output/fastpow.pl +0 -1064
- package/examples/output/fft8-numeric.pl +0 -2556
- package/examples/output/fibonacci.pl +0 -2060
- package/examples/output/field-nitrogen-balance.pl +0 -1452
- package/examples/output/floating-point.pl +0 -151
- package/examples/output/four-color-map.pl +0 -191
- package/examples/output/fundamental-theorem-arithmetic.pl +0 -1610
- package/examples/output/gcd-bezout-identity.pl +0 -1842
- package/examples/output/gd-step-certified.pl +0 -32354
- package/examples/output/gdpr-compliance.pl +0 -193
- package/examples/output/goldbach-1000.pl +0 -17490
- package/examples/output/good-cobbler.pl +0 -15
- package/examples/output/gps.pl +0 -4166
- package/examples/output/graph-reachability.pl +0 -148
- package/examples/output/gray-code-counter.pl +0 -835
- package/examples/output/greatest-lower-bound-uniqueness.pl +0 -148
- package/examples/output/group-inverse-uniqueness.pl +0 -82
- package/examples/output/hamiltonian-cycle.pl +0 -102
- package/examples/output/hamiltonian-path.pl +0 -14157
- package/examples/output/hamming-code.pl +0 -2665
- package/examples/output/hanoi.pl +0 -184
- package/examples/output/heat-loss.pl +0 -223
- package/examples/output/heron-theorem.pl +0 -253
- package/examples/output/ideal-gas-law.pl +0 -148
- package/examples/output/illegitimate-reasoning.pl +0 -530
- package/examples/output/kaprekar.pl +0 -208
- package/examples/output/law-of-cosines.pl +0 -165
- package/examples/output/least-squares-regression.pl +0 -1447
- package/examples/output/list-collection.pl +0 -49
- package/examples/output/lldm.pl +0 -17298
- package/examples/output/manufacturing-quality-control.pl +0 -562
- package/examples/output/matrix.pl +0 -206
- package/examples/output/microgrid-dispatch.pl +0 -787
- package/examples/output/monkey-bananas.pl +0 -575
- package/examples/output/n-queens.pl +0 -2046
- package/examples/output/network-sla.pl +0 -282
- package/examples/output/newton-raphson.pl +0 -756
- package/examples/output/nixon-diamond.pl +0 -176
- package/examples/output/odrl-dpv-healthcare-risk-ranked.pl +0 -6148
- package/examples/output/odrl-dpv-risk-ranked.pl +0 -12961
- package/examples/output/orbital-transfer-design.pl +0 -961
- package/examples/output/path-discovery.pl +0 -333
- package/examples/output/peano-arithmetic.pl +0 -1432
- package/examples/output/peasant.pl +0 -190
- package/examples/output/pendulum-period.pl +0 -271
- package/examples/output/polynomial.pl +0 -7952
- package/examples/output/project-portfolio-optimization.pl +0 -93
- package/examples/output/proof-contrapositive.pl +0 -75
- package/examples/output/quadratic-formula.pl +0 -454
- package/examples/output/quine-mccluskey.pl +0 -188
- package/examples/output/radioactive-decay.pl +0 -299
- package/examples/output/sat-dpll.pl +0 -121
- package/examples/output/security-incident-correlation.pl +0 -267
- package/examples/output/service-impact.pl +0 -457
- package/examples/output/sieve.pl +0 -19
- package/examples/output/skolem-functions.pl +0 -264
- package/examples/output/socket-age.pl +0 -31
- package/examples/output/socket-family.pl +0 -56
- package/examples/output/socrates.pl +0 -36
- package/examples/output/statistics-summary.pl +0 -741
- package/examples/output/sudoku.pl +0 -38
- package/examples/output/superdense-coding.pl +0 -476
- package/examples/output/traveling-salesman.pl +0 -284
- package/examples/output/turing.pl +0 -2144
- package/examples/output/vector-similarity.pl +0 -421
- package/examples/output/witch.pl +0 -209
- package/examples/output/wolf-goat-cabbage.pl +0 -900
- package/examples/output/zebra.pl +0 -401
- package/examples/proof/age.pl +71 -0
- package/examples/proof/aliases-and-namespaces.pl +78 -0
- package/examples/proof/ancestor.pl +140 -0
- package/examples/proof/animal.pl +68 -0
- package/examples/proof/annotation.pl +80 -0
- package/examples/proof/backward.pl +22 -0
- package/examples/proof/cat-koko.pl +86 -0
- package/examples/proof/data-negotiation.pl +76 -0
- package/examples/proof/derived-rule.pl +43 -0
- package/examples/proof/dog.pl +31 -0
- package/examples/proof/electrical-rc-filter.pl +105 -0
- package/examples/proof/existential-rule.pl +40 -0
- package/examples/proof/floating-point.pl +160 -0
- package/examples/proof/good-cobbler.pl +16 -0
- package/examples/proof/group-inverse-uniqueness.pl +84 -0
- package/examples/proof/list-collection.pl +52 -0
- package/examples/proof/proof-contrapositive.pl +78 -0
- package/examples/proof/socket-age.pl +32 -0
- package/examples/proof/socket-family.pl +59 -0
- package/examples/proof/socrates.pl +38 -0
- package/package.json +1 -1
- package/playground-worker.mjs +4 -4
- package/playground.html +15 -15
- package/src/builtins/registry.js +7 -0
- package/src/cli.js +55 -35
- package/src/index.js +12 -9
- package/test/run-conformance.js +21 -44
- package/test/run-examples.js +69 -47
- package/test/run-regression.js +29 -37
|
@@ -1,48 +1,3 @@
|
|
|
1
1
|
answer(n, 3).
|
|
2
|
-
why(
|
|
3
|
-
answer(n, 3),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(n, 3)),
|
|
6
|
-
by(rule("014_between_enumeration.pl", clause(1))),
|
|
7
|
-
bindings([binding("X", 3)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(between(3, 5, 3)),
|
|
11
|
-
by(builtin(between, 3))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
17
2
|
answer(n, 4).
|
|
18
|
-
why(
|
|
19
|
-
answer(n, 4),
|
|
20
|
-
proof(
|
|
21
|
-
goal(answer(n, 4)),
|
|
22
|
-
by(rule("014_between_enumeration.pl", clause(1))),
|
|
23
|
-
bindings([binding("X", 4)]),
|
|
24
|
-
uses([
|
|
25
|
-
proof(
|
|
26
|
-
goal(between(3, 5, 4)),
|
|
27
|
-
by(builtin(between, 3))
|
|
28
|
-
)
|
|
29
|
-
])
|
|
30
|
-
)
|
|
31
|
-
).
|
|
32
|
-
|
|
33
3
|
answer(n, 5).
|
|
34
|
-
why(
|
|
35
|
-
answer(n, 5),
|
|
36
|
-
proof(
|
|
37
|
-
goal(answer(n, 5)),
|
|
38
|
-
by(rule("014_between_enumeration.pl", clause(1))),
|
|
39
|
-
bindings([binding("X", 5)]),
|
|
40
|
-
uses([
|
|
41
|
-
proof(
|
|
42
|
-
goal(between(3, 5, 5)),
|
|
43
|
-
by(builtin(between, 3))
|
|
44
|
-
)
|
|
45
|
-
])
|
|
46
|
-
)
|
|
47
|
-
).
|
|
48
|
-
|
|
@@ -1,16 +1 @@
|
|
|
1
1
|
answer(divisor, 3).
|
|
2
|
-
why(
|
|
3
|
-
answer(divisor, 3),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(divisor, 3)),
|
|
6
|
-
by(rule("015_smallest_divisor.pl", clause(1))),
|
|
7
|
-
bindings([binding("D", 3)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(smallest_divisor_from(21, 2, 3)),
|
|
11
|
-
by(builtin(smallest_divisor_from, 3))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
@@ -1,40 +1,2 @@
|
|
|
1
1
|
answer(open, a).
|
|
2
|
-
why(
|
|
3
|
-
answer(open, a),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(open, a)),
|
|
6
|
-
by(rule("016_negation_filter.pl", clause(5))),
|
|
7
|
-
bindings([binding("X", a)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(candidate(a)),
|
|
11
|
-
by(fact("016_negation_filter.pl", clause(1)))
|
|
12
|
-
),
|
|
13
|
-
proof(
|
|
14
|
-
goal(not(blocked(a))),
|
|
15
|
-
by(builtin(not, 1))
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
)
|
|
19
|
-
).
|
|
20
|
-
|
|
21
2
|
answer(open, c).
|
|
22
|
-
why(
|
|
23
|
-
answer(open, c),
|
|
24
|
-
proof(
|
|
25
|
-
goal(answer(open, c)),
|
|
26
|
-
by(rule("016_negation_filter.pl", clause(5))),
|
|
27
|
-
bindings([binding("X", c)]),
|
|
28
|
-
uses([
|
|
29
|
-
proof(
|
|
30
|
-
goal(candidate(c)),
|
|
31
|
-
by(fact("016_negation_filter.pl", clause(3)))
|
|
32
|
-
),
|
|
33
|
-
proof(
|
|
34
|
-
goal(not(blocked(c))),
|
|
35
|
-
by(builtin(not, 1))
|
|
36
|
-
)
|
|
37
|
-
])
|
|
38
|
-
)
|
|
39
|
-
).
|
|
40
|
-
|
|
@@ -1,22 +1 @@
|
|
|
1
1
|
answer(first, a).
|
|
2
|
-
why(
|
|
3
|
-
answer(first, a),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(first, a)),
|
|
6
|
-
by(rule("017_once_user_predicate.pl", clause(3))),
|
|
7
|
-
bindings([binding("X", a)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(once(choice(a))),
|
|
11
|
-
by(builtin(once, 1)),
|
|
12
|
-
uses([
|
|
13
|
-
proof(
|
|
14
|
-
goal(choice(a)),
|
|
15
|
-
by(fact("017_once_user_predicate.pl", clause(1)))
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
)
|
|
19
|
-
])
|
|
20
|
-
)
|
|
21
|
-
).
|
|
22
|
-
|
|
@@ -1,16 +1 @@
|
|
|
1
1
|
answer(bag, [b, a, b]).
|
|
2
|
-
why(
|
|
3
|
-
answer(bag, [b, a, b]),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(bag, [b, a, b])),
|
|
6
|
-
by(rule("018_findall_user_goal.pl", clause(4))),
|
|
7
|
-
bindings([binding("X", [b, a, b])]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(findall(P, p(P), [b, a, b])),
|
|
11
|
-
by(builtin(findall, 3))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
@@ -1,16 +1 @@
|
|
|
1
1
|
answer(sorted, [a, b, c]).
|
|
2
|
-
why(
|
|
3
|
-
answer(sorted, [a, b, c]),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(sorted, [a, b, c])),
|
|
6
|
-
by(rule("019_sort_deduplicates_atoms.pl", clause(1))),
|
|
7
|
-
bindings([binding("X", [a, b, c])]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(sort([c, a, b, a], [a, b, c])),
|
|
11
|
-
by(builtin(sort, 2))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
answer(prefix, [a, b]).
|
|
2
|
-
why(
|
|
3
|
-
answer(prefix, [a, b]),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(prefix, [a, b])),
|
|
6
|
-
by(rule("020_append_bound_prefix_suffix.pl", clause(1))),
|
|
7
|
-
bindings([binding("X", [a, b])]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(append([a, b], [c], [a, b, c])),
|
|
11
|
-
by(builtin(append, 3))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
17
2
|
answer(suffix, [b, c]).
|
|
18
|
-
why(
|
|
19
|
-
answer(suffix, [b, c]),
|
|
20
|
-
proof(
|
|
21
|
-
goal(answer(suffix, [b, c])),
|
|
22
|
-
by(rule("020_append_bound_prefix_suffix.pl", clause(2))),
|
|
23
|
-
bindings([binding("X", [b, c])]),
|
|
24
|
-
uses([
|
|
25
|
-
proof(
|
|
26
|
-
goal(append([a], [b, c], [a, b, c])),
|
|
27
|
-
by(builtin(append, 3))
|
|
28
|
-
)
|
|
29
|
-
])
|
|
30
|
-
)
|
|
31
|
-
).
|
|
32
|
-
|
|
@@ -1,16 +1 @@
|
|
|
1
1
|
answer(index, 1).
|
|
2
|
-
why(
|
|
3
|
-
answer(index, 1),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(index, 1)),
|
|
6
|
-
by(rule("021_nth0_index_generation.pl", clause(1))),
|
|
7
|
-
bindings([binding("I", 1)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(nth0(1, [a, b, c], b)),
|
|
11
|
-
by(builtin(nth0, 3))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
answer(first, [x, b, c]).
|
|
2
|
-
why(
|
|
3
|
-
answer(first, [x, b, c]),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(first, [x, b, c])),
|
|
6
|
-
by(rule("022_set_nth0_edges.pl", clause(1))),
|
|
7
|
-
bindings([binding("X", [x, b, c])]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(set_nth0(0, [a, b, c], x, [x, b, c])),
|
|
11
|
-
by(builtin(set_nth0, 4))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
17
2
|
answer(last, [a, b, z]).
|
|
18
|
-
why(
|
|
19
|
-
answer(last, [a, b, z]),
|
|
20
|
-
proof(
|
|
21
|
-
goal(answer(last, [a, b, z])),
|
|
22
|
-
by(rule("022_set_nth0_edges.pl", clause(2))),
|
|
23
|
-
bindings([binding("X", [a, b, z])]),
|
|
24
|
-
uses([
|
|
25
|
-
proof(
|
|
26
|
-
goal(set_nth0(2, [a, b, c], z, [a, b, z])),
|
|
27
|
-
by(builtin(set_nth0, 4))
|
|
28
|
-
)
|
|
29
|
-
])
|
|
30
|
-
)
|
|
31
|
-
).
|
|
32
|
-
|
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
answer(rest, [b, a]).
|
|
2
|
-
why(
|
|
3
|
-
answer(rest, [b, a]),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(rest, [b, a])),
|
|
6
|
-
by(rule("023_select_duplicate_occurrences.pl", clause(1))),
|
|
7
|
-
bindings([binding("X", [b, a])]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(select(a, [a, b, a], [b, a])),
|
|
11
|
-
by(builtin(select, 3))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
17
2
|
answer(rest, [a, b]).
|
|
18
|
-
why(
|
|
19
|
-
answer(rest, [a, b]),
|
|
20
|
-
proof(
|
|
21
|
-
goal(answer(rest, [a, b])),
|
|
22
|
-
by(rule("023_select_duplicate_occurrences.pl", clause(1))),
|
|
23
|
-
bindings([binding("X", [a, b])]),
|
|
24
|
-
uses([
|
|
25
|
-
proof(
|
|
26
|
-
goal(select(a, [a, b, a], [a, b])),
|
|
27
|
-
by(builtin(select, 3))
|
|
28
|
-
)
|
|
29
|
-
])
|
|
30
|
-
)
|
|
31
|
-
).
|
|
32
|
-
|
|
@@ -1,20 +1 @@
|
|
|
1
1
|
answer(not_present, c).
|
|
2
|
-
why(
|
|
3
|
-
answer(not_present, c),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(not_present, c)),
|
|
6
|
-
by(rule("024_not_member_filter.pl", clause(4))),
|
|
7
|
-
bindings([binding("X", c)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(candidate(c)),
|
|
11
|
-
by(fact("024_not_member_filter.pl", clause(3)))
|
|
12
|
-
),
|
|
13
|
-
proof(
|
|
14
|
-
goal(not_member(c, [a, b])),
|
|
15
|
-
by(builtin(not_member, 2))
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
)
|
|
19
|
-
).
|
|
20
|
-
|
|
@@ -1,20 +1 @@
|
|
|
1
1
|
answer(list, [a, b]).
|
|
2
|
-
why(
|
|
3
|
-
answer(list, [a, b]),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(list, [a, b])),
|
|
6
|
-
by(rule("025_is_list_filter.pl", clause(3))),
|
|
7
|
-
bindings([binding("X", [a, b])]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(thing([a, b])),
|
|
11
|
-
by(fact("025_is_list_filter.pl", clause(1)))
|
|
12
|
-
),
|
|
13
|
-
proof(
|
|
14
|
-
goal(is_list([a, b])),
|
|
15
|
-
by(builtin(is_list, 1))
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
)
|
|
19
|
-
).
|
|
20
|
-
|
|
@@ -1,120 +1,6 @@
|
|
|
1
1
|
answer(atom, name(a, "A")).
|
|
2
|
-
why(
|
|
3
|
-
answer(atom, name(a, "A")),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(atom, name(a, "A"))),
|
|
6
|
-
by(rule("026_nested_formula_terms.pl", clause(2))),
|
|
7
|
-
bindings([binding("A", name(a, "A")), binding("F", ((name(a, "A"), knows(a, b)), likes(b, c)))]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(formula(((name(a, "A"), knows(a, b)), likes(b, c)))),
|
|
11
|
-
by(fact("026_nested_formula_terms.pl", clause(1)))
|
|
12
|
-
),
|
|
13
|
-
proof(
|
|
14
|
-
goal(formula_atom(((name(a, "A"), knows(a, b)), likes(b, c)), name(a, "A"))),
|
|
15
|
-
by(builtin(formula_atom, 2))
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
)
|
|
19
|
-
).
|
|
20
|
-
|
|
21
2
|
answer(atom, knows(a, b)).
|
|
22
|
-
why(
|
|
23
|
-
answer(atom, knows(a, b)),
|
|
24
|
-
proof(
|
|
25
|
-
goal(answer(atom, knows(a, b))),
|
|
26
|
-
by(rule("026_nested_formula_terms.pl", clause(2))),
|
|
27
|
-
bindings([binding("A", knows(a, b)), binding("F", ((name(a, "A"), knows(a, b)), likes(b, c)))]),
|
|
28
|
-
uses([
|
|
29
|
-
proof(
|
|
30
|
-
goal(formula(((name(a, "A"), knows(a, b)), likes(b, c)))),
|
|
31
|
-
by(fact("026_nested_formula_terms.pl", clause(1)))
|
|
32
|
-
),
|
|
33
|
-
proof(
|
|
34
|
-
goal(formula_atom(((name(a, "A"), knows(a, b)), likes(b, c)), knows(a, b))),
|
|
35
|
-
by(builtin(formula_atom, 2))
|
|
36
|
-
)
|
|
37
|
-
])
|
|
38
|
-
)
|
|
39
|
-
).
|
|
40
|
-
|
|
41
3
|
answer(atom, likes(b, c)).
|
|
42
|
-
why(
|
|
43
|
-
answer(atom, likes(b, c)),
|
|
44
|
-
proof(
|
|
45
|
-
goal(answer(atom, likes(b, c))),
|
|
46
|
-
by(rule("026_nested_formula_terms.pl", clause(2))),
|
|
47
|
-
bindings([binding("A", likes(b, c)), binding("F", ((name(a, "A"), knows(a, b)), likes(b, c)))]),
|
|
48
|
-
uses([
|
|
49
|
-
proof(
|
|
50
|
-
goal(formula(((name(a, "A"), knows(a, b)), likes(b, c)))),
|
|
51
|
-
by(fact("026_nested_formula_terms.pl", clause(1)))
|
|
52
|
-
),
|
|
53
|
-
proof(
|
|
54
|
-
goal(formula_atom(((name(a, "A"), knows(a, b)), likes(b, c)), likes(b, c))),
|
|
55
|
-
by(builtin(formula_atom, 2))
|
|
56
|
-
)
|
|
57
|
-
])
|
|
58
|
-
)
|
|
59
|
-
).
|
|
60
|
-
|
|
61
4
|
answer(binary, exposed(a, name, "A")).
|
|
62
|
-
why(
|
|
63
|
-
answer(binary, exposed(a, name, "A")),
|
|
64
|
-
proof(
|
|
65
|
-
goal(answer(binary, exposed(a, name, "A"))),
|
|
66
|
-
by(rule("026_nested_formula_terms.pl", clause(3))),
|
|
67
|
-
bindings([binding("S", a), binding("P", name), binding("O", "A"), binding("F", ((name(a, "A"), knows(a, b)), likes(b, c)))]),
|
|
68
|
-
uses([
|
|
69
|
-
proof(
|
|
70
|
-
goal(formula(((name(a, "A"), knows(a, b)), likes(b, c)))),
|
|
71
|
-
by(fact("026_nested_formula_terms.pl", clause(1)))
|
|
72
|
-
),
|
|
73
|
-
proof(
|
|
74
|
-
goal(formula_binary(((name(a, "A"), knows(a, b)), likes(b, c)), a, name, "A")),
|
|
75
|
-
by(builtin(formula_binary, 4))
|
|
76
|
-
)
|
|
77
|
-
])
|
|
78
|
-
)
|
|
79
|
-
).
|
|
80
|
-
|
|
81
5
|
answer(binary, exposed(a, knows, b)).
|
|
82
|
-
why(
|
|
83
|
-
answer(binary, exposed(a, knows, b)),
|
|
84
|
-
proof(
|
|
85
|
-
goal(answer(binary, exposed(a, knows, b))),
|
|
86
|
-
by(rule("026_nested_formula_terms.pl", clause(3))),
|
|
87
|
-
bindings([binding("S", a), binding("P", knows), binding("O", b), binding("F", ((name(a, "A"), knows(a, b)), likes(b, c)))]),
|
|
88
|
-
uses([
|
|
89
|
-
proof(
|
|
90
|
-
goal(formula(((name(a, "A"), knows(a, b)), likes(b, c)))),
|
|
91
|
-
by(fact("026_nested_formula_terms.pl", clause(1)))
|
|
92
|
-
),
|
|
93
|
-
proof(
|
|
94
|
-
goal(formula_binary(((name(a, "A"), knows(a, b)), likes(b, c)), a, knows, b)),
|
|
95
|
-
by(builtin(formula_binary, 4))
|
|
96
|
-
)
|
|
97
|
-
])
|
|
98
|
-
)
|
|
99
|
-
).
|
|
100
|
-
|
|
101
6
|
answer(binary, exposed(b, likes, c)).
|
|
102
|
-
why(
|
|
103
|
-
answer(binary, exposed(b, likes, c)),
|
|
104
|
-
proof(
|
|
105
|
-
goal(answer(binary, exposed(b, likes, c))),
|
|
106
|
-
by(rule("026_nested_formula_terms.pl", clause(3))),
|
|
107
|
-
bindings([binding("S", b), binding("P", likes), binding("O", c), binding("F", ((name(a, "A"), knows(a, b)), likes(b, c)))]),
|
|
108
|
-
uses([
|
|
109
|
-
proof(
|
|
110
|
-
goal(formula(((name(a, "A"), knows(a, b)), likes(b, c)))),
|
|
111
|
-
by(fact("026_nested_formula_terms.pl", clause(1)))
|
|
112
|
-
),
|
|
113
|
-
proof(
|
|
114
|
-
goal(formula_binary(((name(a, "A"), knows(a, b)), likes(b, c)), b, likes, c)),
|
|
115
|
-
by(builtin(formula_binary, 4))
|
|
116
|
-
)
|
|
117
|
-
])
|
|
118
|
-
)
|
|
119
|
-
).
|
|
120
|
-
|
|
@@ -1,15 +1 @@
|
|
|
1
1
|
answer(b, ok).
|
|
2
|
-
why(
|
|
3
|
-
answer(b, ok),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(b, ok)),
|
|
6
|
-
by(rule("027_materialize_excludes_source_fact.pl", clause(5))),
|
|
7
|
-
uses([
|
|
8
|
-
proof(
|
|
9
|
-
goal(seed(a)),
|
|
10
|
-
by(fact("027_materialize_excludes_source_fact.pl", clause(2)))
|
|
11
|
-
)
|
|
12
|
-
])
|
|
13
|
-
)
|
|
14
|
-
).
|
|
15
|
-
|
|
@@ -1,45 +1,3 @@
|
|
|
1
1
|
answer(numeric_gt, true).
|
|
2
|
-
why(
|
|
3
|
-
answer(numeric_gt, true),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(numeric_gt, true)),
|
|
6
|
-
by(rule("028_numeric_and_lexical_comparison.pl", clause(1))),
|
|
7
|
-
uses([
|
|
8
|
-
proof(
|
|
9
|
-
goal(gt(10, 2)),
|
|
10
|
-
by(builtin(gt, 2))
|
|
11
|
-
)
|
|
12
|
-
])
|
|
13
|
-
)
|
|
14
|
-
).
|
|
15
|
-
|
|
16
2
|
answer(numeric_le, true).
|
|
17
|
-
why(
|
|
18
|
-
answer(numeric_le, true),
|
|
19
|
-
proof(
|
|
20
|
-
goal(answer(numeric_le, true)),
|
|
21
|
-
by(rule("028_numeric_and_lexical_comparison.pl", clause(2))),
|
|
22
|
-
uses([
|
|
23
|
-
proof(
|
|
24
|
-
goal(le(2, 2.0)),
|
|
25
|
-
by(builtin(le, 2))
|
|
26
|
-
)
|
|
27
|
-
])
|
|
28
|
-
)
|
|
29
|
-
).
|
|
30
|
-
|
|
31
3
|
answer(lexical_ge, true).
|
|
32
|
-
why(
|
|
33
|
-
answer(lexical_ge, true),
|
|
34
|
-
proof(
|
|
35
|
-
goal(answer(lexical_ge, true)),
|
|
36
|
-
by(rule("028_numeric_and_lexical_comparison.pl", clause(3))),
|
|
37
|
-
uses([
|
|
38
|
-
proof(
|
|
39
|
-
goal(ge(beta, alpha)),
|
|
40
|
-
by(builtin(ge, 2))
|
|
41
|
-
)
|
|
42
|
-
])
|
|
43
|
-
)
|
|
44
|
-
).
|
|
45
|
-
|
|
@@ -1,40 +1,2 @@
|
|
|
1
1
|
answer(has_ph, a).
|
|
2
|
-
why(
|
|
3
|
-
answer(has_ph, a),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(has_ph, a)),
|
|
6
|
-
by(rule("029_string_matching_filters.pl", clause(3))),
|
|
7
|
-
bindings([binding("K", a), binding("T", "alpha")]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(text(a, "alpha")),
|
|
11
|
-
by(fact("029_string_matching_filters.pl", clause(1)))
|
|
12
|
-
),
|
|
13
|
-
proof(
|
|
14
|
-
goal(matches("alpha", "ph")),
|
|
15
|
-
by(builtin(matches, 2))
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
)
|
|
19
|
-
).
|
|
20
|
-
|
|
21
2
|
answer(no_ph, b).
|
|
22
|
-
why(
|
|
23
|
-
answer(no_ph, b),
|
|
24
|
-
proof(
|
|
25
|
-
goal(answer(no_ph, b)),
|
|
26
|
-
by(rule("029_string_matching_filters.pl", clause(4))),
|
|
27
|
-
bindings([binding("K", b), binding("T", "beta")]),
|
|
28
|
-
uses([
|
|
29
|
-
proof(
|
|
30
|
-
goal(text(b, "beta")),
|
|
31
|
-
by(fact("029_string_matching_filters.pl", clause(2)))
|
|
32
|
-
),
|
|
33
|
-
proof(
|
|
34
|
-
goal(not_matches("beta", "ph")),
|
|
35
|
-
by(builtin(not_matches, 2))
|
|
36
|
-
)
|
|
37
|
-
])
|
|
38
|
-
)
|
|
39
|
-
).
|
|
40
|
-
|
|
@@ -1,32 +1,2 @@
|
|
|
1
1
|
answer(atom, eyelang).
|
|
2
|
-
why(
|
|
3
|
-
answer(atom, eyelang),
|
|
4
|
-
proof(
|
|
5
|
-
goal(answer(atom, eyelang)),
|
|
6
|
-
by(rule("030_string_and_atom_concat.pl", clause(1))),
|
|
7
|
-
bindings([binding("X", eyelang)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(atom_concat(eye, lang, eyelang)),
|
|
11
|
-
by(builtin(atom_concat, 3))
|
|
12
|
-
)
|
|
13
|
-
])
|
|
14
|
-
)
|
|
15
|
-
).
|
|
16
|
-
|
|
17
2
|
answer(string, "eyelang").
|
|
18
|
-
why(
|
|
19
|
-
answer(string, "eyelang"),
|
|
20
|
-
proof(
|
|
21
|
-
goal(answer(string, "eyelang")),
|
|
22
|
-
by(rule("030_string_and_atom_concat.pl", clause(2))),
|
|
23
|
-
bindings([binding("X", "eyelang")]),
|
|
24
|
-
uses([
|
|
25
|
-
proof(
|
|
26
|
-
goal(str_concat("eye", "lang", "eyelang")),
|
|
27
|
-
by(builtin(str_concat, 3))
|
|
28
|
-
)
|
|
29
|
-
])
|
|
30
|
-
)
|
|
31
|
-
).
|
|
32
|
-
|
|
@@ -1,19 +1 @@
|
|
|
1
1
|
(countall(item(X), 2), countall(missing(X), 0)).
|
|
2
|
-
why(
|
|
3
|
-
(countall(item(X), 2), countall(missing(X), 0)),
|
|
4
|
-
proof(
|
|
5
|
-
goal((countall(item(X), 2), countall(missing(X), 0))),
|
|
6
|
-
by(conjunction),
|
|
7
|
-
uses([
|
|
8
|
-
proof(
|
|
9
|
-
goal(countall(item(X), 2)),
|
|
10
|
-
by(builtin(countall, 2))
|
|
11
|
-
),
|
|
12
|
-
proof(
|
|
13
|
-
goal(countall(missing(X), 0)),
|
|
14
|
-
by(builtin(countall, 2))
|
|
15
|
-
)
|
|
16
|
-
])
|
|
17
|
-
)
|
|
18
|
-
).
|
|
19
|
-
|
|
@@ -1,9 +1 @@
|
|
|
1
1
|
aggregate_min(S, item(Name, S), score(Name, S), 3, item(beta, 3)).
|
|
2
|
-
why(
|
|
3
|
-
aggregate_min(S, item(Name, S), score(Name, S), 3, item(beta, 3)),
|
|
4
|
-
proof(
|
|
5
|
-
goal(aggregate_min(S, item(Name, S), score(Name, S), 3, item(beta, 3))),
|
|
6
|
-
by(builtin(aggregate_min, 5))
|
|
7
|
-
)
|
|
8
|
-
).
|
|
9
|
-
|