eyelang 0.5.0 → 0.5.2
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 +7 -7
- package/book-assets/cli-observation-loop.svg +1 -1
- package/book-assets/example-landscape.svg +1 -1
- package/book-assets/laboratory-progression.svg +1 -1
- package/book-assets/part-4-craft.svg +1 -1
- package/book-assets/rdf-adapter-pipeline.svg +3 -3
- package/book-assets/reference-navigation.svg +1 -1
- package/book-assets/review-lenses.svg +1 -1
- package/book-assets/title-page.svg +2 -2
- package/conformance-report.md +1 -1
- package/examples/book/README.md +4 -4
- package/examples/book/chapter-01/01-parent.pl +1 -1
- package/examples/book/chapter-01/02-child.pl +1 -1
- package/examples/book/chapter-02/01-measurement.pl +1 -1
- package/examples/book/chapter-02/02-label.pl +1 -1
- package/examples/book/chapter-03/01-eligible.pl +1 -1
- package/examples/book/chapter-03/02-adult.pl +1 -1
- package/examples/book/chapter-03/03-can_enter.pl +1 -1
- package/examples/book/chapter-03/04-high_score.pl +1 -1
- package/examples/book/chapter-03/05-parent.pl +1 -1
- package/examples/book/chapter-03/06-ancestor.pl +1 -1
- package/examples/book/chapter-03/07-different.pl +1 -1
- package/examples/book/chapter-03/08-has_parent.pl +1 -1
- package/examples/book/chapter-03/09-program.pl +1 -1
- package/examples/book/chapter-03/10-closed.pl +1 -1
- package/examples/book/chapter-03/11-p.pl +1 -1
- package/examples/book/chapter-04/01-path.pl +1 -1
- package/examples/book/chapter-05/01-first.pl +1 -1
- package/examples/book/chapter-05/02-reverse_acc.pl +1 -1
- package/examples/book/chapter-06/01-next.pl +1 -1
- package/examples/book/chapter-06/02-safe_reading.pl +1 -1
- package/examples/book/chapter-06/03-square.pl +1 -1
- package/examples/book/chapter-06/04-factorial.pl +1 -1
- package/examples/book/chapter-07/01-allowed.pl +1 -1
- package/examples/book/chapter-07/02-all_tests_pass.pl +1 -1
- package/examples/book/chapter-08/01-findall.pl +1 -1
- package/examples/book/chapter-08/02-outgoing_costs.pl +1 -1
- package/examples/book/chapter-08/03-best_route.pl +1 -1
- package/examples/book/chapter-09/01-functor.pl +1 -1
- package/examples/book/chapter-09/02-normalized.pl +1 -1
- package/examples/book/chapter-09/03-message.pl +1 -1
- package/examples/book/chapter-10/01-plan.pl +1 -1
- package/examples/book/chapter-11/01-why.pl +1 -1
- package/examples/book/chapter-12/01-invalid_probability.pl +1 -1
- package/examples/book/chapter-12/02-invalid_assignment.pl +1 -1
- package/examples/book/chapter-14/01-heating.pl +1 -1
- package/examples/book/chapter-15/01-rdf.pl +1 -1
- package/examples/book/chapter-16/01-socket.pl +1 -1
- package/examples/book/chapter-16/02-socket-2.pl +1 -1
- package/examples/book/chapter-17/01-path.pl +1 -1
- package/examples/book/chapter-17/02-adult.pl +1 -1
- package/examples/book/chapter-17/03-bad_member.pl +1 -1
- package/examples/book/chapter-17/04-item.pl +1 -1
- package/examples/book/chapter-18/01-routeable.pl +1 -1
- package/examples/book/chapter-18/02-routeable-2.pl +1 -1
- package/examples/book/chapter-18/03-prefix.pl +1 -1
- package/examples/book/chapter-18/04-candidate_pair.pl +1 -1
- package/examples/book/chapter-18/05-compatible_pair.pl +1 -1
- package/examples/book/chapter-19/01-factorial.pl +1 -1
- package/examples/book/chapter-19/02-invalid_limits.pl +1 -1
- package/examples/book/chapter-20/01-connected.pl +1 -1
- package/examples/book/chapter-20/02-within_thermal_limits.pl +1 -1
- package/examples/book/chapter-20/03-search.pl +1 -1
- package/examples/book/chapter-21/01-grandparent.pl +1 -1
- package/examples/book/chapter-21/02-loop_edge.pl +1 -1
- package/examples/book/chapter-21/03-eligible.pl +1 -1
- package/examples/book/chapter-21/04-grows.pl +1 -1
- package/examples/book/chapter-22/01-tree.pl +1 -1
- package/examples/book/chapter-22/02-tree_member.pl +1 -1
- package/examples/book/chapter-22/03-mirror.pl +1 -1
- package/examples/book/chapter-22/04-evaluate.pl +1 -1
- package/examples/book/chapter-22/05-lookup.pl +1 -1
- package/examples/book/chapter-22/06-simplify.pl +1 -1
- package/examples/book/chapter-23/01-adult.pl +1 -1
- package/examples/book/chapter-23/02-adult-2.pl +1 -1
- package/examples/book/chapter-23/03-can_board.pl +1 -1
- package/examples/book/chapter-23/04-traveler_in_good_standing.pl +1 -1
- package/examples/book/chapter-23/05-connection.pl +1 -1
- package/examples/book/chapter-23/06-rail_connection.pl +1 -1
- package/examples/book/chapter-23/07-sum_numbers.pl +1 -1
- package/examples/book/chapter-23/08-sum_numbers_acc.pl +1 -1
- package/examples/book/chapter-24/01-simple_path.pl +1 -1
- package/examples/book/chapter-24/02-reachable.pl +1 -1
- package/examples/book/chapter-24/03-best_plan.pl +1 -1
- package/examples/book/chapter-25/01-person.pl +1 -1
- package/examples/book/chapter-25/02-active_badge.pl +1 -1
- package/examples/book/chapter-25/03-in_good_standing.pl +1 -1
- package/examples/book/chapter-25/04-incompatible_status.pl +1 -1
- package/examples/book/chapter-26/01-mortal.pl +1 -1
- package/examples/book/chapter-26/02-triple.pl +1 -1
- package/examples/book/chapter-26/03-edge.pl +1 -1
- package/examples/book/chapter-27/01-natural.pl +1 -1
- package/examples/book/chapter-27/02-list_length.pl +1 -1
- package/examples/book/chapter-27/03-reverse_acc.pl +1 -1
- package/examples/book/chapter-28/01-program.pl +1 -1
- package/examples/book/chapter-28/02-triangle.pl +1 -1
- package/examples/book/chapter-28/03-rectangle.pl +1 -1
- package/examples/book/chapter-28/04-preserves_combine.pl +1 -1
- package/examples/book/chapter-29/01-noncommuting_pair.pl +1 -1
- package/examples/book/chapter-32/01-eligible.pl +1 -1
- package/examples/book/chapter-32/02-eligible-2.pl +1 -1
- package/examples/book/chapter-33/01-assigned_badge.pl +1 -1
- package/examples/book/chapter-33/02-source_role.pl +1 -1
- package/examples/book/chapter-33/03-chosen_pair.pl +1 -1
- package/examples/book/chapter-33/04-path.pl +1 -1
- package/examples/book/chapter-33/05-unregistered.pl +1 -1
- package/examples/book/chapter-33/06-step.pl +1 -1
- package/examples/book/chapter-33/07-depends.pl +1 -1
- package/examples/book/chapter-33/08-within_limit.pl +1 -1
- package/examples/book/chapter-33/09-invalid_badge_assignment.pl +1 -1
- package/examples/book/chapter-33/10-theory_version.pl +1 -1
- package/examples/book/chapter-34/01-travel_status.pl +1 -1
- package/examples/book/chapter-34/02-require_route.pl +1 -1
- package/examples/book/chapter-34/03-regional_total.pl +1 -1
- package/examples/book/chapter-35/01-term_shape.pl +1 -1
- package/examples/book/chapter-36/01-program.pl +1 -1
- package/examples/book/chapter-36/02-program-2.pl +1 -1
- package/examples/book/chapter-36/03-program-3.pl +1 -1
- package/examples/book/chapter-37/01-write_event.pl +1 -1
- package/examples/book/chapter-38/01-city.pl +1 -1
- package/examples/cdcl-sat-solver.pl +2 -2
- package/examples/collatz-1000.pl +1 -1
- package/examples/equality-saturation.pl +1 -1
- package/examples/existential-rule.pl +1 -1
- package/examples/herbrand-semantics.pl +1 -1
- package/examples/herbrand-witnesses.pl +1 -1
- package/examples/iso-integer-arithmetic.pl +1 -1
- package/examples/knowledge-engineering-alignment-flow.pl +1 -1
- package/examples/language.pl +2 -2
- package/examples/law-of-cosines.pl +1 -1
- package/examples/linear-logic-resources.pl +1 -1
- package/examples/markov-logic-network.pl +1 -1
- package/examples/matrix-noncommutativity.pl +1 -1
- package/examples/partial-evaluator.pl +1 -1
- package/examples/peano-calculus.pl +1 -1
- package/examples/prime-range.pl +1 -1
- package/examples/register-allocation.pl +1 -1
- package/examples/route-planning.pl +1 -1
- package/examples/sat-solver-dpll.pl +1 -1
- package/examples/symbolic-derivative.pl +1 -1
- package/examples/term-tools.pl +1 -1
- package/examples/trust-flow-provenance-threshold.pl +1 -1
- package/examples/vector-similarity.pl +1 -1
- package/examples/web-names.pl +1 -1
- package/examples/workplace-compliance.pl +1 -1
- package/eyelang-logo.png +0 -0
- package/index.d.ts +68 -68
- package/index.js +1 -1
- package/package.json +2 -2
- package/playground.html +10 -10
- package/src/cli.js +4 -4
- package/src/explain.js +4 -4
- package/src/index.js +4 -4
- package/src/iso.js +1 -1
- package/src/library.js +7 -7
- package/src/parser.js +1 -1
- package/src/playground-worker.js +2 -2
- package/src/solver.js +4 -4
- package/src/term.js +1 -1
- package/test/conformance/README.md +6 -6
- package/test/conformance/THIRD_PARTY.md +4 -4
- package/test/conformance/cases/iso/logtalk_abolish.pl +1 -1
- package/test/conformance/cases/iso/logtalk_arg_unification.pl +1 -1
- package/test/conformance/cases/iso/logtalk_assert_order.pl +1 -1
- package/test/conformance/cases/iso/logtalk_atom_chars.pl +1 -1
- package/test/conformance/cases/iso/logtalk_atom_codes.pl +1 -1
- package/test/conformance/cases/iso/logtalk_atom_concat.pl +1 -1
- package/test/conformance/cases/iso/logtalk_atom_length.pl +1 -1
- package/test/conformance/cases/iso/logtalk_bagof.pl +1 -1
- package/test/conformance/cases/iso/logtalk_char_code.pl +1 -1
- package/test/conformance/cases/iso/logtalk_clause.pl +1 -1
- package/test/conformance/cases/iso/logtalk_compare_standard_order.pl +1 -1
- package/test/conformance/cases/iso/logtalk_copy_term_semantics.pl +1 -1
- package/test/conformance/cases/iso/logtalk_current_predicate.pl +1 -1
- package/test/conformance/cases/iso/logtalk_current_streams.pl +1 -1
- package/test/conformance/cases/iso/logtalk_findall.pl +1 -1
- package/test/conformance/cases/iso/logtalk_number_chars.pl +1 -1
- package/test/conformance/cases/iso/logtalk_number_codes.pl +1 -1
- package/test/conformance/cases/iso/logtalk_occurs_check.pl +1 -1
- package/test/conformance/cases/iso/logtalk_once.pl +1 -1
- package/test/conformance/cases/iso/logtalk_operators.pl +1 -1
- package/test/conformance/cases/iso/logtalk_prolog_flags.pl +1 -1
- package/test/conformance/cases/iso/logtalk_repeat.pl +1 -1
- package/test/conformance/cases/iso/logtalk_retract.pl +1 -1
- package/test/conformance/cases/iso/logtalk_setof.pl +1 -1
- package/test/conformance/cases/iso/logtalk_sub_atom.pl +1 -1
- package/test/conformance/cases/iso/logtalk_term_comparison.pl +1 -1
- package/test/conformance/cases/iso/logtalk_term_variables.pl +1 -1
- package/test/conformance/cases/iso/logtalk_univ.pl +1 -1
- package/test/conformance/cases/strings/064_reusable_string_builtins.pl +3 -3
- package/test/conformance/cases/strings/071_string_edges.pl +1 -1
- package/test/conformance/errors/iso/logtalk_abolish_arity_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_abolish_bad_indicator.pl +1 -1
- package/test/conformance/errors/iso/logtalk_abolish_name_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_abolish_negative_arity.pl +1 -1
- package/test/conformance/errors/iso/logtalk_abolish_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_abolish_unbound_arity.pl +1 -1
- package/test/conformance/errors/iso/logtalk_arg_index_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_arg_number.pl +1 -1
- package/test/conformance/errors/iso/logtalk_asserta_bad_body.pl +1 -1
- package/test/conformance/errors/iso/logtalk_asserta_noncallable.pl +1 -1
- package/test/conformance/errors/iso/logtalk_assertz_noncallable.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_chars_atom_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_chars_character_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_chars_improper.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_chars_list_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_chars_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_codes_atom_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_codes_bad_code.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_codes_integer_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_codes_list_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_codes_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_concat_left_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_concat_right_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_concat_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_concat_whole_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_length_atom_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_length_integer_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_length_negative.pl +1 -1
- package/test/conformance/errors/iso/logtalk_atom_length_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_bagof_improper.pl +1 -1
- package/test/conformance/errors/iso/logtalk_bagof_nonlist.pl +1 -1
- package/test/conformance/errors/iso/logtalk_char_code_character_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_char_code_integer_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_char_code_negative.pl +1 -1
- package/test/conformance/errors/iso/logtalk_char_code_number_character.pl +1 -1
- package/test/conformance/errors/iso/logtalk_char_code_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_clause_noncallable_body.pl +1 -1
- package/test/conformance/errors/iso/logtalk_clause_noncallable_head.pl +1 -1
- package/test/conformance/errors/iso/logtalk_compare_order_domain.pl +1 -1
- package/test/conformance/errors/iso/logtalk_compare_order_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_flag_compound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_flag_name_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_flag_unknown.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_input_bad_stream.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_op_bad_specifier.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_op_high_priority.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_output_bad_stream.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_predicate_bad_name.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_predicate_negative_arity.pl +1 -1
- package/test/conformance/errors/iso/logtalk_current_predicate_scalar.pl +1 -1
- package/test/conformance/errors/iso/logtalk_findall_improper.pl +1 -1
- package/test/conformance/errors/iso/logtalk_findall_nonlist.pl +1 -1
- package/test/conformance/errors/iso/logtalk_functor_arity_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_functor_compound_name.pl +1 -1
- package/test/conformance/errors/iso/logtalk_functor_float_name.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_chars_character_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_chars_list_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_chars_number_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_chars_partial.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_chars_syntax.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_chars_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_codes_bad_code.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_codes_list_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_codes_number_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_codes_partial.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_codes_syntax.pl +1 -1
- package/test/conformance/errors/iso/logtalk_number_codes_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_once_noncallable.pl +1 -1
- package/test/conformance/errors/iso/logtalk_once_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_op_bad_specifier.pl +1 -1
- package/test/conformance/errors/iso/logtalk_op_high_priority.pl +1 -1
- package/test/conformance/errors/iso/logtalk_op_negative_priority.pl +1 -1
- package/test/conformance/errors/iso/logtalk_op_priority_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_op_unbound_name.pl +1 -1
- package/test/conformance/errors/iso/logtalk_op_unbound_priority.pl +1 -1
- package/test/conformance/errors/iso/logtalk_op_unbound_specifier.pl +1 -1
- package/test/conformance/errors/iso/logtalk_retract_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_retract_unbound_head.pl +1 -1
- package/test/conformance/errors/iso/logtalk_set_flag_name_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_set_flag_unbound_name.pl +1 -1
- package/test/conformance/errors/iso/logtalk_set_flag_unbound_value.pl +1 -1
- package/test/conformance/errors/iso/logtalk_set_flag_unknown.pl +1 -1
- package/test/conformance/errors/iso/logtalk_set_flag_value.pl +1 -1
- package/test/conformance/errors/iso/logtalk_setof_nonlist.pl +1 -1
- package/test/conformance/errors/iso/logtalk_sub_atom_before_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_sub_atom_negative.pl +1 -1
- package/test/conformance/errors/iso/logtalk_sub_atom_result_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_sub_atom_source_type.pl +1 -1
- package/test/conformance/errors/iso/logtalk_sub_atom_unbound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_term_variables_improper.pl +1 -1
- package/test/conformance/errors/iso/logtalk_term_variables_nonlist.pl +1 -1
- package/test/conformance/errors/iso/logtalk_univ_head_compound.pl +1 -1
- package/test/conformance/errors/iso/logtalk_univ_head_float.pl +1 -1
- package/test/conformance/errors/iso/logtalk_univ_head_integer.pl +1 -1
- package/test/conformance/errors/iso/logtalk_univ_single_compound.pl +1 -1
- package/test/conformance/expected/strings/064_reusable_string_builtins.pl +1 -1
- package/test/run-conformance-report.mjs +4 -4
- package/test/run-conformance.mjs +3 -3
- package/test/run-playground.mjs +3 -3
- package/test/run-rdf-tools.mjs +15 -15
- package/test/run-regression.mjs +35 -35
- package/the-art-of-eyelang.md +136 -136
- package/tools/README.md +2 -2
- package/tools/extract-book-examples.mjs +4 -4
- package/tools/pl-to-rdf.mjs +2 -2
- package/tools/rdf-codec.mjs +8 -8
- package/tools/rdf-to-pl.mjs +9 -9
- package/why-eyelang.md +47 -47
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 23 — Specializing a relation.
|
|
2
2
|
connection(Mode, From, To, Cost).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 24 — Existence, one witness, and all witnesses.
|
|
2
2
|
reachable(From, To).
|
|
3
3
|
once(simple_path(From, To, Path)).
|
|
4
4
|
findall(Path, simple_path(From, To, Path), Paths).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 26.
|
|
2
2
|
mortal(X) :- human(X).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 26 — Proof objects and proof checking.
|
|
2
2
|
triple(3, 4, 5).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 28 — Unification is structural equation solving.
|
|
2
2
|
(pair(X, f(Y)) = pair(g(a), f(b))).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 28 — Relations reveal inverse problems.
|
|
2
2
|
rectangle(W, H, Area) :- (Area is W * H).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 33 — Pattern 1: Ground sentence first.
|
|
2
2
|
assigned_badge(alex, badge_17).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 33 — Pattern 6: Explicit state transition.
|
|
2
2
|
step(state(Room, outside), enter(Room), state(Room, inside)).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 33 — Pattern 9: Integrity before inference.
|
|
2
2
|
invalid_badge_assignment(Badge, PersonA, PersonB) :-
|
|
3
3
|
assigned_badge(PersonA, Badge),
|
|
4
4
|
assigned_badge(PersonB, Badge),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
% From The Art of
|
|
1
|
+
% From The Art of Eyelang, Chapter 36.
|
|
2
2
|
:- initialization(prepare_queue).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% A tiny CDCL-style SAT trace with one learned clause.
|
|
2
2
|
%
|
|
3
3
|
% Industrial CDCL solvers use watched literals, mutable trails, non-chronological
|
|
4
|
-
% backjumping, clause databases, restarts, and activity heuristics.
|
|
4
|
+
% backjumping, clause databases, restarts, and activity heuristics. Eyelang has
|
|
5
5
|
% no mutable state or destructive trail updates, so this example models one small
|
|
6
6
|
% conflict-analysis episode as relations over immutable terms.
|
|
7
7
|
%
|
|
@@ -31,7 +31,7 @@ lit_true(neg(Var), Value_rel) :- call_value(Value_rel, Var, false, _).
|
|
|
31
31
|
lit_false(pos(Var), Value_rel) :- call_value(Value_rel, Var, false, _).
|
|
32
32
|
lit_false(neg(Var), Value_rel) :- call_value(Value_rel, Var, true, _).
|
|
33
33
|
|
|
34
|
-
%
|
|
34
|
+
% Eyelang cannot pass predicates as first-class values, so this small dispatcher
|
|
35
35
|
% lets the same literal helpers inspect either the initial or final trail.
|
|
36
36
|
call_value(initial, Var, Value, Reason) :- initial_value(Var, Value, Reason).
|
|
37
37
|
call_value(final, Var, Value, Reason) :- final_value(Var, Value, Reason).
|
package/examples/collatz-1000.pl
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
% Program structure: facts set up the scenario, and rules derive the queried conclusions.
|
|
15
|
-
% The N3 source defines repeat/2 recursively; this
|
|
15
|
+
% The N3 source defines repeat/2 recursively; this Eyelang version uses the
|
|
16
16
|
% equivalent bounded generator so the 1000-case regression remains stack-safe.
|
|
17
17
|
|
|
18
18
|
% Query / query execution of the test suite.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Bounded equality saturation over tiny arithmetic expression terms.
|
|
2
2
|
%
|
|
3
3
|
% Real equality-saturation engines use mutable e-graphs, union-find classes,
|
|
4
|
-
% congruence closure, rewrite scheduling, and cost-based extraction.
|
|
4
|
+
% congruence closure, rewrite scheduling, and cost-based extraction. Eyelang has
|
|
5
5
|
% none of those primitives, so this example simulates the idea relationally: it
|
|
6
6
|
% enumerates expressions reachable within a small rewrite-fuel bound, scores the
|
|
7
7
|
% generated terms, and extracts the cheapest equivalent expression.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% Existential-style introduction with explicit Herbrand witnesses.
|
|
2
2
|
%
|
|
3
|
-
%
|
|
3
|
+
% Eyelang has no blank nodes and no existential variables in rule heads. A
|
|
4
4
|
% rule can still express the practical executable shape of an existential
|
|
5
5
|
% consequence by putting a named functional term directly in the head.
|
|
6
6
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
% Under unrestricted Tarskian semantics, alice and bob could denote the same
|
|
10
|
-
% element. In
|
|
10
|
+
% element. In Eyelang's Herbrand universe, their different syntax is enough.
|
|
11
11
|
different(alice, bob) :-
|
|
12
12
|
(alice \= bob).
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% Existential-style consequences as explicit Herbrand witness terms.
|
|
2
2
|
%
|
|
3
|
-
%
|
|
3
|
+
% Eyelang has no blank nodes and no existential variables in rule heads. The
|
|
4
4
|
% practical executable form is to put a named functional term directly in the
|
|
5
5
|
% rule head. The term is ordinary data: stable, visible, and proof-friendly.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% ISO integer division, remainders, shifts, and bit operations.
|
|
2
2
|
%
|
|
3
|
-
% In
|
|
3
|
+
% In Eyelang's supported profile, div and // both truncate the quotient toward
|
|
4
4
|
% zero. mod normalizes by a positive divisor while rem keeps the dividend sign.
|
|
5
5
|
%% goal: report(X0, X1)
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
% Knowledge-engineering alignment flow in
|
|
1
|
+
% Knowledge-engineering alignment flow in Eyelang.
|
|
2
2
|
%
|
|
3
3
|
% The source graph uses local observation predicates. The mapping facts below
|
|
4
4
|
% align those local names with small SOSA-like and FPV-like vocabulary atoms, then
|
package/examples/language.pl
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
%
|
|
1
|
+
% Eyelang language-identity example.
|
|
2
2
|
%
|
|
3
|
-
% This file intentionally uses the modern
|
|
3
|
+
% This file intentionally uses the modern Eyelang surface syntax:
|
|
4
4
|
% - `.pl` source files instead of Prolog `.pl` files
|
|
5
5
|
% - ISO Prolog-style uppercase variables
|
|
6
6
|
% - automatic tabling for recursive predicates
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Law of cosines: c^2 = a^2 + b^2 - 2ab cos(C).
|
|
2
2
|
%
|
|
3
3
|
% This pure-geometry example keeps trigonometry outside the language by storing
|
|
4
|
-
% cos(C) as data.
|
|
4
|
+
% cos(C) as data. Eyelang then performs the algebraic part of the theorem with
|
|
5
5
|
% ordinary arithmetic predicates and querys both c^2 and c.
|
|
6
6
|
%
|
|
7
7
|
% The 60-degree sample uses cos(C) = 0.5, so the proof shows each intermediate
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% Linear logic emulation with explicit consumable resources.
|
|
2
2
|
%
|
|
3
|
-
%
|
|
3
|
+
% Eyelang predicates are reusable Horn clauses, so this example represents the
|
|
4
4
|
% linear part explicitly as a multiset-like state list. A rule consumes its
|
|
5
5
|
% input resources with select/3 and produces a new state. If a resource is not
|
|
6
6
|
% present, the step fails, which models the “use exactly once” discipline of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% Markov Logic Network style scoring over a tiny finite domain.
|
|
2
2
|
%
|
|
3
|
-
%
|
|
3
|
+
% Eyelang is deterministic, so this is not a probabilistic MLN engine. The
|
|
4
4
|
% example encodes the usual MLN MAP idea explicitly: enumerate possible worlds,
|
|
5
5
|
% mark which weighted soft formulas each world satisfies, sum the weights, and
|
|
6
6
|
% choose the highest-scoring world. Weights are stored as integer tenths of a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Matrix multiplication and non-commutativity.
|
|
2
2
|
%
|
|
3
3
|
% The original matrix example contains a larger matrix library. This compact
|
|
4
|
-
%
|
|
4
|
+
% Eyelang case keeps the core operation visible: multiply two 2x2 matrices and
|
|
5
5
|
% show that, in general, A*B is not the same matrix as B*A.
|
|
6
6
|
|
|
7
7
|
%% goal: matrix_result(X0, X1)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% A tiny partial evaluator for expression terms.
|
|
2
2
|
%
|
|
3
3
|
% Real partial evaluation can specialize interpreters, control unfolding, avoid
|
|
4
|
-
% code explosion, and even approach self-application. This bounded
|
|
4
|
+
% code explosion, and even approach self-application. This bounded Eyelang
|
|
5
5
|
% version specializes a miniature expression language with known static inputs:
|
|
6
6
|
% constants are folded, known variables are substituted, and dynamic variables
|
|
7
7
|
% remain as residual code.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Peano addition, multiplication, and factorial over explicit Herbrand terms.
|
|
2
2
|
%
|
|
3
3
|
% The original logic-programming example uses `0` and `s(...)`. Here zero is
|
|
4
|
-
% the atom `z`, so every natural number is an ordinary
|
|
4
|
+
% the atom `z`, so every natural number is an ordinary Eyelang term: z, s(z),
|
|
5
5
|
% s(s(z)), and so on. The rules are relational; the query answers choose
|
|
6
6
|
% a few finite calculations as readable examples.
|
|
7
7
|
|
package/examples/prime-range.pl
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Prime ranges and Euler totient over finite integer domains.
|
|
2
2
|
%
|
|
3
3
|
% The source example combines prime search with Euler's totient function. This
|
|
4
|
-
%
|
|
4
|
+
% Eyelang version keeps the computation finite and declarative: composite
|
|
5
5
|
% numbers are described by proper divisors, primes are candidates that are not
|
|
6
6
|
% composite, and `totient/2` counts numbers coprime with the input.
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Register allocation as bounded graph coloring with spilling.
|
|
2
2
|
%
|
|
3
3
|
% Production allocators combine liveness analysis, interference graphs, register
|
|
4
|
-
% classes, coalescing, requery execution, and spill-code insertion. This
|
|
4
|
+
% classes, coalescing, requery execution, and spill-code insertion. This Eyelang
|
|
5
5
|
% example reduces the problem to its logical core: enumerate assignments of a
|
|
6
6
|
% few temporaries to two registers or memory, reject register conflicts, and use
|
|
7
7
|
% aggregate_min/5 to choose the cheapest spill plan.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% Route planning with explicit route terms.
|
|
2
2
|
%
|
|
3
|
-
% This is the
|
|
3
|
+
% This is the Eyelang version of the classic Paris-to-Nantes path example: the
|
|
4
4
|
% facts describe one-way road links, and `path/2` derives both the endpoint pair
|
|
5
5
|
% and a structured `go(..., ..., ...)` plan. The plan is ordinary data, so the
|
|
6
6
|
% route can be inspected, stored, or used by later rules.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% DPLL-style SAT solving for a small CNF formula.
|
|
2
2
|
%
|
|
3
|
-
% The example keeps the solver itself in
|
|
3
|
+
% The example keeps the solver itself in Eyelang. It recursively assigns
|
|
4
4
|
% variables in a fixed order, prunes a branch as soon as any clause is already
|
|
5
5
|
% impossible, and accepts a complete assignment when every clause is satisfied.
|
|
6
6
|
% aggregate_min/5 is then used only to choose one canonical satisfying model.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% Symbolic differentiation over explicit expression terms.
|
|
2
2
|
%
|
|
3
3
|
% The source derivative example uses Prolog operators such as `+`, `*`, `^`, and
|
|
4
|
-
% cut.
|
|
4
|
+
% cut. Eyelang keeps expressions as ordinary terms: `add/2`, `mul/2`, `pow/2`,
|
|
5
5
|
% `log/1`, and so on. The result is intentionally unsimplified so the rule that
|
|
6
6
|
% produced each part remains visible.
|
|
7
7
|
|
package/examples/term-tools.pl
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
% structured terms.
|
|
3
3
|
%
|
|
4
4
|
% Each report/2 answer demonstrates one meta-programming operation over ordinary
|
|
5
|
-
%
|
|
5
|
+
% Eyelang terms: functor/3 and arg/3 inspect shape, =../2 can decompose or rebuild
|
|
6
6
|
% a compound, term_string/2 renders a term, and forall/2 validates all edge
|
|
7
7
|
% weights.
|
|
8
8
|
%
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
% Provenance-derived trust-flow thresholding in
|
|
1
|
+
% Provenance-derived trust-flow thresholding in Eyelang.
|
|
2
2
|
%
|
|
3
3
|
% Each message combines publisher trust, signature strength, and transform quality
|
|
4
4
|
% into one confidence score. Receiver-specific thresholds then classify messages
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
% public cosineSimilarity/2 report then combines those folds as
|
|
5
5
|
% dot(A,B)/(norm(A)*norm(B)) for a named vector pair.
|
|
6
6
|
%
|
|
7
|
-
% The example keeps vectors as ordinary
|
|
7
|
+
% The example keeps vectors as ordinary Eyelang lists, so it doubles as a compact
|
|
8
8
|
% demonstration of numeric recursion over list structure.
|
|
9
9
|
|
|
10
10
|
%% goal: dotProduct(X0, X1)
|
package/examples/web-names.pl
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
% Workplace compliance from explicit action facts.
|
|
2
2
|
%
|
|
3
|
-
% The source example generated a large dynamic dataset.
|
|
3
|
+
% The source example generated a large dynamic dataset. Eyelang keeps the data
|
|
4
4
|
% explicit and reproducible: each `does/2` fact records an observed employee
|
|
5
5
|
% action, and the rules classify compliant and non-compliant behaviour.
|
|
6
6
|
|
package/eyelang-logo.png
CHANGED
|
Binary file
|