eyeprolog 1.6.12 → 1.6.13

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 (129) hide show
  1. package/examples/proof/abstract-interpretation.pl +146 -0
  2. package/examples/proof/ackermann.pl +296 -0
  3. package/examples/proof/alignment-demo.pl +196 -0
  4. package/examples/proof/allen-interval-calculus.pl +1271 -0
  5. package/examples/proof/auroracare.pl +954 -0
  6. package/examples/proof/basic-monadic.pl +37176 -0
  7. package/examples/proof/bayes-therapy.pl +1349 -0
  8. package/examples/proof/bench.pl +2802 -0
  9. package/examples/proof/binomial-vandermonde.pl +983 -0
  10. package/examples/proof/blocks-world-planning.pl +471 -0
  11. package/examples/proof/bmi.pl +386 -0
  12. package/examples/proof/braking-safety-worlds.pl +508 -0
  13. package/examples/proof/buck-converter-design.pl +179 -0
  14. package/examples/proof/bulk-stream-write.pl +3 -0
  15. package/examples/proof/collatz-1000.pl +43784 -0
  16. package/examples/proof/competitive-enzyme-kinetics.pl +167 -0
  17. package/examples/proof/complex.pl +514 -0
  18. package/examples/proof/context-schema-audit.pl +374 -0
  19. package/examples/proof/continued-fraction-sqrt2.pl +476 -0
  20. package/examples/proof/control-system.pl +137 -0
  21. package/examples/proof/critical-path-schedule.pl +491 -0
  22. package/examples/proof/cross-organization-data-sharing.pl +732 -0
  23. package/examples/proof/cyclic-path.pl +44 -0
  24. package/examples/proof/dairy-energy-balance.pl +290 -0
  25. package/examples/proof/dcg-expression-language.pl +157 -0
  26. package/examples/proof/deep-taxonomy-10.pl +185 -0
  27. package/examples/proof/deep-taxonomy-100.pl +365 -0
  28. package/examples/proof/deep-taxonomy-1000.pl +163 -0
  29. package/examples/proof/deep-taxonomy-10000.pl +163 -0
  30. package/examples/proof/deep-taxonomy-100000.pl +163 -0
  31. package/examples/proof/delfour.pl +1615 -0
  32. package/examples/proof/dijkstra-findall-sort.pl +354 -0
  33. package/examples/proof/dijkstra-risk-path.pl +820 -0
  34. package/examples/proof/dijkstra.pl +753 -0
  35. package/examples/proof/dining-philosophers.pl +2663 -0
  36. package/examples/proof/donald-gerald-robert.pl +311 -0
  37. package/examples/proof/dpv-odrl-purpose-mapping.pl +1189 -0
  38. package/examples/proof/drone-corridor-planner.pl +2365 -0
  39. package/examples/proof/easter-computus.pl +1406 -0
  40. package/examples/proof/eulerian-path.pl +457 -0
  41. package/examples/proof/ev-range-worlds.pl +508 -0
  42. package/examples/proof/exoplanet-validation-worlds.pl +397 -0
  43. package/examples/proof/explainable-ev-depot-configuration.pl +313 -0
  44. package/examples/proof/family-cousins.pl +920 -0
  45. package/examples/proof/fast-fourier-transform.pl +5045 -0
  46. package/examples/proof/fastpow.pl +769 -0
  47. package/examples/proof/fft8-numeric.pl +685 -0
  48. package/examples/proof/fibonacci.pl +1425 -0
  49. package/examples/proof/field-nitrogen-balance.pl +320 -0
  50. package/examples/proof/flandor.pl +533 -0
  51. package/examples/proof/fundamental-theorem-arithmetic.pl +245 -0
  52. package/examples/proof/gd-step-certified.pl +1717 -0
  53. package/examples/proof/goldbach.pl +1135 -0
  54. package/examples/proof/gps.pl +627 -0
  55. package/examples/proof/graph.pl +105 -0
  56. package/examples/proof/gray-code-counter.pl +355 -0
  57. package/examples/proof/hamiltonian-path.pl +3373 -0
  58. package/examples/proof/hamming-code.pl +232 -0
  59. package/examples/proof/heron-theorem.pl +79 -0
  60. package/examples/proof/http-client.pl +0 -0
  61. package/examples/proof/illegitimate-reasoning.pl +220 -0
  62. package/examples/proof/integer-partitions.pl +1642 -0
  63. package/examples/proof/iso-atomic-conversion.pl +73 -0
  64. package/examples/proof/knowledge-engineering-alignment-flow.pl +200 -0
  65. package/examples/proof/knuth-bendix-completion.pl +290 -0
  66. package/examples/proof/law-of-cosines.pl +71 -0
  67. package/examples/proof/least-squares-regression.pl +342 -0
  68. package/examples/proof/lee.pl +637 -0
  69. package/examples/proof/lldm.pl +581 -0
  70. package/examples/proof/manufacturing-quality-control.pl +181 -0
  71. package/examples/proof/map-four-color-search.pl +796 -0
  72. package/examples/proof/markov-logic-network.pl +405 -0
  73. package/examples/proof/matrix-chain-order.pl +164 -0
  74. package/examples/proof/matrix-noncommutativity.pl +183 -0
  75. package/examples/proof/microgrid-dispatch.pl +164 -0
  76. package/examples/proof/missionaries-cannibals.pl +428 -0
  77. package/examples/proof/modular-exponentiation.pl +838 -0
  78. package/examples/proof/monkey-bananas.pl +278 -0
  79. package/examples/proof/network-sla.pl +100 -0
  80. package/examples/proof/newton-raphson.pl +520 -0
  81. package/examples/proof/observability-log-correlation.pl +1061 -0
  82. package/examples/proof/odrl-dpv-fpv-trust-flow.pl +1366 -0
  83. package/examples/proof/odrl-dpv-healthcare-risk-ranked.pl +488 -0
  84. package/examples/proof/odrl-dpv-risk-ranked.pl +637 -0
  85. package/examples/proof/odrl-policy-advanced.pl +705 -0
  86. package/examples/proof/odrl-policy-reasoning.pl +1423 -0
  87. package/examples/proof/odrl-policy.pl +103 -0
  88. package/examples/proof/operational-incident-response.pl +435 -0
  89. package/examples/proof/orbital-transfer-design.pl +288 -0
  90. package/examples/proof/path-discovery.pl +502 -0
  91. package/examples/proof/peano-arithmetic.pl +910 -0
  92. package/examples/proof/peano-calculus.pl +294 -0
  93. package/examples/proof/pell-equation.pl +295 -0
  94. package/examples/proof/pendulum-period.pl +97 -0
  95. package/examples/proof/pi.pl +3 -0
  96. package/examples/proof/pointer-analysis.pl +94 -0
  97. package/examples/proof/polynomial.pl +2487 -0
  98. package/examples/proof/portable-library-overlap.pl +6 -0
  99. package/examples/proof/quadratic-formula.pl +159 -0
  100. package/examples/proof/quine-mccluskey.pl +914 -0
  101. package/examples/proof/radioactive-decay.pl +104 -0
  102. package/examples/proof/rdf12-annotated-claims.pl +263 -0
  103. package/examples/proof/register-allocation.pl +120 -0
  104. package/examples/proof/relational-cube-lookup.pl +15867 -0
  105. package/examples/proof/riemann-hypothesis.pl +148 -0
  106. package/examples/proof/sat-solver-dpll.pl +226 -0
  107. package/examples/proof/scientific-evidence-graph.pl +681 -0
  108. package/examples/proof/send-more-money.pl +252 -0
  109. package/examples/proof/service-impact.pl +151 -0
  110. package/examples/proof/shoelace-polygon-area.pl +161 -0
  111. package/examples/proof/skolem-functions.pl +128 -0
  112. package/examples/proof/statistics-summary.pl +250 -0
  113. package/examples/proof/stirling-bell-numbers.pl +125 -0
  114. package/examples/proof/superdense-coding.pl +118 -0
  115. package/examples/proof/symbiotic-knowledge-graph.pl +1569 -0
  116. package/examples/proof/truth-maintenance-system.pl +466 -0
  117. package/examples/proof/turing.pl +1183 -0
  118. package/examples/proof/type-inference.pl +267 -0
  119. package/examples/proof/vector-similarity.pl +163 -0
  120. package/examples/proof/vulnerability-impact.pl +180 -0
  121. package/examples/proof/wolf-goat-cabbage.pl +339 -0
  122. package/examples/proof/zebra.pl +176 -0
  123. package/package.json +1 -1
  124. package/src/check-proof.js +159 -11
  125. package/test/conformance/NEUMERKEL-LATEST.md +3 -3
  126. package/test/regression/cases-white-box.mjs +38 -0
  127. package/test/run-examples.mjs +7 -111
  128. package/test/run-proof-checking.mjs +28 -5
  129. package/the-art-of-eyeprolog.md +4 -2
