eyeling 1.34.5 → 1.34.6

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 (307) hide show
  1. package/README.md +3 -90
  2. package/bin/eyeling.cjs +4 -56
  3. package/dist/browser/eyeling.browser.js +0 -1
  4. package/examples/context-schema-audit.n3 +1 -1
  5. package/eyeling.js +0 -1
  6. package/index.d.ts +3 -37
  7. package/index.js +1 -90
  8. package/lib/cli.js +0 -1
  9. package/package.json +3 -12
  10. package/test/packlist.test.js +0 -2
  11. package/test/run.js +0 -2
  12. package/docs/eyelang-guide.md +0 -535
  13. package/docs/eyelang-language-reference.md +0 -697
  14. package/examples/eyelang/access-control-policy.pl +0 -52
  15. package/examples/eyelang/ackermann.pl +0 -46
  16. package/examples/eyelang/age.pl +0 -28
  17. package/examples/eyelang/aliases-and-namespaces.pl +0 -22
  18. package/examples/eyelang/alignment-demo.pl +0 -44
  19. package/examples/eyelang/allen-interval-calculus.pl +0 -64
  20. package/examples/eyelang/ancestor.pl +0 -21
  21. package/examples/eyelang/animal.pl +0 -21
  22. package/examples/eyelang/annotation.pl +0 -34
  23. package/examples/eyelang/auroracare.pl +0 -309
  24. package/examples/eyelang/backward.pl +0 -12
  25. package/examples/eyelang/basic-monadic.pl +0 -10032
  26. package/examples/eyelang/bayes-diagnosis.pl +0 -108
  27. package/examples/eyelang/bayes-therapy.pl +0 -182
  28. package/examples/eyelang/beam-deflection.pl +0 -50
  29. package/examples/eyelang/blocks-world-planning.pl +0 -75
  30. package/examples/eyelang/bmi.pl +0 -232
  31. package/examples/eyelang/braking-safety-worlds.pl +0 -69
  32. package/examples/eyelang/buck-converter-design.pl +0 -78
  33. package/examples/eyelang/cache-performance.pl +0 -54
  34. package/examples/eyelang/canary-release.pl +0 -49
  35. package/examples/eyelang/cat-koko.pl +0 -24
  36. package/examples/eyelang/clinical-trial-screening.pl +0 -92
  37. package/examples/eyelang/combinatorics-findall-sort.pl +0 -37
  38. package/examples/eyelang/competitive-enzyme-kinetics.pl +0 -78
  39. package/examples/eyelang/complex.pl +0 -121
  40. package/examples/eyelang/composition-of-injective-functions-is-injective.pl +0 -50
  41. package/examples/eyelang/context-association.pl +0 -53
  42. package/examples/eyelang/context-schema-audit.pl +0 -46
  43. package/examples/eyelang/control-system.pl +0 -72
  44. package/examples/eyelang/cyclic-path.pl +0 -16
  45. package/examples/eyelang/d3-group.pl +0 -100
  46. package/examples/eyelang/dairy-energy-balance.pl +0 -65
  47. package/examples/eyelang/data-negotiation.pl +0 -39
  48. package/examples/eyelang/deep-taxonomy-10.pl +0 -115
  49. package/examples/eyelang/deep-taxonomy-100.pl +0 -385
  50. package/examples/eyelang/deep-taxonomy-1000.pl +0 -3085
  51. package/examples/eyelang/deep-taxonomy-10000.pl +0 -30094
  52. package/examples/eyelang/deep-taxonomy-100000.pl +0 -300184
  53. package/examples/eyelang/delfour.pl +0 -281
  54. package/examples/eyelang/deontic-logic.pl +0 -52
  55. package/examples/eyelang/derived-backward-rule.pl +0 -30
  56. package/examples/eyelang/derived-rule.pl +0 -27
  57. package/examples/eyelang/diamond-property.pl +0 -38
  58. package/examples/eyelang/dijkstra-findall-sort.pl +0 -44
  59. package/examples/eyelang/dijkstra-risk-path.pl +0 -86
  60. package/examples/eyelang/dijkstra.pl +0 -46
  61. package/examples/eyelang/dining-philosophers.pl +0 -140
  62. package/examples/eyelang/dog.pl +0 -25
  63. package/examples/eyelang/dpv-odrl-purpose-mapping.pl +0 -46
  64. package/examples/eyelang/drone-corridor-planner.pl +0 -51
  65. package/examples/eyelang/easter-computus.pl +0 -89
  66. package/examples/eyelang/electrical-rc-filter.pl +0 -36
  67. package/examples/eyelang/epidemic-policy.pl +0 -67
  68. package/examples/eyelang/equivalence-classes-overlap-implies-same-class.pl +0 -27
  69. package/examples/eyelang/eulerian-path.pl +0 -85
  70. package/examples/eyelang/ev-range-worlds.pl +0 -82
  71. package/examples/eyelang/existential-rule.pl +0 -18
  72. package/examples/eyelang/exoplanet-validation-worlds.pl +0 -88
  73. package/examples/eyelang/expression-eval.pl +0 -43
  74. package/examples/eyelang/family-cousins.pl +0 -65
  75. package/examples/eyelang/fastpow.pl +0 -53
  76. package/examples/eyelang/fft8-numeric.pl +0 -83
  77. package/examples/eyelang/fibonacci.pl +0 -53
  78. package/examples/eyelang/field-nitrogen-balance.pl +0 -70
  79. package/examples/eyelang/flandor.pl +0 -296
  80. package/examples/eyelang/floating-point.pl +0 -23
  81. package/examples/eyelang/four-color-map.pl +0 -127
  82. package/examples/eyelang/fundamental-theorem-arithmetic.pl +0 -113
  83. package/examples/eyelang/gd-step-certified.pl +0 -158
  84. package/examples/eyelang/gdpr-compliance.pl +0 -69
  85. package/examples/eyelang/good-cobbler.pl +0 -14
  86. package/examples/eyelang/gps.pl +0 -152
  87. package/examples/eyelang/graph-reachability.pl +0 -36
  88. package/examples/eyelang/gray-code-counter.pl +0 -48
  89. package/examples/eyelang/greatest-lower-bound-uniqueness.pl +0 -28
  90. package/examples/eyelang/group-inverse-uniqueness.pl +0 -34
  91. package/examples/eyelang/hamiltonian-path.pl +0 -49
  92. package/examples/eyelang/hamming-code.pl +0 -105
  93. package/examples/eyelang/hanoi.pl +0 -20
  94. package/examples/eyelang/heat-loss.pl +0 -51
  95. package/examples/eyelang/heron-theorem.pl +0 -36
  96. package/examples/eyelang/ideal-gas-law.pl +0 -37
  97. package/examples/eyelang/illegitimate-reasoning.pl +0 -88
  98. package/examples/eyelang/knowledge-engineering-alignment-flow.pl +0 -40
  99. package/examples/eyelang/law-of-cosines.pl +0 -31
  100. package/examples/eyelang/least-squares-regression.pl +0 -81
  101. package/examples/eyelang/list-collection.pl +0 -33
  102. package/examples/eyelang/lldm.pl +0 -78
  103. package/examples/eyelang/manufacturing-quality-control.pl +0 -73
  104. package/examples/eyelang/microgrid-dispatch.pl +0 -85
  105. package/examples/eyelang/monkey-bananas.pl +0 -45
  106. package/examples/eyelang/network-sla.pl +0 -48
  107. package/examples/eyelang/newton-raphson.pl +0 -49
  108. package/examples/eyelang/nixon-diamond.pl +0 -37
  109. package/examples/eyelang/observability-log-correlation.pl +0 -34
  110. package/examples/eyelang/odrl-dpv-fpv-trust-flow.pl +0 -43
  111. package/examples/eyelang/odrl-dpv-healthcare-risk-ranked.pl +0 -266
  112. package/examples/eyelang/odrl-dpv-risk-ranked.pl +0 -320
  113. package/examples/eyelang/orbital-transfer-design.pl +0 -113
  114. package/examples/eyelang/output/access-control-policy.pl +0 -2
  115. package/examples/eyelang/output/ackermann.pl +0 -12
  116. package/examples/eyelang/output/age.pl +0 -2
  117. package/examples/eyelang/output/aliases-and-namespaces.pl +0 -5
  118. package/examples/eyelang/output/alignment-demo.pl +0 -32
  119. package/examples/eyelang/output/allen-interval-calculus.pl +0 -154
  120. package/examples/eyelang/output/ancestor.pl +0 -6
  121. package/examples/eyelang/output/animal.pl +0 -4
  122. package/examples/eyelang/output/annotation.pl +0 -4
  123. package/examples/eyelang/output/auroracare.pl +0 -117
  124. package/examples/eyelang/output/backward.pl +0 -1
  125. package/examples/eyelang/output/basic-monadic.pl +0 -1518
  126. package/examples/eyelang/output/bayes-diagnosis.pl +0 -13
  127. package/examples/eyelang/output/bayes-therapy.pl +0 -23
  128. package/examples/eyelang/output/beam-deflection.pl +0 -5
  129. package/examples/eyelang/output/blocks-world-planning.pl +0 -4
  130. package/examples/eyelang/output/bmi.pl +0 -32
  131. package/examples/eyelang/output/braking-safety-worlds.pl +0 -18
  132. package/examples/eyelang/output/buck-converter-design.pl +0 -6
  133. package/examples/eyelang/output/cache-performance.pl +0 -4
  134. package/examples/eyelang/output/canary-release.pl +0 -5
  135. package/examples/eyelang/output/cat-koko.pl +0 -3
  136. package/examples/eyelang/output/clinical-trial-screening.pl +0 -9
  137. package/examples/eyelang/output/combinatorics-findall-sort.pl +0 -2
  138. package/examples/eyelang/output/competitive-enzyme-kinetics.pl +0 -6
  139. package/examples/eyelang/output/complex.pl +0 -1
  140. package/examples/eyelang/output/composition-of-injective-functions-is-injective.pl +0 -2
  141. package/examples/eyelang/output/context-association.pl +0 -3
  142. package/examples/eyelang/output/context-schema-audit.pl +0 -12
  143. package/examples/eyelang/output/control-system.pl +0 -6
  144. package/examples/eyelang/output/cyclic-path.pl +0 -16
  145. package/examples/eyelang/output/d3-group.pl +0 -2
  146. package/examples/eyelang/output/dairy-energy-balance.pl +0 -13
  147. package/examples/eyelang/output/data-negotiation.pl +0 -1
  148. package/examples/eyelang/output/deep-taxonomy-10.pl +0 -16
  149. package/examples/eyelang/output/deep-taxonomy-100.pl +0 -16
  150. package/examples/eyelang/output/deep-taxonomy-1000.pl +0 -16
  151. package/examples/eyelang/output/deep-taxonomy-10000.pl +0 -16
  152. package/examples/eyelang/output/deep-taxonomy-100000.pl +0 -16
  153. package/examples/eyelang/output/delfour.pl +0 -31
  154. package/examples/eyelang/output/deontic-logic.pl +0 -4
  155. package/examples/eyelang/output/derived-backward-rule.pl +0 -3
  156. package/examples/eyelang/output/derived-rule.pl +0 -2
  157. package/examples/eyelang/output/diamond-property.pl +0 -4
  158. package/examples/eyelang/output/dijkstra-findall-sort.pl +0 -2
  159. package/examples/eyelang/output/dijkstra-risk-path.pl +0 -29
  160. package/examples/eyelang/output/dijkstra.pl +0 -16
  161. package/examples/eyelang/output/dining-philosophers.pl +0 -350
  162. package/examples/eyelang/output/dog.pl +0 -1
  163. package/examples/eyelang/output/dpv-odrl-purpose-mapping.pl +0 -18
  164. package/examples/eyelang/output/drone-corridor-planner.pl +0 -17
  165. package/examples/eyelang/output/easter-computus.pl +0 -30
  166. package/examples/eyelang/output/electrical-rc-filter.pl +0 -3
  167. package/examples/eyelang/output/epidemic-policy.pl +0 -14
  168. package/examples/eyelang/output/equivalence-classes-overlap-implies-same-class.pl +0 -18
  169. package/examples/eyelang/output/eulerian-path.pl +0 -3
  170. package/examples/eyelang/output/ev-range-worlds.pl +0 -19
  171. package/examples/eyelang/output/existential-rule.pl +0 -2
  172. package/examples/eyelang/output/exoplanet-validation-worlds.pl +0 -22
  173. package/examples/eyelang/output/expression-eval.pl +0 -1
  174. package/examples/eyelang/output/family-cousins.pl +0 -28
  175. package/examples/eyelang/output/fastpow.pl +0 -6
  176. package/examples/eyelang/output/fft8-numeric.pl +0 -4
  177. package/examples/eyelang/output/fibonacci.pl +0 -6
  178. package/examples/eyelang/output/field-nitrogen-balance.pl +0 -21
  179. package/examples/eyelang/output/flandor.pl +0 -43
  180. package/examples/eyelang/output/floating-point.pl +0 -9
  181. package/examples/eyelang/output/four-color-map.pl +0 -3
  182. package/examples/eyelang/output/fundamental-theorem-arithmetic.pl +0 -9
  183. package/examples/eyelang/output/gd-step-certified.pl +0 -79
  184. package/examples/eyelang/output/gdpr-compliance.pl +0 -6
  185. package/examples/eyelang/output/good-cobbler.pl +0 -1
  186. package/examples/eyelang/output/gps.pl +0 -21
  187. package/examples/eyelang/output/graph-reachability.pl +0 -3
  188. package/examples/eyelang/output/gray-code-counter.pl +0 -1
  189. package/examples/eyelang/output/greatest-lower-bound-uniqueness.pl +0 -2
  190. package/examples/eyelang/output/group-inverse-uniqueness.pl +0 -2
  191. package/examples/eyelang/output/hamiltonian-path.pl +0 -121
  192. package/examples/eyelang/output/hamming-code.pl +0 -6
  193. package/examples/eyelang/output/hanoi.pl +0 -1
  194. package/examples/eyelang/output/heat-loss.pl +0 -5
  195. package/examples/eyelang/output/heron-theorem.pl +0 -4
  196. package/examples/eyelang/output/ideal-gas-law.pl +0 -3
  197. package/examples/eyelang/output/illegitimate-reasoning.pl +0 -15
  198. package/examples/eyelang/output/knowledge-engineering-alignment-flow.pl +0 -17
  199. package/examples/eyelang/output/law-of-cosines.pl +0 -3
  200. package/examples/eyelang/output/least-squares-regression.pl +0 -5
  201. package/examples/eyelang/output/list-collection.pl +0 -3
  202. package/examples/eyelang/output/lldm.pl +0 -6
  203. package/examples/eyelang/output/manufacturing-quality-control.pl +0 -6
  204. package/examples/eyelang/output/microgrid-dispatch.pl +0 -6
  205. package/examples/eyelang/output/monkey-bananas.pl +0 -5
  206. package/examples/eyelang/output/network-sla.pl +0 -4
  207. package/examples/eyelang/output/newton-raphson.pl +0 -3
  208. package/examples/eyelang/output/nixon-diamond.pl +0 -5
  209. package/examples/eyelang/output/observability-log-correlation.pl +0 -28
  210. package/examples/eyelang/output/odrl-dpv-fpv-trust-flow.pl +0 -9
  211. package/examples/eyelang/output/odrl-dpv-healthcare-risk-ranked.pl +0 -42
  212. package/examples/eyelang/output/odrl-dpv-risk-ranked.pl +0 -120
  213. package/examples/eyelang/output/orbital-transfer-design.pl +0 -7
  214. package/examples/eyelang/output/path-discovery.pl +0 -3
  215. package/examples/eyelang/output/peano-arithmetic.pl +0 -3
  216. package/examples/eyelang/output/peasant.pl +0 -10
  217. package/examples/eyelang/output/pendulum-period.pl +0 -4
  218. package/examples/eyelang/output/polynomial.pl +0 -14
  219. package/examples/eyelang/output/proof-contrapositive.pl +0 -3
  220. package/examples/eyelang/output/quadratic-formula.pl +0 -6
  221. package/examples/eyelang/output/radioactive-decay.pl +0 -5
  222. package/examples/eyelang/output/reusable-builtins.pl +0 -5
  223. package/examples/eyelang/output/riemann-hypothesis.pl +0 -12
  224. package/examples/eyelang/output/security-incident-correlation.pl +0 -3
  225. package/examples/eyelang/output/service-impact.pl +0 -11
  226. package/examples/eyelang/output/sieve.pl +0 -1
  227. package/examples/eyelang/output/skolem-functions.pl +0 -16
  228. package/examples/eyelang/output/socket-age.pl +0 -1
  229. package/examples/eyelang/output/socket-family.pl +0 -3
  230. package/examples/eyelang/output/socrates.pl +0 -2
  231. package/examples/eyelang/output/statistics-summary.pl +0 -4
  232. package/examples/eyelang/output/superdense-coding.pl +0 -6
  233. package/examples/eyelang/output/term-tools.pl +0 -6
  234. package/examples/eyelang/output/trust-flow-provenance-threshold.pl +0 -6
  235. package/examples/eyelang/output/turing.pl +0 -12
  236. package/examples/eyelang/output/vector-similarity.pl +0 -4
  237. package/examples/eyelang/output/vulnerability-impact.pl +0 -20
  238. package/examples/eyelang/output/witch.pl +0 -7
  239. package/examples/eyelang/output/wolf-goat-cabbage.pl +0 -3
  240. package/examples/eyelang/output/zebra.pl +0 -3
  241. package/examples/eyelang/path-discovery.pl +0 -45013
  242. package/examples/eyelang/peano-arithmetic.pl +0 -31
  243. package/examples/eyelang/peasant.pl +0 -30
  244. package/examples/eyelang/pendulum-period.pl +0 -50
  245. package/examples/eyelang/polynomial.pl +0 -124
  246. package/examples/eyelang/proof/age.pl +0 -71
  247. package/examples/eyelang/proof/aliases-and-namespaces.pl +0 -78
  248. package/examples/eyelang/proof/ancestor.pl +0 -140
  249. package/examples/eyelang/proof/animal.pl +0 -68
  250. package/examples/eyelang/proof/annotation.pl +0 -80
  251. package/examples/eyelang/proof/backward.pl +0 -22
  252. package/examples/eyelang/proof/cat-koko.pl +0 -86
  253. package/examples/eyelang/proof/data-negotiation.pl +0 -76
  254. package/examples/eyelang/proof/derived-rule.pl +0 -43
  255. package/examples/eyelang/proof/dog.pl +0 -31
  256. package/examples/eyelang/proof/electrical-rc-filter.pl +0 -105
  257. package/examples/eyelang/proof/existential-rule.pl +0 -40
  258. package/examples/eyelang/proof/floating-point.pl +0 -160
  259. package/examples/eyelang/proof/good-cobbler.pl +0 -16
  260. package/examples/eyelang/proof/group-inverse-uniqueness.pl +0 -84
  261. package/examples/eyelang/proof/list-collection.pl +0 -52
  262. package/examples/eyelang/proof/proof-contrapositive.pl +0 -78
  263. package/examples/eyelang/proof/socket-age.pl +0 -32
  264. package/examples/eyelang/proof/socket-family.pl +0 -59
  265. package/examples/eyelang/proof/socrates.pl +0 -38
  266. package/examples/eyelang/proof-contrapositive.pl +0 -27
  267. package/examples/eyelang/quadratic-formula.pl +0 -54
  268. package/examples/eyelang/radioactive-decay.pl +0 -56
  269. package/examples/eyelang/reusable-builtins.pl +0 -32
  270. package/examples/eyelang/riemann-hypothesis.pl +0 -110
  271. package/examples/eyelang/security-incident-correlation.pl +0 -69
  272. package/examples/eyelang/service-impact.pl +0 -41
  273. package/examples/eyelang/sieve.pl +0 -20
  274. package/examples/eyelang/skolem-functions.pl +0 -52
  275. package/examples/eyelang/socket-age.pl +0 -39
  276. package/examples/eyelang/socket-family.pl +0 -28
  277. package/examples/eyelang/socrates.pl +0 -19
  278. package/examples/eyelang/statistics-summary.pl +0 -54
  279. package/examples/eyelang/superdense-coding.pl +0 -84
  280. package/examples/eyelang/term-tools.pl +0 -23
  281. package/examples/eyelang/trust-flow-provenance-threshold.pl +0 -40
  282. package/examples/eyelang/turing.pl +0 -67
  283. package/examples/eyelang/vector-similarity.pl +0 -56
  284. package/examples/eyelang/vulnerability-impact.pl +0 -70
  285. package/examples/eyelang/witch.pl +0 -38
  286. package/examples/eyelang/wolf-goat-cabbage.pl +0 -56
  287. package/examples/eyelang/zebra.pl +0 -44
  288. package/eyelang.d.ts +0 -80
  289. package/lib/eyelang/bin.js +0 -7
  290. package/lib/eyelang/builtins/aggregation.js +0 -81
  291. package/lib/eyelang/builtins/arithmetic.js +0 -208
  292. package/lib/eyelang/builtins/context.js +0 -42
  293. package/lib/eyelang/builtins/control.js +0 -34
  294. package/lib/eyelang/builtins/core.js +0 -78
  295. package/lib/eyelang/builtins/lists.js +0 -283
  296. package/lib/eyelang/builtins/registry.js +0 -48
  297. package/lib/eyelang/builtins/strings.js +0 -234
  298. package/lib/eyelang/builtins/terms.js +0 -66
  299. package/lib/eyelang/cli.js +0 -180
  300. package/lib/eyelang/explain.js +0 -324
  301. package/lib/eyelang/hash.js +0 -294
  302. package/lib/eyelang/index.js +0 -47
  303. package/lib/eyelang/package.json +0 -3
  304. package/lib/eyelang/parser.js +0 -428
  305. package/lib/eyelang/program.js +0 -237
  306. package/lib/eyelang/solver.js +0 -237
  307. package/lib/eyelang/term.js +0 -328
