eyelang 1.3.9 → 1.4.0
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/cli.js +9 -9
- package/src/index.js +3 -2
- package/test/run-examples.js +38 -8
- package/test/run-regression.js +29 -37
|
@@ -1,216 +1,10 @@
|
|
|
1
1
|
result(det3, determinant([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], 4.0)).
|
|
2
|
-
why(
|
|
3
|
-
result(det3, determinant([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], 4.0)),
|
|
4
|
-
proof(
|
|
5
|
-
goal(result(det3, determinant([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], 4.0))),
|
|
6
|
-
by(rule("matrix.pl", clause(76))),
|
|
7
|
-
bindings([binding("Case", det3), binding("Matrix", [[2, -1, 0], [-1, 2, -1], [0, -1, 2]]), binding("Det", 4.0)]),
|
|
8
|
-
uses([
|
|
9
|
-
proof(
|
|
10
|
-
goal(case(det3, determinant, [[2, -1, 0], [-1, 2, -1], [0, -1, 2]])),
|
|
11
|
-
by(fact("matrix.pl", clause(67)))
|
|
12
|
-
),
|
|
13
|
-
proof(
|
|
14
|
-
goal(determinant([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], 4.0)),
|
|
15
|
-
by(builtin(determinant, 2))
|
|
16
|
-
)
|
|
17
|
-
])
|
|
18
|
-
)
|
|
19
|
-
).
|
|
20
|
-
|
|
21
2
|
result(inv3, matrix_inversion([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], [[0.74999999999999978, 0.5, 0.25], [0.5, 1.0000000000000004, 0.50000000000000022], [0.25, 0.50000000000000022, 0.75000000000000011]])).
|
|
22
|
-
why(
|
|
23
|
-
result(inv3, matrix_inversion([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], [[0.74999999999999978, 0.5, 0.25], [0.5, 1.0000000000000004, 0.50000000000000022], [0.25, 0.50000000000000022, 0.75000000000000011]])),
|
|
24
|
-
proof(
|
|
25
|
-
goal(result(inv3, matrix_inversion([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], [[0.74999999999999978, 0.5, 0.25], [0.5, 1.0000000000000004, 0.50000000000000022], [0.25, 0.50000000000000022, 0.75000000000000011]]))),
|
|
26
|
-
by(rule("matrix.pl", clause(77))),
|
|
27
|
-
bindings([binding("Case", inv3), binding("Matrix", [[2, -1, 0], [-1, 2, -1], [0, -1, 2]]), binding("Inverse", [[0.74999999999999978, 0.5, 0.25], [0.5, 1.0000000000000004, 0.50000000000000022], [0.25, 0.50000000000000022, 0.75000000000000011]])]),
|
|
28
|
-
uses([
|
|
29
|
-
proof(
|
|
30
|
-
goal(case(inv3, matrix_inversion, [[2, -1, 0], [-1, 2, -1], [0, -1, 2]])),
|
|
31
|
-
by(fact("matrix.pl", clause(68)))
|
|
32
|
-
),
|
|
33
|
-
proof(
|
|
34
|
-
goal(matrix_inversion([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], [[0.74999999999999978, 0.5, 0.25], [0.5, 1.0000000000000004, 0.50000000000000022], [0.25, 0.50000000000000022, 0.75000000000000011]])),
|
|
35
|
-
by(builtin(matrix_inversion, 2))
|
|
36
|
-
)
|
|
37
|
-
])
|
|
38
|
-
)
|
|
39
|
-
).
|
|
40
|
-
|
|
41
3
|
result(inv4, matrix_inversion([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.5156250000000067, 0.48437500000000011, -1.2968749999999987, 0.35937499999999561], [0.48437500000000011, 0.14062499999999961, -0.32812499999999822, 0.14062499999999797], [-1.2968749999999987, -0.32812499999999822, 1.0156249999999925, -0.57812499999999201], [0.35937499999999561, 0.14062499999999797, -0.57812499999999201, 0.51562499999999278]])).
|
|
42
|
-
why(
|
|
43
|
-
result(inv4, matrix_inversion([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.5156250000000067, 0.48437500000000011, -1.2968749999999987, 0.35937499999999561], [0.48437500000000011, 0.14062499999999961, -0.32812499999999822, 0.14062499999999797], [-1.2968749999999987, -0.32812499999999822, 1.0156249999999925, -0.57812499999999201], [0.35937499999999561, 0.14062499999999797, -0.57812499999999201, 0.51562499999999278]])),
|
|
44
|
-
proof(
|
|
45
|
-
goal(result(inv4, matrix_inversion([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.5156250000000067, 0.48437500000000011, -1.2968749999999987, 0.35937499999999561], [0.48437500000000011, 0.14062499999999961, -0.32812499999999822, 0.14062499999999797], [-1.2968749999999987, -0.32812499999999822, 1.0156249999999925, -0.57812499999999201], [0.35937499999999561, 0.14062499999999797, -0.57812499999999201, 0.51562499999999278]]))),
|
|
46
|
-
by(rule("matrix.pl", clause(77))),
|
|
47
|
-
bindings([binding("Case", inv4), binding("Matrix", [[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]]), binding("Inverse", [[2.5156250000000067, 0.48437500000000011, -1.2968749999999987, 0.35937499999999561], [0.48437500000000011, 0.14062499999999961, -0.32812499999999822, 0.14062499999999797], [-1.2968749999999987, -0.32812499999999822, 1.0156249999999925, -0.57812499999999201], [0.35937499999999561, 0.14062499999999797, -0.57812499999999201, 0.51562499999999278]])]),
|
|
48
|
-
uses([
|
|
49
|
-
proof(
|
|
50
|
-
goal(case(inv4, matrix_inversion, [[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]])),
|
|
51
|
-
by(fact("matrix.pl", clause(69)))
|
|
52
|
-
),
|
|
53
|
-
proof(
|
|
54
|
-
goal(matrix_inversion([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.5156250000000067, 0.48437500000000011, -1.2968749999999987, 0.35937499999999561], [0.48437500000000011, 0.14062499999999961, -0.32812499999999822, 0.14062499999999797], [-1.2968749999999987, -0.32812499999999822, 1.0156249999999925, -0.57812499999999201], [0.35937499999999561, 0.14062499999999797, -0.57812499999999201, 0.51562499999999278]])),
|
|
55
|
-
by(builtin(matrix_inversion, 2))
|
|
56
|
-
)
|
|
57
|
-
])
|
|
58
|
-
)
|
|
59
|
-
).
|
|
60
|
-
|
|
61
4
|
result(invtri3, matrix_inv_triang([[2, 0, 0], [-1, 2, 0], [0, -1, 2]], [[0.5, 0, 0], [0.25, 0.5, 0], [0.125, 0.25, 0.5]])).
|
|
62
|
-
why(
|
|
63
|
-
result(invtri3, matrix_inv_triang([[2, 0, 0], [-1, 2, 0], [0, -1, 2]], [[0.5, 0, 0], [0.25, 0.5, 0], [0.125, 0.25, 0.5]])),
|
|
64
|
-
proof(
|
|
65
|
-
goal(result(invtri3, matrix_inv_triang([[2, 0, 0], [-1, 2, 0], [0, -1, 2]], [[0.5, 0, 0], [0.25, 0.5, 0], [0.125, 0.25, 0.5]]))),
|
|
66
|
-
by(rule("matrix.pl", clause(78))),
|
|
67
|
-
bindings([binding("Case", invtri3), binding("Matrix", [[2, 0, 0], [-1, 2, 0], [0, -1, 2]]), binding("Inverse", [[0.5, 0, 0], [0.25, 0.5, 0], [0.125, 0.25, 0.5]])]),
|
|
68
|
-
uses([
|
|
69
|
-
proof(
|
|
70
|
-
goal(case(invtri3, matrix_inv_triang, [[2, 0, 0], [-1, 2, 0], [0, -1, 2]])),
|
|
71
|
-
by(fact("matrix.pl", clause(70)))
|
|
72
|
-
),
|
|
73
|
-
proof(
|
|
74
|
-
goal(matrix_inv_triang([[2, 0, 0], [-1, 2, 0], [0, -1, 2]], [[0.5, 0, 0], [0.25, 0.5, 0], [0.125, 0.25, 0.5]])),
|
|
75
|
-
by(builtin(matrix_inv_triang, 2))
|
|
76
|
-
)
|
|
77
|
-
])
|
|
78
|
-
)
|
|
79
|
-
).
|
|
80
|
-
|
|
81
5
|
result(mul_small, matrix_multiply([[[1, 2], [3, 4], [5, 6]], [[1, 1, 1], [1, 1, 1]]], [[3, 3, 3], [7, 7, 7], [11, 11, 11]])).
|
|
82
|
-
why(
|
|
83
|
-
result(mul_small, matrix_multiply([[[1, 2], [3, 4], [5, 6]], [[1, 1, 1], [1, 1, 1]]], [[3, 3, 3], [7, 7, 7], [11, 11, 11]])),
|
|
84
|
-
proof(
|
|
85
|
-
goal(result(mul_small, matrix_multiply([[[1, 2], [3, 4], [5, 6]], [[1, 1, 1], [1, 1, 1]]], [[3, 3, 3], [7, 7, 7], [11, 11, 11]]))),
|
|
86
|
-
by(rule("matrix.pl", clause(79))),
|
|
87
|
-
bindings([binding("Case", mul_small), binding("Inputs", [[[1, 2], [3, 4], [5, 6]], [[1, 1, 1], [1, 1, 1]]]), binding("Product", [[3, 3, 3], [7, 7, 7], [11, 11, 11]])]),
|
|
88
|
-
uses([
|
|
89
|
-
proof(
|
|
90
|
-
goal(case(mul_small, matrix_multiply, [[[1, 2], [3, 4], [5, 6]], [[1, 1, 1], [1, 1, 1]]])),
|
|
91
|
-
by(fact("matrix.pl", clause(71)))
|
|
92
|
-
),
|
|
93
|
-
proof(
|
|
94
|
-
goal(matrix_multiply([[[1, 2], [3, 4], [5, 6]], [[1, 1, 1], [1, 1, 1]]], [[3, 3, 3], [7, 7, 7], [11, 11, 11]])),
|
|
95
|
-
by(builtin(matrix_multiply, 2))
|
|
96
|
-
)
|
|
97
|
-
])
|
|
98
|
-
)
|
|
99
|
-
).
|
|
100
|
-
|
|
101
6
|
result(mul_identity_check, matrix_multiply([[[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.515624999999984, 0.4843749999999933, -1.296874999999973, 0.3593749999999767], [0.4843749999999933, 0.1406249999999978, -0.3281249999999918, 0.1406249999999936], [-1.296874999999973, -0.3281249999999918, 1.015624999999971, -0.5781249999999781], [0.3593749999999767, 0.1406249999999936, -0.5781249999999781, 0.5156249999999853]]], [[1.0000000000000497, 5.3290705182007514e-15, 1.7763568394002505e-14, 4.4408920985006262e-15], [5.6843418860808015e-14, 1.0000000000000089, 2.8421709430404007e-14, 1.0658141036401503e-14], [1.7053025658242404e-13, 1.7763568394002505e-14, 1.0000000000000426, 3.907985046680551e-14], [8.5265128291212022e-14, 3.5527136788005009e-15, 7.1054273576010019e-14, 0.99999999999999467]])).
|
|
102
|
-
why(
|
|
103
|
-
result(mul_identity_check, matrix_multiply([[[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.515624999999984, 0.4843749999999933, -1.296874999999973, 0.3593749999999767], [0.4843749999999933, 0.1406249999999978, -0.3281249999999918, 0.1406249999999936], [-1.296874999999973, -0.3281249999999918, 1.015624999999971, -0.5781249999999781], [0.3593749999999767, 0.1406249999999936, -0.5781249999999781, 0.5156249999999853]]], [[1.0000000000000497, 5.3290705182007514e-15, 1.7763568394002505e-14, 4.4408920985006262e-15], [5.6843418860808015e-14, 1.0000000000000089, 2.8421709430404007e-14, 1.0658141036401503e-14], [1.7053025658242404e-13, 1.7763568394002505e-14, 1.0000000000000426, 3.907985046680551e-14], [8.5265128291212022e-14, 3.5527136788005009e-15, 7.1054273576010019e-14, 0.99999999999999467]])),
|
|
104
|
-
proof(
|
|
105
|
-
goal(result(mul_identity_check, matrix_multiply([[[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.515624999999984, 0.4843749999999933, -1.296874999999973, 0.3593749999999767], [0.4843749999999933, 0.1406249999999978, -0.3281249999999918, 0.1406249999999936], [-1.296874999999973, -0.3281249999999918, 1.015624999999971, -0.5781249999999781], [0.3593749999999767, 0.1406249999999936, -0.5781249999999781, 0.5156249999999853]]], [[1.0000000000000497, 5.3290705182007514e-15, 1.7763568394002505e-14, 4.4408920985006262e-15], [5.6843418860808015e-14, 1.0000000000000089, 2.8421709430404007e-14, 1.0658141036401503e-14], [1.7053025658242404e-13, 1.7763568394002505e-14, 1.0000000000000426, 3.907985046680551e-14], [8.5265128291212022e-14, 3.5527136788005009e-15, 7.1054273576010019e-14, 0.99999999999999467]]))),
|
|
106
|
-
by(rule("matrix.pl", clause(79))),
|
|
107
|
-
bindings([binding("Case", mul_identity_check), binding("Inputs", [[[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.515624999999984, 0.4843749999999933, -1.296874999999973, 0.3593749999999767], [0.4843749999999933, 0.1406249999999978, -0.3281249999999918, 0.1406249999999936], [-1.296874999999973, -0.3281249999999918, 1.015624999999971, -0.5781249999999781], [0.3593749999999767, 0.1406249999999936, -0.5781249999999781, 0.5156249999999853]]]), binding("Product", [[1.0000000000000497, 5.3290705182007514e-15, 1.7763568394002505e-14, 4.4408920985006262e-15], [5.6843418860808015e-14, 1.0000000000000089, 2.8421709430404007e-14, 1.0658141036401503e-14], [1.7053025658242404e-13, 1.7763568394002505e-14, 1.0000000000000426, 3.907985046680551e-14], [8.5265128291212022e-14, 3.5527136788005009e-15, 7.1054273576010019e-14, 0.99999999999999467]])]),
|
|
108
|
-
uses([
|
|
109
|
-
proof(
|
|
110
|
-
goal(case(mul_identity_check, matrix_multiply, [[[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.515624999999984, 0.4843749999999933, -1.296874999999973, 0.3593749999999767], [0.4843749999999933, 0.1406249999999978, -0.3281249999999918, 0.1406249999999936], [-1.296874999999973, -0.3281249999999918, 1.015624999999971, -0.5781249999999781], [0.3593749999999767, 0.1406249999999936, -0.5781249999999781, 0.5156249999999853]]])),
|
|
111
|
-
by(fact("matrix.pl", clause(72)))
|
|
112
|
-
),
|
|
113
|
-
proof(
|
|
114
|
-
goal(matrix_multiply([[[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[2.515624999999984, 0.4843749999999933, -1.296874999999973, 0.3593749999999767], [0.4843749999999933, 0.1406249999999978, -0.3281249999999918, 0.1406249999999936], [-1.296874999999973, -0.3281249999999918, 1.015624999999971, -0.5781249999999781], [0.3593749999999767, 0.1406249999999936, -0.5781249999999781, 0.5156249999999853]]], [[1.0000000000000497, 5.3290705182007514e-15, 1.7763568394002505e-14, 4.4408920985006262e-15], [5.6843418860808015e-14, 1.0000000000000089, 2.8421709430404007e-14, 1.0658141036401503e-14], [1.7053025658242404e-13, 1.7763568394002505e-14, 1.0000000000000426, 3.907985046680551e-14], [8.5265128291212022e-14, 3.5527136788005009e-15, 7.1054273576010019e-14, 0.99999999999999467]])),
|
|
115
|
-
by(builtin(matrix_multiply, 2))
|
|
116
|
-
)
|
|
117
|
-
])
|
|
118
|
-
)
|
|
119
|
-
).
|
|
120
|
-
|
|
121
7
|
result(sum_small, matrix_sum([[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]], [[2, 4], [6, 8], [10, 12]])).
|
|
122
|
-
why(
|
|
123
|
-
result(sum_small, matrix_sum([[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]], [[2, 4], [6, 8], [10, 12]])),
|
|
124
|
-
proof(
|
|
125
|
-
goal(result(sum_small, matrix_sum([[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]], [[2, 4], [6, 8], [10, 12]]))),
|
|
126
|
-
by(rule("matrix.pl", clause(80))),
|
|
127
|
-
bindings([binding("Case", sum_small), binding("Inputs", [[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]]), binding("Sum", [[2, 4], [6, 8], [10, 12]])]),
|
|
128
|
-
uses([
|
|
129
|
-
proof(
|
|
130
|
-
goal(case(sum_small, matrix_sum, [[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]])),
|
|
131
|
-
by(fact("matrix.pl", clause(73)))
|
|
132
|
-
),
|
|
133
|
-
proof(
|
|
134
|
-
goal(matrix_sum([[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]], [[2, 4], [6, 8], [10, 12]])),
|
|
135
|
-
by(builtin(matrix_sum, 2))
|
|
136
|
-
)
|
|
137
|
-
])
|
|
138
|
-
)
|
|
139
|
-
).
|
|
140
|
-
|
|
141
8
|
result(chol3, cholesky_decomposition([[25, 15, -5], [15, 18, 0], [-5, 0, 11]], [[5.0, 0, 0], [3.0, 3.0, 0], [-1.0, 1.0, 3.0]])).
|
|
142
|
-
why(
|
|
143
|
-
result(chol3, cholesky_decomposition([[25, 15, -5], [15, 18, 0], [-5, 0, 11]], [[5.0, 0, 0], [3.0, 3.0, 0], [-1.0, 1.0, 3.0]])),
|
|
144
|
-
proof(
|
|
145
|
-
goal(result(chol3, cholesky_decomposition([[25, 15, -5], [15, 18, 0], [-5, 0, 11]], [[5.0, 0, 0], [3.0, 3.0, 0], [-1.0, 1.0, 3.0]]))),
|
|
146
|
-
by(rule("matrix.pl", clause(81))),
|
|
147
|
-
bindings([binding("Case", chol3), binding("Matrix", [[25, 15, -5], [15, 18, 0], [-5, 0, 11]]), binding("L", [[5.0, 0, 0], [3.0, 3.0, 0], [-1.0, 1.0, 3.0]])]),
|
|
148
|
-
uses([
|
|
149
|
-
proof(
|
|
150
|
-
goal(case(chol3, cholesky_decomposition, [[25, 15, -5], [15, 18, 0], [-5, 0, 11]])),
|
|
151
|
-
by(fact("matrix.pl", clause(74)))
|
|
152
|
-
),
|
|
153
|
-
proof(
|
|
154
|
-
goal(cholesky_decomposition([[25, 15, -5], [15, 18, 0], [-5, 0, 11]], [[5.0, 0, 0], [3.0, 3.0, 0], [-1.0, 1.0, 3.0]])),
|
|
155
|
-
by(builtin(cholesky_decomposition, 2))
|
|
156
|
-
)
|
|
157
|
-
])
|
|
158
|
-
)
|
|
159
|
-
).
|
|
160
|
-
|
|
161
9
|
result(chol4, cholesky_decomposition([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[4.2426406871192848, 0, 0, 0], [5.1854497287013492, 6.5659052011974026, 0, 0], [12.727922061357857, 3.0460384954008553, 1.6497422479090704, 0], [9.8994949366116654, 1.6245538642137891, 1.8497110052313821, 1.3926212476455924]])).
|
|
162
|
-
why(
|
|
163
|
-
result(chol4, cholesky_decomposition([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[4.2426406871192848, 0, 0, 0], [5.1854497287013492, 6.5659052011974026, 0, 0], [12.727922061357857, 3.0460384954008553, 1.6497422479090704, 0], [9.8994949366116654, 1.6245538642137891, 1.8497110052313821, 1.3926212476455924]])),
|
|
164
|
-
proof(
|
|
165
|
-
goal(result(chol4, cholesky_decomposition([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[4.2426406871192848, 0, 0, 0], [5.1854497287013492, 6.5659052011974026, 0, 0], [12.727922061357857, 3.0460384954008553, 1.6497422479090704, 0], [9.8994949366116654, 1.6245538642137891, 1.8497110052313821, 1.3926212476455924]]))),
|
|
166
|
-
by(rule("matrix.pl", clause(81))),
|
|
167
|
-
bindings([binding("Case", chol4), binding("Matrix", [[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]]), binding("L", [[4.2426406871192848, 0, 0, 0], [5.1854497287013492, 6.5659052011974026, 0, 0], [12.727922061357857, 3.0460384954008553, 1.6497422479090704, 0], [9.8994949366116654, 1.6245538642137891, 1.8497110052313821, 1.3926212476455924]])]),
|
|
168
|
-
uses([
|
|
169
|
-
proof(
|
|
170
|
-
goal(case(chol4, cholesky_decomposition, [[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]])),
|
|
171
|
-
by(fact("matrix.pl", clause(75)))
|
|
172
|
-
),
|
|
173
|
-
proof(
|
|
174
|
-
goal(cholesky_decomposition([[18, 22, 54, 42], [22, 70, 86, 62], [54, 86, 174, 134], [42, 62, 134, 106]], [[4.2426406871192848, 0, 0, 0], [5.1854497287013492, 6.5659052011974026, 0, 0], [12.727922061357857, 3.0460384954008553, 1.6497422479090704, 0], [9.8994949366116654, 1.6245538642137891, 1.8497110052313821, 1.3926212476455924]])),
|
|
175
|
-
by(builtin(cholesky_decomposition, 2))
|
|
176
|
-
)
|
|
177
|
-
])
|
|
178
|
-
)
|
|
179
|
-
).
|
|
180
|
-
|
|
181
10
|
checksConsistentWithTreallaReference(matrix, true).
|
|
182
|
-
why(
|
|
183
|
-
checksConsistentWithTreallaReference(matrix, true),
|
|
184
|
-
proof(
|
|
185
|
-
goal(checksConsistentWithTreallaReference(matrix, true)),
|
|
186
|
-
by(rule("matrix.pl", clause(82))),
|
|
187
|
-
bindings([binding("Det", 4.0)]),
|
|
188
|
-
uses([
|
|
189
|
-
proof(
|
|
190
|
-
goal(determinant([[2, -1, 0], [-1, 2, -1], [0, -1, 2]], 4.0)),
|
|
191
|
-
by(builtin(determinant, 2))
|
|
192
|
-
),
|
|
193
|
-
proof(
|
|
194
|
-
goal(gt(4.0, 3.9999)),
|
|
195
|
-
by(builtin(gt, 2))
|
|
196
|
-
),
|
|
197
|
-
proof(
|
|
198
|
-
goal(lt(4.0, 4.0001)),
|
|
199
|
-
by(builtin(lt, 2))
|
|
200
|
-
),
|
|
201
|
-
proof(
|
|
202
|
-
goal(matrix_multiply([[[1, 2], [3, 4], [5, 6]], [[1, 1, 1], [1, 1, 1]]], [[3, 3, 3], [7, 7, 7], [11, 11, 11]])),
|
|
203
|
-
by(builtin(matrix_multiply, 2))
|
|
204
|
-
),
|
|
205
|
-
proof(
|
|
206
|
-
goal(matrix_sum([[[1, 2], [3, 4], [5, 6]], [[1, 2], [3, 4], [5, 6]]], [[2, 4], [6, 8], [10, 12]])),
|
|
207
|
-
by(builtin(matrix_sum, 2))
|
|
208
|
-
),
|
|
209
|
-
proof(
|
|
210
|
-
goal(cholesky_decomposition([[25, 15, -5], [15, 18, 0], [-5, 0, 11]], [[5.0, 0, 0], [3.0, 3.0, 0], [-1.0, 1.0, 3.0]])),
|
|
211
|
-
by(builtin(cholesky_decomposition, 2))
|
|
212
|
-
)
|
|
213
|
-
])
|
|
214
|
-
)
|
|
215
|
-
).
|
|
216
|
-
|