@@ -0,0 +1,6 @@
1
+ overlap_example(overlap(booleans([1, 0]), union("abc"), reachable("abc"), filtered("aa"), awakened(yes), generated(shared1), uppercase("A"), transposed([[1, 4], [2, 5], [3, 6]]), tabled_paths("bc"))).
2
+
3
+ step(overlap_example(overlap(booleans([1, 0]), union("abc"), reachable("abc"), filtered("aa"), awakened(yes), generated(shared1), uppercase("A"), transposed([[1, 4], [2, 5], [3, 6]]), tabled_paths("bc"))),
4
+ unproven,
5
+ [],
6
+ []).
@@ -0,0 +1,159 @@
1
+ discriminant(eq1, 1.0).
2
+ discriminant(eq2, 64.0).
3
+ root(eq1, 3.0).
4
+ root(eq2, 3.0).
5
+ root(eq1, 2.0).
6
+ root(eq2, -1.0).
7
+
8
+ clause(1, equation(eq1, 1.0, -5.0, 6.0), true).
9
+ clause(2, equation(eq2, 2.0, -4.0, -6.0), true).
10
+ clause(3,
11
+ discriminant(var('Case'), var('D')),
12
+ (equation(var('Case'), var('A'), var('B'), var('C')),
13
+ var('B2') is var('B') ** 2.0,
14
+ var('Foura') is 4.0 * var('A'),
15
+ var('Fourac') is var('Foura') * var('C'),
16
+ var('D') is var('B2') - var('Fourac'))).
17
+ clause(4,
18
+ sqrt_discriminant(var('Case'), var('S')),
19
+ (discriminant(var('Case'), var('D')), var('D') >= 0.0, var('S') is var('D') ** 0.5)).
20
+ clause(5,
21
+ negative_b(var('Case'), var('Nb')),
22
+ (equation(var('Case'), anonymous(1), var('B'), anonymous(2)), var('Nb') is - var('B'))).
23
+ clause(6,
24
+ denominator(var('Case'), var('Den')),
25
+ (equation(var('Case'), var('A'), anonymous(1), anonymous(2)),
26
+ var('Den') is 2.0 * var('A'))).
27
+ clause(7,
28
+ root_plus(var('Case'), var('Root')),
29
+ (negative_b(var('Case'), var('Nb')),
30
+ sqrt_discriminant(var('Case'), var('S')),
31
+ denominator(var('Case'), var('Den')),
32
+ var('Numerator') is var('Nb') + var('S'),
33
+ var('Root') is var('Numerator') / var('Den'))).
34
+ clause(8,
35
+ root_minus(var('Case'), var('Root')),
36
+ (negative_b(var('Case'), var('Nb')),
37
+ sqrt_discriminant(var('Case'), var('S')),
38
+ denominator(var('Case'), var('Den')),
39
+ var('Numerator') is var('Nb') - var('S'),
40
+ var('Root') is var('Numerator') / var('Den'))).
41
+ clause(9, root(var('Case'), var('Root')), root_plus(var('Case'), var('Root'))).
42
+ clause(10, root(var('Case'), var('Root')), root_minus(var('Case'), var('Root'))).
43
+
44
+ step(discriminant(eq1, 1.0),
45
+ rule(3),
46
+ ['Case' = eq1,
47
+ 'D' = 1.0,
48
+ 'A' = 1.0,
49
+ 'B' = -5.0,
50
+ 'C' = 6.0,
51
+ 'B2' = 25.0,
52
+ 'Foura' = 4.0,
53
+ 'Fourac' = 24.0],
54
+ [equation(eq1, 1.0, -5.0, 6.0),
55
+ 25.0 is -5.0 ** 2.0,
56
+ 4.0 is 4.0 * 1.0,
57
+ 24.0 is 4.0 * 6.0,
58
+ 1.0 is 25.0 - 24.0]).
59
+ step(equation(eq1, 1.0, -5.0, 6.0), fact(1), [], []).
60
+ step(25.0 is -5.0 ** 2.0, builtin, [], []).
61
+ step(4.0 is 4.0 * 1.0, builtin, [], []).
62
+ step(24.0 is 4.0 * 6.0, builtin, [], []).
63
+ step(1.0 is 25.0 - 24.0, builtin, [], []).
64
+ step(discriminant(eq2, 64.0),
65
+ rule(3),
66
+ ['Case' = eq2,
67
+ 'D' = 64.0,
68
+ 'A' = 2.0,
69
+ 'B' = -4.0,
70
+ 'C' = -6.0,
71
+ 'B2' = 16.0,
72
+ 'Foura' = 8.0,
73
+ 'Fourac' = -48.0],
74
+ [equation(eq2, 2.0, -4.0, -6.0),
75
+ 16.0 is -4.0 ** 2.0,
76
+ 8.0 is 4.0 * 2.0,
77
+ -48.0 is 8.0 * -6.0,
78
+ 64.0 is 16.0 - -48.0]).
79
+ step(equation(eq2, 2.0, -4.0, -6.0), fact(2), [], []).
80
+ step(16.0 is -4.0 ** 2.0, builtin, [], []).
81
+ step(8.0 is 4.0 * 2.0, builtin, [], []).
82
+ step(-48.0 is 8.0 * -6.0, builtin, [], []).
83
+ step(64.0 is 16.0 - -48.0, builtin, [], []).
84
+ step(root(eq1, 3.0), rule(9), ['Case' = eq1, 'Root' = 3.0], [root_plus(eq1, 3.0)]).
85
+ step(root_plus(eq1, 3.0),
86
+ rule(7),
87
+ ['Case' = eq1, 'Root' = 3.0, 'Nb' = 5.0, 'S' = 1.0, 'Den' = 2.0, 'Numerator' = 6.0],
88
+ [negative_b(eq1, 5.0),
89
+ sqrt_discriminant(eq1, 1.0),
90
+ denominator(eq1, 2.0),
91
+ 6.0 is 5.0 + 1.0,
92
+ 3.0 is 6.0 / 2.0]).
93
+ step(negative_b(eq1, 5.0),
94
+ rule(5),
95
+ ['Case' = eq1, 'Nb' = 5.0, 'B' = -5.0],
96
+ [equation(eq1, 1.0, -5.0, 6.0), 5.0 is - -5.0]).
97
+ step(5.0 is - -5.0, builtin, [], []).
98
+ step(sqrt_discriminant(eq1, 1.0),
99
+ rule(4),
100
+ ['Case' = eq1, 'S' = 1.0, 'D' = 1.0],
101
+ [discriminant(eq1, 1.0), 1.0 >= 0.0, 1.0 is 1.0 ** 0.5]).
102
+ step(1.0 >= 0.0, builtin, [], []).
103
+ step(1.0 is 1.0 ** 0.5, builtin, [], []).
104
+ step(denominator(eq1, 2.0),
105
+ rule(6),
106
+ ['Case' = eq1, 'Den' = 2.0, 'A' = 1.0],
107
+ [equation(eq1, 1.0, -5.0, 6.0), 2.0 is 2.0 * 1.0]).
108
+ step(2.0 is 2.0 * 1.0, builtin, [], []).
109
+ step(6.0 is 5.0 + 1.0, builtin, [], []).
110
+ step(3.0 is 6.0 / 2.0, builtin, [], []).
111
+ step(root(eq2, 3.0), rule(9), ['Case' = eq2, 'Root' = 3.0], [root_plus(eq2, 3.0)]).
112
+ step(root_plus(eq2, 3.0),
113
+ rule(7),
114
+ ['Case' = eq2, 'Root' = 3.0, 'Nb' = 4.0, 'S' = 8.0, 'Den' = 4.0, 'Numerator' = 12.0],
115
+ [negative_b(eq2, 4.0),
116
+ sqrt_discriminant(eq2, 8.0),
117
+ denominator(eq2, 4.0),
118
+ 12.0 is 4.0 + 8.0,
119
+ 3.0 is 12.0 / 4.0]).
120
+ step(negative_b(eq2, 4.0),
121
+ rule(5),
122
+ ['Case' = eq2, 'Nb' = 4.0, 'B' = -4.0],
123
+ [equation(eq2, 2.0, -4.0, -6.0), 4.0 is - -4.0]).
124
+ step(4.0 is - -4.0, builtin, [], []).
125
+ step(sqrt_discriminant(eq2, 8.0),
126
+ rule(4),
127
+ ['Case' = eq2, 'S' = 8.0, 'D' = 64.0],
128
+ [discriminant(eq2, 64.0), 64.0 >= 0.0, 8.0 is 64.0 ** 0.5]).
129
+ step(64.0 >= 0.0, builtin, [], []).
130
+ step(8.0 is 64.0 ** 0.5, builtin, [], []).
131
+ step(denominator(eq2, 4.0),
132
+ rule(6),
133
+ ['Case' = eq2, 'Den' = 4.0, 'A' = 2.0],
134
+ [equation(eq2, 2.0, -4.0, -6.0), 4.0 is 2.0 * 2.0]).
135
+ step(4.0 is 2.0 * 2.0, builtin, [], []).
136
+ step(12.0 is 4.0 + 8.0, builtin, [], []).
137
+ step(3.0 is 12.0 / 4.0, builtin, [], []).
138
+ step(root(eq1, 2.0), rule(10), ['Case' = eq1, 'Root' = 2.0], [root_minus(eq1, 2.0)]).
139
+ step(root_minus(eq1, 2.0),
140
+ rule(8),
141
+ ['Case' = eq1, 'Root' = 2.0, 'Nb' = 5.0, 'S' = 1.0, 'Den' = 2.0, 'Numerator' = 4.0],
142
+ [negative_b(eq1, 5.0),
143
+ sqrt_discriminant(eq1, 1.0),
144
+ denominator(eq1, 2.0),
145
+ 4.0 is 5.0 - 1.0,
146
+ 2.0 is 4.0 / 2.0]).
147
+ step(4.0 is 5.0 - 1.0, builtin, [], []).
148
+ step(2.0 is 4.0 / 2.0, builtin, [], []).
149
+ step(root(eq2, -1.0), rule(10), ['Case' = eq2, 'Root' = -1.0], [root_minus(eq2, -1.0)]).
150
+ step(root_minus(eq2, -1.0),
151
+ rule(8),
152
+ ['Case' = eq2, 'Root' = -1.0, 'Nb' = 4.0, 'S' = 8.0, 'Den' = 4.0, 'Numerator' = -4.0],
153
+ [negative_b(eq2, 4.0),
154
+ sqrt_discriminant(eq2, 8.0),
155
+ denominator(eq2, 4.0),
156
+ -4.0 is 4.0 - 8.0,
157
+ -1.0 is -4.0 / 4.0]).
158
+ step(-4.0 is 4.0 - 8.0, builtin, [], []).
159
+ step(-1.0 is -4.0 / 4.0, builtin, [], []).