@@ -1,53 +0,0 @@
1
- % Context association adapted from Eyeling context-association.n3.
2
- %
3
- % This version keeps the original shape: each context is named with log_nameOf
4
- % and its contents remain quoted formula data. Nothing inside the three formulae
5
- % is asserted globally unless a rule explicitly projects it.
6
-
7
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
8
- materialize(log_nameOf, 2).
9
- materialize(dataGraph, 2).
10
- materialize(signatureGraph, 2).
11
- materialize(metadataGraph, 2).
12
-
13
- % Program structure: facts set up the scenario, and rules derive the materialized conclusions.
14
- log_nameOf(skolem_g0, foaf_name(bob, "Bob")).
15
-
16
- log_nameOf(skolem_g1, (
17
- sec_proof(skolem_g0, dataSignature),
18
- type(signature1, sec_DataIntegrityProof),
19
- sec_cryptosuite(signature1, "ecdsa-proof-2019"),
20
- sec_created(signature1, "2021-11-13T18:19:39Z"),
21
- sec_verificationMethod(signature1, "https://university.example/issuers/14#key-1"),
22
- sec_proofPurpose(signature1, "assertionMethod"),
23
- sec_proofValue(signature1, "z58DAdFfa9SkqZMVPxAQp...jQCrfFPP2oumHKtz"),
24
- sec_issuer(signature1, university),
25
- sec_validFrom(signature1, "2024-04-03T00:00:00.000Z"),
26
- sec_validUntil(signature1, "2025-04-03T00:00:00.000Z")
27
- )).
28
-
29
- log_nameOf(g3, (
30
- sec_proof(skolem_g1, signature2),
31
- type(signature2, sec_DataIntegrityProof),
32
- sec_cryptosuite(signature2, "ecdsa-proof-2019"),
33
- sec_created(signature2, "2021-11-13T18:19:39Z"),
34
- sec_verificationMethod(signature2, "https://university.example/issuers/14#key-1"),
35
- sec_proofPurpose(signature2, "assertionMethod"),
36
- sec_proofValue(signature2, "adad123efv434r5200...dqed2t44v43das")
37
- )).
38
-
39
- % A tiny projection shows how a program can inspect a quoted context without
40
- % making the entire context globally true.
41
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
42
- context_statement(ContextName, Subject, Predicate, Object) :-
43
- log_nameOf(ContextName, Context),
44
- holds(Context, Predicate, [Subject, Object]).
45
-
46
- dataGraph(association, skolem_g0) :-
47
- context_statement(skolem_g0, bob, foaf_name, "Bob").
48
-
49
- signatureGraph(association, skolem_g1) :-
50
- context_statement(skolem_g1, skolem_g0, sec_proof, dataSignature).
51
-
52
- metadataGraph(association, g3) :-
53
- context_statement(g3, skolem_g1, sec_proof, signature2).
@@ -1,46 +0,0 @@
1
- % Context schema audit.
2
- %
3
- % This example needs holds/3 rather than holds/2 because the audit rule does
4
- % not know the predicate names or arities in advance. It inspects a whole
5
- % context as data, extracts each member as Name + Args, computes the arity, and
6
- % checks that shape against an allowed schema.
7
-
8
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
9
- materialize(context_shape, 3).
10
- materialize(schema_violation, 3).
11
-
12
- % Program structure: each message carries heterogeneous context data. The
13
- % members deliberately use different arities: heartbeat/0, source/1,
14
- % temperature/2, gps/3, and signature/4.
15
- message_context(msg_ok, (
16
- heartbeat,
17
- source(sensor17),
18
- temperature(sensor17, 38),
19
- gps(sensor17, 51, 4),
20
- signature(sensor17, sha256, "9f86d081", "2026-06-18T09:30:00Z")
21
- )).
22
-
23
- message_context(msg_bad, (
24
- heartbeat,
25
- source(sensor18),
26
- temperature(sensor18, 99),
27
- gps(sensor18, 51),
28
- tampered(sensor18)
29
- )).
30
-
31
- allowed_shape(heartbeat, 0).
32
- allowed_shape(source, 1).
33
- allowed_shape(temperature, 2).
34
- allowed_shape(gps, 3).
35
- allowed_shape(signature, 4).
36
-
37
- % Derivation rules: holds/3 exposes arbitrary context members as predicate name
38
- % plus argument list, so one generic rule can audit mixed-arity data.
39
- context_shape(Message, Name, Arity) :-
40
- message_context(Message, Context),
41
- holds(Context, Name, Args),
42
- length(Args, Arity).
43
-
44
- schema_violation(Message, Name, Arity) :-
45
- context_shape(Message, Name, Arity),
46
- not(allowed_shape(Name, Arity)).
@@ -1,72 +0,0 @@
1
- % Control Systems example, adapted from Eyelet's input/control-system.pl.
2
- %
3
- % The example combines measurements, observations, targets, logarithmic
4
- % feedforward compensation, square-root normalization, and nonlinear feedback.
5
-
6
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
7
- materialize(controlSignal, 2).
8
- materialize(status, 2).
9
- materialize(normalizedMeasurement, 2).
10
- materialize(log10, 2).
11
-
12
- % Program structure: facts set up the scenario, and rules derive the materialized conclusions.
13
- measurement(input1, [6, 11]).
14
- measurement(disturbance2, [45, 39]).
15
- measurement(input2, true).
16
- measurement(input3, 56967).
17
- measurement(disturbance1, 35766).
18
- measurement(output2, 24).
19
-
20
- observation(state1, 80).
21
- observation(state2, false).
22
- observation(state3, 22).
23
-
24
- target(output2, 29).
25
-
26
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
27
- measurement_normalized(I, M) :-
28
- measurement(I, [M1, M2]),
29
- lt(M1, M2),
30
- sub(M2, M1, Delta),
31
- pow(Delta, 0.5, M).
32
-
33
- measurement_normalized(I, M1) :-
34
- measurement(I, [M1, M2]),
35
- ge(M1, M2).
36
-
37
- log10(Value, Result) :-
38
- log(Value, NaturalLog),
39
- log(10, NaturalLog10),
40
- div(NaturalLog, NaturalLog10, Result).
41
-
42
- control(actuator1, C) :-
43
- measurement_normalized(input1, M1),
44
- measurement(input2, true),
45
- measurement(disturbance1, D1),
46
- mul(M1, 19.6, Proportional),
47
- log10(D1, Compensation),
48
- sub(Proportional, Compensation, C).
49
-
50
- control(actuator2, C) :-
51
- observation(state3, P3),
52
- measurement(output2, M4),
53
- target(output2, T2),
54
- sub(T2, M4, Error),
55
- sub(P3, M4, DifferentialError),
56
- mul(5.8, Error, Proportional),
57
- div(7.3, Error, NonlinearFactor),
58
- mul(NonlinearFactor, DifferentialError, Differential),
59
- add(Proportional, Differential, C).
60
-
61
- controlSignal(Actuator, C) :-
62
- control(Actuator, C).
63
-
64
- status(Actuator, active) :-
65
- control(Actuator, _C).
66
-
67
- normalizedMeasurement(input1, M) :-
68
- measurement_normalized(input1, M).
69
-
70
- log10(disturbance1, C) :-
71
- measurement(disturbance1, D),
72
- log10(D, C).
@@ -1,16 +0,0 @@
1
- % Cyclic transitive closure. The graph contains a directed cycle, but eyelang's
2
- % variant loop guard prevents recursive proof search from revisiting the same
3
- % active subgoal forever.
4
-
5
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
6
- materialize(path, 2).
7
-
8
- % Program structure: facts set up the scenario, and rules derive the materialized conclusions.
9
- arc(a, b).
10
- arc(b, c).
11
- arc(c, d).
12
- arc(d, a).
13
-
14
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
15
- path(X, Y) :- arc(X, Y).
16
- path(X, Z) :- arc(X, Y), path(Y, Z).
@@ -1,100 +0,0 @@
1
- % Eyelet-inspired D3 group example using findall/3 and sort/2.
2
- % It enumerates subgroups of the dihedral group of order 6.
3
-
4
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
5
- materialize(subgroups, 2).
6
- materialize(subgroupCount, 2).
7
- materialize(reason, 2).
8
-
9
- % Program structure: facts set up the scenario, and rules derive the materialized conclusions.
10
- % Six symmetries of an equilateral triangle: identity, rotations, reflections.
11
- symmetry(identity).
12
- symmetry(rotation_120).
13
- symmetry(rotation_240).
14
- symmetry(reflection_a).
15
- symmetry(reflection_b).
16
- symmetry(reflection_c).
17
-
18
- % Cayley table for D3 composition.
19
- compose(identity, identity, identity).
20
- compose(identity, rotation_120, rotation_120).
21
- compose(identity, rotation_240, rotation_240).
22
- compose(identity, reflection_a, reflection_a).
23
- compose(identity, reflection_b, reflection_b).
24
- compose(identity, reflection_c, reflection_c).
25
- compose(rotation_120, identity, rotation_120).
26
- compose(rotation_120, rotation_120, rotation_240).
27
- compose(rotation_120, rotation_240, identity).
28
- compose(rotation_120, reflection_a, reflection_b).
29
- compose(rotation_120, reflection_b, reflection_c).
30
- compose(rotation_120, reflection_c, reflection_a).
31
- compose(rotation_240, identity, rotation_240).
32
- compose(rotation_240, rotation_120, identity).
33
- compose(rotation_240, rotation_240, rotation_120).
34
- compose(rotation_240, reflection_a, reflection_c).
35
- compose(rotation_240, reflection_b, reflection_a).
36
- compose(rotation_240, reflection_c, reflection_b).
37
- compose(reflection_a, identity, reflection_a).
38
- compose(reflection_a, rotation_120, reflection_c).
39
- compose(reflection_a, rotation_240, reflection_b).
40
- compose(reflection_a, reflection_a, identity).
41
- compose(reflection_a, reflection_b, rotation_240).
42
- compose(reflection_a, reflection_c, rotation_120).
43
- compose(reflection_b, identity, reflection_b).
44
- compose(reflection_b, rotation_120, reflection_a).
45
- compose(reflection_b, rotation_240, reflection_c).
46
- compose(reflection_b, reflection_a, rotation_120).
47
- compose(reflection_b, reflection_b, identity).
48
- compose(reflection_b, reflection_c, rotation_240).
49
- compose(reflection_c, identity, reflection_c).
50
- compose(reflection_c, rotation_120, reflection_b).
51
- compose(reflection_c, rotation_240, reflection_a).
52
- compose(reflection_c, reflection_a, rotation_240).
53
- compose(reflection_c, reflection_b, rotation_120).
54
- compose(reflection_c, reflection_c, identity).
55
- % Each candidate subgroup must also contain inverses.
56
- inverse(identity, identity).
57
- inverse(rotation_120, rotation_240).
58
- inverse(rotation_240, rotation_120).
59
- inverse(reflection_a, reflection_a).
60
- inverse(reflection_b, reflection_b).
61
- inverse(reflection_c, reflection_c).
62
-
63
- % Candidate subsets are generated as subsequences of the sorted symmetry list.
64
- subsequence([], []).
65
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
66
- subsequence([Head | Tail], [Head | Rest]) :-
67
- subsequence(Tail, Rest).
68
- subsequence([_Head | Tail], Rest) :-
69
- subsequence(Tail, Rest).
70
-
71
- all_symmetries(Symmetries) :-
72
- findall(X, symmetry(X), Raw),
73
- sort(Raw, Symmetries).
74
-
75
- % A valid subgroup is closed under both composition and inverse.
76
- closed_under_composition(Group) :-
77
- not((member(X, Group), member(Y, Group), compose(X, Y, Z), not(member(Z, Group)))).
78
-
79
- closed_under_inverse(Group) :-
80
- not((member(X, Group), inverse(X, Y), not(member(Y, Group)))).
81
-
82
- valid_group(Group) :-
83
- all_symmetries(All),
84
- subsequence(All, Group),
85
- member(identity, Group),
86
- closed_under_composition(Group),
87
- closed_under_inverse(Group).
88
-
89
- all_subgroups(Groups) :-
90
- findall(G, valid_group(G), Raw),
91
- sort(Raw, Groups).
92
-
93
- subgroups(d3_group, Groups) :-
94
- all_subgroups(Groups).
95
-
96
- subgroupCount(d3_group, Count) :-
97
- all_subgroups(Groups),
98
- length(Groups, Count).
99
-
100
- reason(d3_group, "findall enumerates candidate subgroups and sort gives canonical subgroup order").
@@ -1,65 +0,0 @@
1
- % EYE-inspired dairy energy balance case study.
2
- % Cows are classified from maintenance, milk requirement, and ration supply.
3
-
4
- % cow(Cow, BodyWeightKg, MilkKgPerDay, RationEnergyMcalPerKgDM, IntakeKgDM).
5
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
6
- materialize(energyBalance_Mcal, 2).
7
- materialize(rationSupportedMilk_kg, 2).
8
- materialize(status, 2).
9
- materialize(reason, 2).
10
- materialize(strongestDeficit, 2).
11
-
12
- % Program structure: facts set up the scenario, and rules derive the materialized conclusions.
13
- cow(early_lactation, 650, 38, 6.4, 22).
14
- cow(mid_lactation, 610, 24, 6.5, 26).
15
- cow(late_lactation, 580, 16, 6.7, 25).
16
- cow(grazing, 540, 18, 5.8, 21).
17
-
18
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
19
- maintenance(C, M) :-
20
- cow(C, Weight, _, _, _),
21
- mul(Weight, 0.08, M).
22
-
23
- milk_requirement(C, R) :-
24
- cow(C, _, Milk, _, _),
25
- mul(Milk, 5.0, R).
26
-
27
- ration_supply(C, S) :-
28
- cow(C, _, _, Density, Intake),
29
- mul(Density, Intake, S).
30
-
31
- total_requirement(C, R) :-
32
- maintenance(C, M),
33
- milk_requirement(C, MilkR),
34
- add(M, MilkR, R).
35
-
36
- energy_balance(C, B) :-
37
- ration_supply(C, S),
38
- total_requirement(C, R),
39
- sub(S, R, B).
40
-
41
- ration_supported_milk(C, Milk) :-
42
- ration_supply(C, S),
43
- maintenance(C, M),
44
- sub(S, M, AvailableForMilk),
45
- div(AvailableForMilk, 5.0, Milk).
46
-
47
- status(C, negative_energy_balance) :-
48
- energy_balance(C, B),
49
- lt(B, -5.0).
50
-
51
- status(C, near_neutral_energy_balance) :-
52
- energy_balance(C, B),
53
- ge(B, -5.0),
54
- le(B, 5.0).
55
-
56
- status(C, positive_energy_balance) :-
57
- energy_balance(C, B),
58
- gt(B, 5.0).
59
-
60
- energyBalance_Mcal(C, B) :- energy_balance(C, B).
61
- rationSupportedMilk_kg(C, M) :- ration_supported_milk(C, M).
62
- reason(dairy_energy_balance, "ration supply minus maintenance and milk energy requirement determines the class").
63
- strongestDeficit(dairy_energy_balance, early_lactation) :-
64
- status(early_lactation, negative_energy_balance),
65
- status(late_lactation, positive_energy_balance).
@@ -1,39 +0,0 @@
1
- % Data negotiation with policies, adapted from Eyelet input/data-negotiation.pl.
2
- % The accepted negotiation matches Eyelet output-swipl/data-negotiation.pl.
3
-
4
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
5
- materialize(negotiate, 2).
6
-
7
- % Program structure: facts set up the scenario, and rules derive the materialized conclusions.
8
- % Each agent has local data, desired remote data, and a simple policy.
9
- hasData(agent1, [data1, data2, data3]).
10
- hasData(agent2, [data4, data5, data6]).
11
-
12
- want_negotiate(agent1, [agent2, data4]).
13
- want_negotiate(agent1, [agent2, data5]).
14
- want_negotiate(agent1, [agent2, data7]).
15
-
16
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
17
- policy(agent1, [request, Data]) :-
18
- member(Data, [data4, data6]).
19
- policy(agent2, [accept, Data]) :-
20
- neq(Data, data5).
21
-
22
- % A request is possible only if A lacks the data and A's policy allows asking for it.
23
- request_data(AgentA, AgentB, Data) :-
24
- hasData(AgentA, DataListA),
25
- hasData(AgentB, DataListB),
26
- member(Data, DataListB),
27
- not_member(Data, DataListA),
28
- policy(AgentA, [request, Data]).
29
-
30
- % B accepts only requests for data it has and its own policy permits sharing.
31
- accept_request(AgentB, _AgentA, Data) :-
32
- hasData(AgentB, DataListB),
33
- member(Data, DataListB),
34
- policy(AgentB, [accept, Data]).
35
-
36
- negotiate(AgentA, [AgentB, Data]) :-
37
- want_negotiate(AgentA, [AgentB, Data]),
38
- request_data(AgentA, AgentB, Data),
39
- accept_request(AgentB, AgentA, Data).
@@ -1,115 +0,0 @@
1
- % =============================================================================================================================
2
- % Deep Taxonomy - depth 10 - expanded N3-style eyelang with checkpoint proof accelerators
3
- %
4
- % Adjacent rules mirror the Eyeling N3 deep-taxonomy chain. The checkpoint
5
- % rules are redundant consequences of that chain and are placed first so eyelang
6
- % can prove terminal/report goals without overflowing the JavaScript call stack.
7
- % Report/check rules use once/1 so successful checks do not backtrack into a
8
- % long adjacent-only proof after a shorter checkpoint proof has succeeded.
9
- % =============================================================================================================================
10
-
11
- % Output declarations: materialize/2 selects the relations written to this example's golden output.
12
- materialize(is, 2).
13
- materialize(answer, 2).
14
- materialize(reason, 2).
15
- materialize(result, 2).
16
- materialize(checkPassed, 2).
17
- materialize(arc, 2).
18
-
19
- % Program structure: facts set up the scenario, and rules derive the materialized conclusions.
20
- % fact
21
-
22
- a(ind, n0).
23
-
24
- % terminal rule
25
-
26
- % Derivation rules: each rule below contributes one logical step toward the displayed results.
27
- is(test, true) :- once(a(ind, a2)).
28
- a(X, a2) :- a(X, n10).
29
-
30
- % Redundant checkpoint accelerators.
31
-
32
- a(X, n10) :- a(X, n0).
33
- a(X, n4) :- a(X, n0).
34
- a(X, n9) :- a(X, n0).
35
-
36
- % Adjacent N3-style taxonomy rules.
37
-
38
- a(X, n1) :- a(X, n0).
39
- a(X, i1) :- a(X, n0).
40
- a(X, j1) :- a(X, n0).
41
- a(X, n2) :- a(X, n1).
42
- a(X, i2) :- a(X, n1).
43
- a(X, j2) :- a(X, n1).
44
- a(X, n3) :- a(X, n2).
45
- a(X, i3) :- a(X, n2).
46
- a(X, j3) :- a(X, n2).
47
- a(X, n4) :- a(X, n3).
48
- a(X, i4) :- a(X, n3).
49
- a(X, j4) :- a(X, n3).
50
- a(X, n5) :- a(X, n4).
51
- a(X, i5) :- a(X, n4).
52
- a(X, j5) :- a(X, n4).
53
- a(X, n6) :- a(X, n5).
54
- a(X, i6) :- a(X, n5).
55
- a(X, j6) :- a(X, n5).
56
- a(X, n7) :- a(X, n6).
57
- a(X, i7) :- a(X, n6).
58
- a(X, j7) :- a(X, n6).
59
- a(X, n8) :- a(X, n7).
60
- a(X, i8) :- a(X, n7).
61
- a(X, j8) :- a(X, n7).
62
- a(X, n9) :- a(X, n8).
63
- a(X, i9) :- a(X, n8).
64
- a(X, j9) :- a(X, n8).
65
- a(X, n10) :- a(X, n9).
66
- a(X, i10) :- a(X, n9).
67
- a(X, j10) :- a(X, n9).
68
-
69
- % ARC checks
70
-
71
- arc(check1, "C1 OK - the starting classification n0 is present.") :-
72
- once(a(ind, n0)).
73
-
74
- arc(check2, "C2 OK - the first expansion produced n1 together with side labels i1 and j1.") :-
75
- once(a(ind, n1)),
76
- once(a(ind, i1)),
77
- once(a(ind, j1)).
78
-
79
- arc(check3, "C3 OK - the chain reaches the midpoint n5 and still carries both side-label branches.") :-
80
- once(a(ind, n5)),
81
- once(a(ind, i5)),
82
- once(a(ind, j5)).
83
-
84
- arc(check4, "C4 OK - the final taxonomy step from n9 to n10 was completed.") :-
85
- once(a(ind, n9)),
86
- once(a(ind, n10)).
87
-
88
- arc(check5, "C5 OK - once n10 is reached, the terminal class a2 is derived.") :-
89
- once(a(ind, n10)),
90
- once(a(ind, a2)).
91
-
92
- arc(check6, "C6 OK - the success flag is raised only after the terminal class a2 is present.") :-
93
- once(a(ind, a2)),
94
- once(is(test, true)).
95
-
96
- % ARC report
97
-
98
- answer(report, "The test succeeds: starting from one individual classified as n0, the rules eventually classify it as n10 and then as a2.") :-
99
- once(is(test, true)).
100
-
101
- reason(report, "The adjacent rules mirror the Eyeling N3 deep-taxonomy-10 chain. Redundant checkpoint rules are included only as proof accelerators: each shortcut is entailed by the adjacent chain, and once/1 prevents backtracking into the long adjacent-only proof after a check has succeeded.") :-
102
- once(a(ind, a2)),
103
- once(is(test, true)).
104
-
105
- checkPassed(report, Check) :-
106
- arc(Check, _Message).
107
-
108
- result(report, success) :-
109
- once(is(test, true)),
110
- once(arc(check1, _C1)),
111
- once(arc(check2, _C2)),
112
- once(arc(check3, _C3)),
113
- once(arc(check4, _C4)),
114
- once(arc(check5, _C5)),
115
- once(arc(check6, _C6)).