eyeling 1.34.4 → 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.
- package/README.md +3 -90
- package/bin/eyeling.cjs +4 -56
- package/dist/browser/eyeling.browser.js +0 -1
- package/examples/context-schema-audit.n3 +1 -1
- package/eyeling.js +0 -1
- package/index.d.ts +3 -37
- package/index.js +1 -90
- package/lib/cli.js +0 -1
- package/package.json +3 -12
- package/test/eyelang/conformance/README.md +9 -11
- package/test/eyelang/conformance/cases/001_fact_output.pl +4 -0
- package/test/eyelang/conformance/cases/002_rule_recursion.pl +7 -0
- package/test/eyelang/conformance/cases/002_rule_recursion.query +1 -0
- package/test/eyelang/conformance/cases/003_terms_and_readback.pl +16 -0
- package/test/eyelang/conformance/cases/003_terms_and_readback.query +1 -0
- package/test/eyelang/conformance/cases/004_conjunction_and_parentheses.pl +5 -0
- package/test/eyelang/conformance/cases/004_conjunction_and_parentheses.query +1 -0
- package/test/eyelang/conformance/cases/005_list_deconstruction.pl +6 -0
- package/test/eyelang/conformance/cases/005_list_deconstruction.query +1 -0
- package/test/eyelang/conformance/cases/006_comma_formula_data.pl +4 -0
- package/test/eyelang/conformance/cases/006_comma_formula_data.query +1 -0
- package/test/eyelang/conformance/cases/007_anonymous_variables.pl +5 -0
- package/test/eyelang/conformance/cases/007_anonymous_variables.query +1 -0
- package/test/eyelang/conformance/cases/008_graphic_atoms.pl +6 -0
- package/test/eyelang/conformance/cases/008_graphic_atoms.query +1 -0
- package/test/eyelang/conformance/cases/009_comments_and_whitespace.pl +5 -0
- package/test/eyelang/conformance/cases/009_comments_and_whitespace.query +1 -0
- package/test/eyelang/conformance/cases/010_variable_scope_and_reuse.pl +8 -0
- package/test/eyelang/conformance/cases/010_variable_scope_and_reuse.query +1 -0
- package/test/eyelang/conformance/cases/011_predicate_arity.pl +6 -0
- package/test/eyelang/conformance/cases/011_predicate_arity.query +1 -0
- package/test/eyelang/conformance/cases/012_nested_compound_unification.pl +5 -0
- package/test/eyelang/conformance/cases/012_nested_compound_unification.query +1 -0
- package/test/eyelang/conformance/cases/013_multiple_clauses_order.pl +6 -0
- package/test/eyelang/conformance/cases/013_multiple_clauses_order.query +1 -0
- package/test/eyelang/conformance/cases/014_failure_filters_answers.pl +7 -0
- package/test/eyelang/conformance/cases/014_failure_filters_answers.query +1 -0
- package/test/eyelang/conformance/cases/015_improper_list_unification.pl +6 -0
- package/test/eyelang/conformance/cases/015_improper_list_unification.query +1 -0
- package/test/eyelang/conformance/cases/016_zero_arity_compound.pl +4 -0
- package/test/eyelang/conformance/cases/016_zero_arity_compound.query +1 -0
- package/test/eyelang/conformance/cases/017_three_step_recursion.pl +8 -0
- package/test/eyelang/conformance/cases/017_three_step_recursion.query +1 -0
- package/test/eyelang/conformance/cases/018_quoted_atom_readback.pl +6 -0
- package/test/eyelang/conformance/cases/018_quoted_atom_readback.query +1 -0
- package/test/eyelang/conformance/cases/019_parenthesized_three_conjuncts.pl +7 -0
- package/test/eyelang/conformance/cases/019_parenthesized_three_conjuncts.query +1 -0
- package/test/eyelang/conformance/cases/020_nested_list_terms.pl +5 -0
- package/test/eyelang/conformance/cases/020_nested_list_terms.query +1 -0
- package/test/eyelang/conformance/cases/021_repeated_variable_head.pl +7 -0
- package/test/eyelang/conformance/cases/022_rule_head_structure.pl +5 -0
- package/test/eyelang/conformance/cases/023_quoted_escapes_readback.pl +5 -0
- package/test/eyelang/conformance/cases/024_numeric_literal_readback.pl +6 -0
- package/test/eyelang/conformance/cases/025_body_parentheses_with_formula_data.pl +5 -0
- package/test/eyelang/conformance/cases/026_underscore_named_variable_reuse.pl +5 -0
- package/test/eyelang/conformance/cases/027_default_derived_output.pl +5 -0
- package/test/eyelang/conformance/cases/028_materialize_focus.pl +5 -0
- package/test/eyelang/conformance/cases/029_arithmetic_and_comparison.pl +11 -0
- package/test/eyelang/conformance/cases/029_arithmetic_and_comparison.query +1 -0
- package/test/eyelang/conformance/cases/030_strings_and_atoms.pl +4 -0
- package/test/eyelang/conformance/cases/030_strings_and_atoms.query +1 -0
- package/test/eyelang/conformance/cases/031_lists_aggregation_ordering.pl +10 -0
- package/test/eyelang/conformance/cases/031_lists_aggregation_ordering.query +1 -0
- package/test/eyelang/conformance/cases/032_holds_parts.pl +4 -0
- package/test/eyelang/conformance/cases/033_negation_once_generators.pl +7 -0
- package/test/eyelang/conformance/cases/033_negation_once_generators.query +1 -0
- package/test/eyelang/conformance/cases/034_equality_and_inequality.pl +6 -0
- package/test/eyelang/conformance/cases/034_equality_and_inequality.query +1 -0
- package/test/eyelang/conformance/cases/035_list_relations.pl +5 -0
- package/test/eyelang/conformance/cases/035_list_relations.query +1 -0
- package/test/eyelang/conformance/cases/036_append_splits.pl +3 -0
- package/test/eyelang/conformance/cases/036_append_splits.query +1 -0
- package/test/eyelang/conformance/cases/037_matching_and_comparison.pl +7 -0
- package/test/eyelang/conformance/cases/037_matching_and_comparison.query +1 -0
- package/test/eyelang/conformance/cases/038_memoize_declaration.pl +8 -0
- package/test/eyelang/conformance/cases/038_memoize_declaration.query +1 -0
- package/test/eyelang/conformance/cases/039_numeric_functions.pl +9 -0
- package/test/eyelang/conformance/cases/039_numeric_functions.query +1 -0
- package/test/eyelang/conformance/cases/040_between_enumeration.pl +3 -0
- package/test/eyelang/conformance/cases/040_between_enumeration.query +1 -0
- package/test/eyelang/conformance/cases/041_smallest_divisor.pl +3 -0
- package/test/eyelang/conformance/cases/041_smallest_divisor.query +1 -0
- package/test/eyelang/conformance/cases/042_negation_filter.pl +7 -0
- package/test/eyelang/conformance/cases/042_negation_filter.query +1 -0
- package/test/eyelang/conformance/cases/043_once_user_predicate.pl +5 -0
- package/test/eyelang/conformance/cases/043_once_user_predicate.query +1 -0
- package/test/eyelang/conformance/cases/044_findall_user_goal.pl +6 -0
- package/test/eyelang/conformance/cases/044_findall_user_goal.query +1 -0
- package/test/eyelang/conformance/cases/045_sort_deduplicates_atoms.pl +3 -0
- package/test/eyelang/conformance/cases/045_sort_deduplicates_atoms.query +1 -0
- package/test/eyelang/conformance/cases/046_append_bound_prefix_suffix.pl +4 -0
- package/test/eyelang/conformance/cases/046_append_bound_prefix_suffix.query +1 -0
- package/test/eyelang/conformance/cases/047_nth0_index_generation.pl +3 -0
- package/test/eyelang/conformance/cases/047_nth0_index_generation.query +1 -0
- package/test/eyelang/conformance/cases/048_set_nth0_edges.pl +4 -0
- package/test/eyelang/conformance/cases/048_set_nth0_edges.query +1 -0
- package/test/eyelang/conformance/cases/049_select_duplicate_occurrences.pl +3 -0
- package/test/eyelang/conformance/cases/049_select_duplicate_occurrences.query +1 -0
- package/test/eyelang/conformance/cases/050_not_member_filter.pl +6 -0
- package/test/eyelang/conformance/cases/050_not_member_filter.query +1 -0
- package/test/eyelang/conformance/cases/051_nested_holds_parts.pl +4 -0
- package/test/eyelang/conformance/cases/052_holds_member.pl +3 -0
- package/test/eyelang/conformance/cases/053_materialize_excludes_source_fact.pl +6 -0
- package/test/eyelang/conformance/cases/054_numeric_and_lexical_comparison.pl +5 -0
- package/test/eyelang/conformance/cases/054_numeric_and_lexical_comparison.query +1 -0
- package/test/eyelang/conformance/cases/055_string_matching_filters.pl +6 -0
- package/test/eyelang/conformance/cases/055_string_matching_filters.query +1 -0
- package/test/eyelang/conformance/cases/056_string_and_atom_concat.pl +3 -0
- package/test/eyelang/conformance/cases/056_string_and_atom_concat.query +1 -0
- package/test/eyelang/conformance/cases/057_countall_empty_and_nonempty.pl +4 -0
- package/test/eyelang/conformance/cases/057_countall_empty_and_nonempty.query +1 -0
- package/test/eyelang/conformance/cases/058_sumall_numeric_template.pl +5 -0
- package/test/eyelang/conformance/cases/058_sumall_numeric_template.query +1 -0
- package/test/eyelang/conformance/cases/059_aggregate_min_template.pl +5 -0
- package/test/eyelang/conformance/cases/059_aggregate_min_template.query +1 -0
- package/test/eyelang/conformance/cases/060_aggregate_max_compound_key.pl +5 -0
- package/test/eyelang/conformance/cases/060_aggregate_max_compound_key.query +1 -0
- package/test/eyelang/conformance/cases/061_date_difference.pl +4 -0
- package/test/eyelang/conformance/cases/062_reusable_numeric_builtins.pl +10 -0
- package/test/eyelang/conformance/cases/063_reusable_list_builtins.pl +11 -0
- package/test/eyelang/conformance/cases/064_reusable_string_builtins.pl +12 -0
- package/test/eyelang/conformance/cases/065_reusable_term_control_builtins.pl +11 -0
- package/test/eyelang/conformance/cases/066_numeric_edges.pl +14 -0
- package/test/eyelang/conformance/cases/067_list_edges.pl +10 -0
- package/test/eyelang/conformance/cases/068_list_generation_order.pl +7 -0
- package/test/eyelang/conformance/cases/069_list_summaries_and_sets.pl +9 -0
- package/test/eyelang/conformance/cases/070_matches_named_captures.pl +13 -0
- package/test/eyelang/conformance/cases/071_string_edges.pl +10 -0
- package/test/eyelang/conformance/cases/072_string_conversions.pl +10 -0
- package/test/eyelang/conformance/cases/073_term_introspection_edges.pl +10 -0
- package/test/eyelang/conformance/cases/074_forall_edges.pl +10 -0
- package/test/eyelang/conformance/cases/075_aggregation_edges.pl +12 -0
- package/test/eyelang/conformance/cases/076_composed_reusable_builtins.pl +8 -0
- package/test/eyelang/conformance/cases/077_recursive_path_with_lists.pl +10 -0
- package/test/eyelang/conformance/cases/078_mutual_recursion_with_arithmetic.pl +7 -0
- package/test/eyelang/conformance/cases/079_big_integer_arithmetic.pl +8 -0
- package/test/eyelang/conformance/cases/080_rounding_modes.pl +10 -0
- package/test/eyelang/conformance/cases/081_zero_safe_numeric_functions.pl +9 -0
- package/test/eyelang/conformance/cases/082_comparison_semantics.pl +10 -0
- package/test/eyelang/conformance/cases/083_between_modes_and_empty_ranges.pl +8 -0
- package/test/eyelang/conformance/cases/084_append_and_select_composition.pl +7 -0
- package/test/eyelang/conformance/cases/085_nth_and_update_edges.pl +8 -0
- package/test/eyelang/conformance/cases/086_slicing_pipeline.pl +10 -0
- package/test/eyelang/conformance/cases/087_sort_reverse_length.pl +8 -0
- package/test/eyelang/conformance/cases/088_list_summaries_failures.pl +8 -0
- package/test/eyelang/conformance/cases/089_string_split_join_pipeline.pl +7 -0
- package/test/eyelang/conformance/cases/090_string_substring_replace_edges.pl +9 -0
- package/test/eyelang/conformance/cases/091_string_case_and_trim.pl +7 -0
- package/test/eyelang/conformance/cases/092_scalar_string_conversions.pl +9 -0
- package/test/eyelang/conformance/cases/093_regex_named_captures_context.pl +8 -0
- package/test/eyelang/conformance/cases/094_context_holds_enumeration.pl +7 -0
- package/test/eyelang/conformance/cases/095_term_introspection_roundtrip.pl +8 -0
- package/test/eyelang/conformance/cases/096_functor_scalar_edges.pl +8 -0
- package/test/eyelang/conformance/cases/097_control_negation_once_forall.pl +13 -0
- package/test/eyelang/conformance/cases/098_aggregation_nested_templates.pl +11 -0
- package/test/eyelang/conformance/cases/099_materialize_multiple_arities.pl +8 -0
- package/test/eyelang/conformance/cases/100_reusable_builtin_workflow.pl +10 -0
- package/test/eyelang/conformance/expected/001_fact_output.pl +1 -0
- package/test/eyelang/conformance/expected/002_rule_recursion.pl +2 -0
- package/test/eyelang/conformance/expected/003_terms_and_readback.pl +13 -0
- package/test/eyelang/conformance/expected/004_conjunction_and_parentheses.pl +1 -0
- package/test/eyelang/conformance/expected/005_list_deconstruction.pl +2 -0
- package/test/eyelang/conformance/expected/006_comma_formula_data.pl +1 -0
- package/test/eyelang/conformance/expected/007_anonymous_variables.pl +1 -0
- package/test/eyelang/conformance/expected/008_graphic_atoms.pl +3 -0
- package/test/eyelang/conformance/expected/009_comments_and_whitespace.pl +2 -0
- package/test/eyelang/conformance/expected/010_variable_scope_and_reuse.pl +2 -0
- package/test/eyelang/conformance/expected/011_predicate_arity.pl +2 -0
- package/test/eyelang/conformance/expected/012_nested_compound_unification.pl +2 -0
- package/test/eyelang/conformance/expected/013_multiple_clauses_order.pl +2 -0
- package/test/eyelang/conformance/expected/014_failure_filters_answers.pl +1 -0
- package/test/eyelang/conformance/expected/015_improper_list_unification.pl +3 -0
- package/test/eyelang/conformance/expected/016_zero_arity_compound.pl +1 -0
- package/test/eyelang/conformance/expected/017_three_step_recursion.pl +3 -0
- package/test/eyelang/conformance/expected/018_quoted_atom_readback.pl +3 -0
- package/test/eyelang/conformance/expected/019_parenthesized_three_conjuncts.pl +1 -0
- package/test/eyelang/conformance/expected/020_nested_list_terms.pl +2 -0
- package/test/eyelang/conformance/expected/021_repeated_variable_head.pl +2 -0
- package/test/eyelang/conformance/expected/022_rule_head_structure.pl +2 -0
- package/test/eyelang/conformance/expected/023_quoted_escapes_readback.pl +2 -0
- package/test/eyelang/conformance/expected/024_numeric_literal_readback.pl +3 -0
- package/test/eyelang/conformance/expected/025_body_parentheses_with_formula_data.pl +1 -0
- package/test/eyelang/conformance/expected/026_underscore_named_variable_reuse.pl +1 -0
- package/test/eyelang/conformance/expected/028_materialize_focus.pl +1 -0
- package/test/eyelang/conformance/expected/029_arithmetic_and_comparison.pl +9 -0
- package/test/eyelang/conformance/expected/030_strings_and_atoms.pl +2 -0
- package/test/eyelang/conformance/expected/031_lists_aggregation_ordering.pl +9 -0
- package/test/eyelang/conformance/expected/032_holds_parts.pl +3 -0
- package/test/eyelang/conformance/expected/033_negation_once_generators.pl +2 -0
- package/test/eyelang/conformance/expected/034_equality_and_inequality.pl +4 -0
- package/test/eyelang/conformance/expected/035_list_relations.pl +4 -0
- package/test/eyelang/conformance/expected/036_append_splits.pl +3 -0
- package/test/eyelang/conformance/expected/037_matching_and_comparison.pl +5 -0
- package/test/eyelang/conformance/expected/038_memoize_declaration.pl +2 -0
- package/test/eyelang/conformance/expected/039_numeric_functions.pl +7 -0
- package/test/eyelang/conformance/expected/040_between_enumeration.pl +3 -0
- package/test/eyelang/conformance/expected/041_smallest_divisor.pl +1 -0
- package/test/eyelang/conformance/expected/042_negation_filter.pl +2 -0
- package/test/eyelang/conformance/expected/043_once_user_predicate.pl +1 -0
- package/test/eyelang/conformance/expected/044_findall_user_goal.pl +1 -0
- package/test/eyelang/conformance/expected/045_sort_deduplicates_atoms.pl +1 -0
- package/test/eyelang/conformance/expected/046_append_bound_prefix_suffix.pl +2 -0
- package/test/eyelang/conformance/expected/047_nth0_index_generation.pl +1 -0
- package/test/eyelang/conformance/expected/048_set_nth0_edges.pl +2 -0
- package/test/eyelang/conformance/expected/049_select_duplicate_occurrences.pl +2 -0
- package/test/eyelang/conformance/expected/050_not_member_filter.pl +1 -0
- package/test/eyelang/conformance/expected/051_nested_holds_parts.pl +3 -0
- package/test/eyelang/conformance/expected/052_holds_member.pl +2 -0
- package/test/eyelang/conformance/expected/053_materialize_excludes_source_fact.pl +1 -0
- package/test/eyelang/conformance/expected/054_numeric_and_lexical_comparison.pl +3 -0
- package/test/eyelang/conformance/expected/055_string_matching_filters.pl +2 -0
- package/test/eyelang/conformance/expected/056_string_and_atom_concat.pl +1 -0
- package/test/eyelang/conformance/expected/057_countall_empty_and_nonempty.pl +1 -0
- package/test/eyelang/conformance/expected/058_sumall_numeric_template.pl +1 -0
- package/test/eyelang/conformance/expected/059_aggregate_min_template.pl +1 -0
- package/test/eyelang/conformance/expected/060_aggregate_max_compound_key.pl +1 -0
- package/test/eyelang/conformance/expected/061_date_difference.pl +2 -0
- package/test/eyelang/conformance/expected/062_reusable_numeric_builtins.pl +8 -0
- package/test/eyelang/conformance/expected/063_reusable_list_builtins.pl +9 -0
- package/test/eyelang/conformance/expected/064_reusable_string_builtins.pl +10 -0
- package/test/eyelang/conformance/expected/065_reusable_term_control_builtins.pl +6 -0
- package/test/eyelang/conformance/expected/066_numeric_edges.pl +12 -0
- package/test/eyelang/conformance/expected/067_list_edges.pl +8 -0
- package/test/eyelang/conformance/expected/068_list_generation_order.pl +10 -0
- package/test/eyelang/conformance/expected/069_list_summaries_and_sets.pl +7 -0
- package/test/eyelang/conformance/expected/070_matches_named_captures.pl +1 -0
- package/test/eyelang/conformance/expected/071_string_edges.pl +8 -0
- package/test/eyelang/conformance/expected/072_string_conversions.pl +8 -0
- package/test/eyelang/conformance/expected/073_term_introspection_edges.pl +8 -0
- package/test/eyelang/conformance/expected/074_forall_edges.pl +5 -0
- package/test/eyelang/conformance/expected/075_aggregation_edges.pl +7 -0
- package/test/eyelang/conformance/expected/076_composed_reusable_builtins.pl +5 -0
- package/test/eyelang/conformance/expected/077_recursive_path_with_lists.pl +3 -0
- package/test/eyelang/conformance/expected/078_mutual_recursion_with_arithmetic.pl +7 -0
- package/test/eyelang/conformance/expected/079_big_integer_arithmetic.pl +6 -0
- package/test/eyelang/conformance/expected/080_rounding_modes.pl +8 -0
- package/test/eyelang/conformance/expected/081_zero_safe_numeric_functions.pl +7 -0
- package/test/eyelang/conformance/expected/082_comparison_semantics.pl +8 -0
- package/test/eyelang/conformance/expected/083_between_modes_and_empty_ranges.pl +8 -0
- package/test/eyelang/conformance/expected/084_append_and_select_composition.pl +10 -0
- package/test/eyelang/conformance/expected/085_nth_and_update_edges.pl +8 -0
- package/test/eyelang/conformance/expected/086_slicing_pipeline.pl +7 -0
- package/test/eyelang/conformance/expected/087_sort_reverse_length.pl +6 -0
- package/test/eyelang/conformance/expected/088_list_summaries_failures.pl +6 -0
- package/test/eyelang/conformance/expected/089_string_split_join_pipeline.pl +4 -0
- package/test/eyelang/conformance/expected/090_string_substring_replace_edges.pl +7 -0
- package/test/eyelang/conformance/expected/091_string_case_and_trim.pl +5 -0
- package/test/eyelang/conformance/expected/092_scalar_string_conversions.pl +7 -0
- package/test/eyelang/conformance/expected/093_regex_named_captures_context.pl +5 -0
- package/test/eyelang/conformance/expected/094_context_holds_enumeration.pl +8 -0
- package/test/eyelang/conformance/expected/095_term_introspection_roundtrip.pl +6 -0
- package/test/eyelang/conformance/expected/096_functor_scalar_edges.pl +6 -0
- package/test/eyelang/conformance/expected/097_control_negation_once_forall.pl +5 -0
- package/test/eyelang/conformance/expected/098_aggregation_nested_templates.pl +5 -0
- package/test/eyelang/conformance/expected/099_materialize_multiple_arities.pl +4 -0
- package/test/eyelang/conformance/expected/100_reusable_builtin_workflow.pl +6 -0
- package/test/eyelang/run-conformance.mjs +20 -22
- package/test/packlist.test.js +0 -2
- package/test/run.js +0 -2
- package/docs/eyelang-guide.md +0 -535
- package/docs/eyelang-language-reference.md +0 -712
- package/examples/eyelang/access-control-policy.pl +0 -52
- package/examples/eyelang/ackermann.pl +0 -46
- package/examples/eyelang/age.pl +0 -28
- package/examples/eyelang/aliases-and-namespaces.pl +0 -22
- package/examples/eyelang/alignment-demo.pl +0 -44
- package/examples/eyelang/allen-interval-calculus.pl +0 -64
- package/examples/eyelang/ancestor.pl +0 -21
- package/examples/eyelang/animal.pl +0 -21
- package/examples/eyelang/annotation.pl +0 -34
- package/examples/eyelang/auroracare.pl +0 -309
- package/examples/eyelang/backward.pl +0 -12
- package/examples/eyelang/basic-monadic.pl +0 -10032
- package/examples/eyelang/bayes-diagnosis.pl +0 -108
- package/examples/eyelang/bayes-therapy.pl +0 -182
- package/examples/eyelang/beam-deflection.pl +0 -50
- package/examples/eyelang/blocks-world-planning.pl +0 -75
- package/examples/eyelang/bmi.pl +0 -232
- package/examples/eyelang/braking-safety-worlds.pl +0 -69
- package/examples/eyelang/buck-converter-design.pl +0 -78
- package/examples/eyelang/cache-performance.pl +0 -54
- package/examples/eyelang/canary-release.pl +0 -49
- package/examples/eyelang/cat-koko.pl +0 -24
- package/examples/eyelang/clinical-trial-screening.pl +0 -92
- package/examples/eyelang/combinatorics-findall-sort.pl +0 -37
- package/examples/eyelang/competitive-enzyme-kinetics.pl +0 -78
- package/examples/eyelang/complex.pl +0 -121
- package/examples/eyelang/composition-of-injective-functions-is-injective.pl +0 -50
- package/examples/eyelang/context-association.pl +0 -53
- package/examples/eyelang/context-schema-audit.pl +0 -46
- package/examples/eyelang/control-system.pl +0 -72
- package/examples/eyelang/cyclic-path.pl +0 -16
- package/examples/eyelang/d3-group.pl +0 -100
- package/examples/eyelang/dairy-energy-balance.pl +0 -65
- package/examples/eyelang/data-negotiation.pl +0 -39
- package/examples/eyelang/deep-taxonomy-10.pl +0 -115
- package/examples/eyelang/deep-taxonomy-100.pl +0 -385
- package/examples/eyelang/deep-taxonomy-1000.pl +0 -3085
- package/examples/eyelang/deep-taxonomy-10000.pl +0 -30094
- package/examples/eyelang/deep-taxonomy-100000.pl +0 -300184
- package/examples/eyelang/delfour.pl +0 -281
- package/examples/eyelang/deontic-logic.pl +0 -52
- package/examples/eyelang/derived-backward-rule.pl +0 -30
- package/examples/eyelang/derived-rule.pl +0 -27
- package/examples/eyelang/diamond-property.pl +0 -38
- package/examples/eyelang/dijkstra-findall-sort.pl +0 -44
- package/examples/eyelang/dijkstra-risk-path.pl +0 -86
- package/examples/eyelang/dijkstra.pl +0 -46
- package/examples/eyelang/dining-philosophers.pl +0 -140
- package/examples/eyelang/dog.pl +0 -25
- package/examples/eyelang/dpv-odrl-purpose-mapping.pl +0 -46
- package/examples/eyelang/drone-corridor-planner.pl +0 -51
- package/examples/eyelang/easter-computus.pl +0 -89
- package/examples/eyelang/electrical-rc-filter.pl +0 -36
- package/examples/eyelang/epidemic-policy.pl +0 -67
- package/examples/eyelang/equivalence-classes-overlap-implies-same-class.pl +0 -27
- package/examples/eyelang/eulerian-path.pl +0 -85
- package/examples/eyelang/ev-range-worlds.pl +0 -82
- package/examples/eyelang/existential-rule.pl +0 -18
- package/examples/eyelang/exoplanet-validation-worlds.pl +0 -88
- package/examples/eyelang/expression-eval.pl +0 -43
- package/examples/eyelang/family-cousins.pl +0 -65
- package/examples/eyelang/fastpow.pl +0 -53
- package/examples/eyelang/fft8-numeric.pl +0 -83
- package/examples/eyelang/fibonacci.pl +0 -53
- package/examples/eyelang/field-nitrogen-balance.pl +0 -70
- package/examples/eyelang/flandor.pl +0 -296
- package/examples/eyelang/floating-point.pl +0 -23
- package/examples/eyelang/four-color-map.pl +0 -127
- package/examples/eyelang/fundamental-theorem-arithmetic.pl +0 -113
- package/examples/eyelang/gd-step-certified.pl +0 -158
- package/examples/eyelang/gdpr-compliance.pl +0 -69
- package/examples/eyelang/good-cobbler.pl +0 -14
- package/examples/eyelang/gps.pl +0 -152
- package/examples/eyelang/graph-reachability.pl +0 -36
- package/examples/eyelang/gray-code-counter.pl +0 -48
- package/examples/eyelang/greatest-lower-bound-uniqueness.pl +0 -28
- package/examples/eyelang/group-inverse-uniqueness.pl +0 -34
- package/examples/eyelang/hamiltonian-path.pl +0 -49
- package/examples/eyelang/hamming-code.pl +0 -105
- package/examples/eyelang/hanoi.pl +0 -20
- package/examples/eyelang/heat-loss.pl +0 -51
- package/examples/eyelang/heron-theorem.pl +0 -36
- package/examples/eyelang/ideal-gas-law.pl +0 -37
- package/examples/eyelang/illegitimate-reasoning.pl +0 -88
- package/examples/eyelang/knowledge-engineering-alignment-flow.pl +0 -40
- package/examples/eyelang/law-of-cosines.pl +0 -31
- package/examples/eyelang/least-squares-regression.pl +0 -81
- package/examples/eyelang/list-collection.pl +0 -33
- package/examples/eyelang/lldm.pl +0 -78
- package/examples/eyelang/manufacturing-quality-control.pl +0 -73
- package/examples/eyelang/microgrid-dispatch.pl +0 -85
- package/examples/eyelang/monkey-bananas.pl +0 -45
- package/examples/eyelang/network-sla.pl +0 -48
- package/examples/eyelang/newton-raphson.pl +0 -49
- package/examples/eyelang/nixon-diamond.pl +0 -37
- package/examples/eyelang/observability-log-correlation.pl +0 -34
- package/examples/eyelang/odrl-dpv-fpv-trust-flow.pl +0 -43
- package/examples/eyelang/odrl-dpv-healthcare-risk-ranked.pl +0 -266
- package/examples/eyelang/odrl-dpv-risk-ranked.pl +0 -320
- package/examples/eyelang/orbital-transfer-design.pl +0 -113
- package/examples/eyelang/output/access-control-policy.pl +0 -2
- package/examples/eyelang/output/ackermann.pl +0 -12
- package/examples/eyelang/output/age.pl +0 -2
- package/examples/eyelang/output/aliases-and-namespaces.pl +0 -5
- package/examples/eyelang/output/alignment-demo.pl +0 -32
- package/examples/eyelang/output/allen-interval-calculus.pl +0 -154
- package/examples/eyelang/output/ancestor.pl +0 -6
- package/examples/eyelang/output/animal.pl +0 -4
- package/examples/eyelang/output/annotation.pl +0 -4
- package/examples/eyelang/output/auroracare.pl +0 -117
- package/examples/eyelang/output/backward.pl +0 -1
- package/examples/eyelang/output/basic-monadic.pl +0 -1518
- package/examples/eyelang/output/bayes-diagnosis.pl +0 -13
- package/examples/eyelang/output/bayes-therapy.pl +0 -23
- package/examples/eyelang/output/beam-deflection.pl +0 -5
- package/examples/eyelang/output/blocks-world-planning.pl +0 -4
- package/examples/eyelang/output/bmi.pl +0 -32
- package/examples/eyelang/output/braking-safety-worlds.pl +0 -18
- package/examples/eyelang/output/buck-converter-design.pl +0 -6
- package/examples/eyelang/output/cache-performance.pl +0 -4
- package/examples/eyelang/output/canary-release.pl +0 -5
- package/examples/eyelang/output/cat-koko.pl +0 -3
- package/examples/eyelang/output/clinical-trial-screening.pl +0 -9
- package/examples/eyelang/output/combinatorics-findall-sort.pl +0 -2
- package/examples/eyelang/output/competitive-enzyme-kinetics.pl +0 -6
- package/examples/eyelang/output/complex.pl +0 -1
- package/examples/eyelang/output/composition-of-injective-functions-is-injective.pl +0 -2
- package/examples/eyelang/output/context-association.pl +0 -3
- package/examples/eyelang/output/context-schema-audit.pl +0 -12
- package/examples/eyelang/output/control-system.pl +0 -6
- package/examples/eyelang/output/cyclic-path.pl +0 -16
- package/examples/eyelang/output/d3-group.pl +0 -2
- package/examples/eyelang/output/dairy-energy-balance.pl +0 -13
- package/examples/eyelang/output/data-negotiation.pl +0 -1
- package/examples/eyelang/output/deep-taxonomy-10.pl +0 -16
- package/examples/eyelang/output/deep-taxonomy-100.pl +0 -16
- package/examples/eyelang/output/deep-taxonomy-1000.pl +0 -16
- package/examples/eyelang/output/deep-taxonomy-10000.pl +0 -16
- package/examples/eyelang/output/deep-taxonomy-100000.pl +0 -16
- package/examples/eyelang/output/delfour.pl +0 -31
- package/examples/eyelang/output/deontic-logic.pl +0 -4
- package/examples/eyelang/output/derived-backward-rule.pl +0 -3
- package/examples/eyelang/output/derived-rule.pl +0 -2
- package/examples/eyelang/output/diamond-property.pl +0 -4
- package/examples/eyelang/output/dijkstra-findall-sort.pl +0 -2
- package/examples/eyelang/output/dijkstra-risk-path.pl +0 -29
- package/examples/eyelang/output/dijkstra.pl +0 -16
- package/examples/eyelang/output/dining-philosophers.pl +0 -350
- package/examples/eyelang/output/dog.pl +0 -1
- package/examples/eyelang/output/dpv-odrl-purpose-mapping.pl +0 -18
- package/examples/eyelang/output/drone-corridor-planner.pl +0 -17
- package/examples/eyelang/output/easter-computus.pl +0 -30
- package/examples/eyelang/output/electrical-rc-filter.pl +0 -3
- package/examples/eyelang/output/epidemic-policy.pl +0 -14
- package/examples/eyelang/output/equivalence-classes-overlap-implies-same-class.pl +0 -18
- package/examples/eyelang/output/eulerian-path.pl +0 -3
- package/examples/eyelang/output/ev-range-worlds.pl +0 -19
- package/examples/eyelang/output/existential-rule.pl +0 -2
- package/examples/eyelang/output/exoplanet-validation-worlds.pl +0 -22
- package/examples/eyelang/output/expression-eval.pl +0 -1
- package/examples/eyelang/output/family-cousins.pl +0 -28
- package/examples/eyelang/output/fastpow.pl +0 -6
- package/examples/eyelang/output/fft8-numeric.pl +0 -4
- package/examples/eyelang/output/fibonacci.pl +0 -6
- package/examples/eyelang/output/field-nitrogen-balance.pl +0 -21
- package/examples/eyelang/output/flandor.pl +0 -43
- package/examples/eyelang/output/floating-point.pl +0 -9
- package/examples/eyelang/output/four-color-map.pl +0 -3
- package/examples/eyelang/output/fundamental-theorem-arithmetic.pl +0 -9
- package/examples/eyelang/output/gd-step-certified.pl +0 -79
- package/examples/eyelang/output/gdpr-compliance.pl +0 -6
- package/examples/eyelang/output/good-cobbler.pl +0 -1
- package/examples/eyelang/output/gps.pl +0 -21
- package/examples/eyelang/output/graph-reachability.pl +0 -3
- package/examples/eyelang/output/gray-code-counter.pl +0 -1
- package/examples/eyelang/output/greatest-lower-bound-uniqueness.pl +0 -2
- package/examples/eyelang/output/group-inverse-uniqueness.pl +0 -2
- package/examples/eyelang/output/hamiltonian-path.pl +0 -121
- package/examples/eyelang/output/hamming-code.pl +0 -6
- package/examples/eyelang/output/hanoi.pl +0 -1
- package/examples/eyelang/output/heat-loss.pl +0 -5
- package/examples/eyelang/output/heron-theorem.pl +0 -4
- package/examples/eyelang/output/ideal-gas-law.pl +0 -3
- package/examples/eyelang/output/illegitimate-reasoning.pl +0 -15
- package/examples/eyelang/output/knowledge-engineering-alignment-flow.pl +0 -17
- package/examples/eyelang/output/law-of-cosines.pl +0 -3
- package/examples/eyelang/output/least-squares-regression.pl +0 -5
- package/examples/eyelang/output/list-collection.pl +0 -3
- package/examples/eyelang/output/lldm.pl +0 -6
- package/examples/eyelang/output/manufacturing-quality-control.pl +0 -6
- package/examples/eyelang/output/microgrid-dispatch.pl +0 -6
- package/examples/eyelang/output/monkey-bananas.pl +0 -5
- package/examples/eyelang/output/network-sla.pl +0 -4
- package/examples/eyelang/output/newton-raphson.pl +0 -3
- package/examples/eyelang/output/nixon-diamond.pl +0 -5
- package/examples/eyelang/output/observability-log-correlation.pl +0 -28
- package/examples/eyelang/output/odrl-dpv-fpv-trust-flow.pl +0 -9
- package/examples/eyelang/output/odrl-dpv-healthcare-risk-ranked.pl +0 -42
- package/examples/eyelang/output/odrl-dpv-risk-ranked.pl +0 -120
- package/examples/eyelang/output/orbital-transfer-design.pl +0 -7
- package/examples/eyelang/output/path-discovery.pl +0 -3
- package/examples/eyelang/output/peano-arithmetic.pl +0 -3
- package/examples/eyelang/output/peasant.pl +0 -10
- package/examples/eyelang/output/pendulum-period.pl +0 -4
- package/examples/eyelang/output/polynomial.pl +0 -14
- package/examples/eyelang/output/proof-contrapositive.pl +0 -3
- package/examples/eyelang/output/quadratic-formula.pl +0 -6
- package/examples/eyelang/output/radioactive-decay.pl +0 -5
- package/examples/eyelang/output/reusable-builtins.pl +0 -5
- package/examples/eyelang/output/riemann-hypothesis.pl +0 -12
- package/examples/eyelang/output/security-incident-correlation.pl +0 -3
- package/examples/eyelang/output/service-impact.pl +0 -11
- package/examples/eyelang/output/sieve.pl +0 -1
- package/examples/eyelang/output/skolem-functions.pl +0 -16
- package/examples/eyelang/output/socket-age.pl +0 -1
- package/examples/eyelang/output/socrates.pl +0 -2
- package/examples/eyelang/output/statistics-summary.pl +0 -4
- package/examples/eyelang/output/superdense-coding.pl +0 -6
- package/examples/eyelang/output/term-tools.pl +0 -6
- package/examples/eyelang/output/trust-flow-provenance-threshold.pl +0 -6
- package/examples/eyelang/output/turing.pl +0 -12
- package/examples/eyelang/output/vector-similarity.pl +0 -4
- package/examples/eyelang/output/vulnerability-impact.pl +0 -20
- package/examples/eyelang/output/witch.pl +0 -7
- package/examples/eyelang/output/wolf-goat-cabbage.pl +0 -3
- package/examples/eyelang/output/zebra.pl +0 -3
- package/examples/eyelang/path-discovery.pl +0 -45013
- package/examples/eyelang/peano-arithmetic.pl +0 -31
- package/examples/eyelang/peasant.pl +0 -30
- package/examples/eyelang/pendulum-period.pl +0 -50
- package/examples/eyelang/polynomial.pl +0 -124
- package/examples/eyelang/proof/age.pl +0 -71
- package/examples/eyelang/proof/aliases-and-namespaces.pl +0 -78
- package/examples/eyelang/proof/ancestor.pl +0 -140
- package/examples/eyelang/proof/animal.pl +0 -68
- package/examples/eyelang/proof/annotation.pl +0 -80
- package/examples/eyelang/proof/backward.pl +0 -22
- package/examples/eyelang/proof/cat-koko.pl +0 -86
- package/examples/eyelang/proof/data-negotiation.pl +0 -76
- package/examples/eyelang/proof/derived-rule.pl +0 -43
- package/examples/eyelang/proof/dog.pl +0 -31
- package/examples/eyelang/proof/electrical-rc-filter.pl +0 -105
- package/examples/eyelang/proof/existential-rule.pl +0 -40
- package/examples/eyelang/proof/floating-point.pl +0 -160
- package/examples/eyelang/proof/good-cobbler.pl +0 -16
- package/examples/eyelang/proof/group-inverse-uniqueness.pl +0 -84
- package/examples/eyelang/proof/list-collection.pl +0 -52
- package/examples/eyelang/proof/proof-contrapositive.pl +0 -78
- package/examples/eyelang/proof/socket-age.pl +0 -32
- package/examples/eyelang/proof/socket-family.pl +0 -59
- package/examples/eyelang/proof/socrates.pl +0 -38
- package/examples/eyelang/proof-contrapositive.pl +0 -27
- package/examples/eyelang/quadratic-formula.pl +0 -54
- package/examples/eyelang/radioactive-decay.pl +0 -56
- package/examples/eyelang/reusable-builtins.pl +0 -32
- package/examples/eyelang/riemann-hypothesis.pl +0 -110
- package/examples/eyelang/security-incident-correlation.pl +0 -69
- package/examples/eyelang/service-impact.pl +0 -41
- package/examples/eyelang/sieve.pl +0 -20
- package/examples/eyelang/skolem-functions.pl +0 -52
- package/examples/eyelang/socket-age.pl +0 -39
- package/examples/eyelang/socket-family.pl +0 -28
- package/examples/eyelang/socrates.pl +0 -19
- package/examples/eyelang/statistics-summary.pl +0 -54
- package/examples/eyelang/superdense-coding.pl +0 -84
- package/examples/eyelang/term-tools.pl +0 -23
- package/examples/eyelang/trust-flow-provenance-threshold.pl +0 -40
- package/examples/eyelang/turing.pl +0 -67
- package/examples/eyelang/vector-similarity.pl +0 -56
- package/examples/eyelang/vulnerability-impact.pl +0 -70
- package/examples/eyelang/witch.pl +0 -38
- package/examples/eyelang/wolf-goat-cabbage.pl +0 -56
- package/examples/eyelang/zebra.pl +0 -44
- package/eyelang.d.ts +0 -80
- package/lib/eyelang/bin.js +0 -7
- package/lib/eyelang/builtins/aggregation.js +0 -81
- package/lib/eyelang/builtins/arithmetic.js +0 -208
- package/lib/eyelang/builtins/context.js +0 -42
- package/lib/eyelang/builtins/control.js +0 -34
- package/lib/eyelang/builtins/core.js +0 -78
- package/lib/eyelang/builtins/lists.js +0 -283
- package/lib/eyelang/builtins/registry.js +0 -48
- package/lib/eyelang/builtins/strings.js +0 -234
- package/lib/eyelang/builtins/terms.js +0 -66
- package/lib/eyelang/cli.js +0 -180
- package/lib/eyelang/explain.js +0 -324
- package/lib/eyelang/hash.js +0 -294
- package/lib/eyelang/index.js +0 -47
- package/lib/eyelang/package.json +0 -3
- package/lib/eyelang/parser.js +0 -428
- package/lib/eyelang/program.js +0 -237
- package/lib/eyelang/solver.js +0 -237
- package/lib/eyelang/term.js +0 -328
- /package/{examples/eyelang/output/socket-family.pl → test/eyelang/conformance/expected/027_default_derived_output.pl} +0 -0
package/lib/eyelang/hash.js
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
// Small dependency-free hashing helpers shared by Node and browser builds.
|
|
2
|
-
// They intentionally avoid node:crypto so src/index.js remains importable by
|
|
3
|
-
// browser builds that register hashing builtins.
|
|
4
|
-
|
|
5
|
-
const textEncoder = new TextEncoder();
|
|
6
|
-
|
|
7
|
-
export function hashHex(algorithm, text) {
|
|
8
|
-
const name = String(algorithm).toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
9
|
-
const bytes = textEncoder.encode(String(text));
|
|
10
|
-
if (name === 'md5') return md5Hex(bytes);
|
|
11
|
-
if (name === 'sha' || name === 'sha1') return sha1Hex(bytes);
|
|
12
|
-
if (name === 'sha256') return sha256Hex(bytes);
|
|
13
|
-
if (name === 'sha512') return sha512Hex(bytes);
|
|
14
|
-
throw new Error(`Unsupported hash algorithm: ${algorithm}`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function hex32(x) {
|
|
18
|
-
return (x >>> 0).toString(16).padStart(8, '0');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function rotr32(x, n) {
|
|
22
|
-
return (x >>> n) | (x << (32 - n));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function rotl32(x, n) {
|
|
26
|
-
return (x << n) | (x >>> (32 - n));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function bytesToHex(bytes) {
|
|
30
|
-
let out = '';
|
|
31
|
-
for (const b of bytes) out += b.toString(16).padStart(2, '0');
|
|
32
|
-
return out;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function paddedBytes(bytes, blockBytes, lengthBytes, littleLength = false) {
|
|
36
|
-
const bitLength = BigInt(bytes.length) * 8n;
|
|
37
|
-
const withOne = bytes.length + 1;
|
|
38
|
-
const zeroCount = (blockBytes - ((withOne + lengthBytes) % blockBytes)) % blockBytes;
|
|
39
|
-
const out = new Uint8Array(withOne + zeroCount + lengthBytes);
|
|
40
|
-
out.set(bytes, 0);
|
|
41
|
-
out[bytes.length] = 0x80;
|
|
42
|
-
for (let i = 0; i < lengthBytes; i++) {
|
|
43
|
-
const shift = BigInt(littleLength ? i * 8 : (lengthBytes - 1 - i) * 8);
|
|
44
|
-
out[out.length - lengthBytes + i] = Number((bitLength >> shift) & 0xffn);
|
|
45
|
-
}
|
|
46
|
-
return out;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function sha1Hex(bytes) {
|
|
50
|
-
const msg = paddedBytes(bytes, 64, 8);
|
|
51
|
-
let h0 = 0x67452301;
|
|
52
|
-
let h1 = 0xefcdab89;
|
|
53
|
-
let h2 = 0x98badcfe;
|
|
54
|
-
let h3 = 0x10325476;
|
|
55
|
-
let h4 = 0xc3d2e1f0;
|
|
56
|
-
const w = new Array(80);
|
|
57
|
-
|
|
58
|
-
for (let offset = 0; offset < msg.length; offset += 64) {
|
|
59
|
-
for (let i = 0; i < 16; i++) {
|
|
60
|
-
const j = offset + i * 4;
|
|
61
|
-
w[i] = ((msg[j] << 24) | (msg[j + 1] << 16) | (msg[j + 2] << 8) | msg[j + 3]) >>> 0;
|
|
62
|
-
}
|
|
63
|
-
for (let i = 16; i < 80; i++) w[i] = rotl32(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16], 1) >>> 0;
|
|
64
|
-
|
|
65
|
-
let a = h0, b = h1, c = h2, d = h3, e = h4;
|
|
66
|
-
for (let i = 0; i < 80; i++) {
|
|
67
|
-
let f, k;
|
|
68
|
-
if (i < 20) { f = (b & c) | (~b & d); k = 0x5a827999; }
|
|
69
|
-
else if (i < 40) { f = b ^ c ^ d; k = 0x6ed9eba1; }
|
|
70
|
-
else if (i < 60) { f = (b & c) | (b & d) | (c & d); k = 0x8f1bbcdc; }
|
|
71
|
-
else { f = b ^ c ^ d; k = 0xca62c1d6; }
|
|
72
|
-
const temp = (rotl32(a, 5) + f + e + k + w[i]) >>> 0;
|
|
73
|
-
e = d;
|
|
74
|
-
d = c;
|
|
75
|
-
c = rotl32(b, 30) >>> 0;
|
|
76
|
-
b = a;
|
|
77
|
-
a = temp;
|
|
78
|
-
}
|
|
79
|
-
h0 = (h0 + a) >>> 0;
|
|
80
|
-
h1 = (h1 + b) >>> 0;
|
|
81
|
-
h2 = (h2 + c) >>> 0;
|
|
82
|
-
h3 = (h3 + d) >>> 0;
|
|
83
|
-
h4 = (h4 + e) >>> 0;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return [h0, h1, h2, h3, h4].map(hex32).join('');
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const SHA256_K = [
|
|
90
|
-
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
|
91
|
-
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
|
92
|
-
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
93
|
-
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
|
94
|
-
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
|
95
|
-
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
96
|
-
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
|
97
|
-
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
|
98
|
-
];
|
|
99
|
-
|
|
100
|
-
function sha256Hex(bytes) {
|
|
101
|
-
const msg = paddedBytes(bytes, 64, 8);
|
|
102
|
-
let h0 = 0x6a09e667;
|
|
103
|
-
let h1 = 0xbb67ae85;
|
|
104
|
-
let h2 = 0x3c6ef372;
|
|
105
|
-
let h3 = 0xa54ff53a;
|
|
106
|
-
let h4 = 0x510e527f;
|
|
107
|
-
let h5 = 0x9b05688c;
|
|
108
|
-
let h6 = 0x1f83d9ab;
|
|
109
|
-
let h7 = 0x5be0cd19;
|
|
110
|
-
const w = new Array(64);
|
|
111
|
-
|
|
112
|
-
for (let offset = 0; offset < msg.length; offset += 64) {
|
|
113
|
-
for (let i = 0; i < 16; i++) {
|
|
114
|
-
const j = offset + i * 4;
|
|
115
|
-
w[i] = ((msg[j] << 24) | (msg[j + 1] << 16) | (msg[j + 2] << 8) | msg[j + 3]) >>> 0;
|
|
116
|
-
}
|
|
117
|
-
for (let i = 16; i < 64; i++) {
|
|
118
|
-
const s0 = (rotr32(w[i - 15], 7) ^ rotr32(w[i - 15], 18) ^ (w[i - 15] >>> 3)) >>> 0;
|
|
119
|
-
const s1 = (rotr32(w[i - 2], 17) ^ rotr32(w[i - 2], 19) ^ (w[i - 2] >>> 10)) >>> 0;
|
|
120
|
-
w[i] = (w[i - 16] + s0 + w[i - 7] + s1) >>> 0;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7;
|
|
124
|
-
for (let i = 0; i < 64; i++) {
|
|
125
|
-
const S1 = (rotr32(e, 6) ^ rotr32(e, 11) ^ rotr32(e, 25)) >>> 0;
|
|
126
|
-
const ch = ((e & f) ^ (~e & g)) >>> 0;
|
|
127
|
-
const temp1 = (h + S1 + ch + SHA256_K[i] + w[i]) >>> 0;
|
|
128
|
-
const S0 = (rotr32(a, 2) ^ rotr32(a, 13) ^ rotr32(a, 22)) >>> 0;
|
|
129
|
-
const maj = ((a & b) ^ (a & c) ^ (b & c)) >>> 0;
|
|
130
|
-
const temp2 = (S0 + maj) >>> 0;
|
|
131
|
-
h = g;
|
|
132
|
-
g = f;
|
|
133
|
-
f = e;
|
|
134
|
-
e = (d + temp1) >>> 0;
|
|
135
|
-
d = c;
|
|
136
|
-
c = b;
|
|
137
|
-
b = a;
|
|
138
|
-
a = (temp1 + temp2) >>> 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
h0 = (h0 + a) >>> 0;
|
|
142
|
-
h1 = (h1 + b) >>> 0;
|
|
143
|
-
h2 = (h2 + c) >>> 0;
|
|
144
|
-
h3 = (h3 + d) >>> 0;
|
|
145
|
-
h4 = (h4 + e) >>> 0;
|
|
146
|
-
h5 = (h5 + f) >>> 0;
|
|
147
|
-
h6 = (h6 + g) >>> 0;
|
|
148
|
-
h7 = (h7 + h) >>> 0;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return [h0, h1, h2, h3, h4, h5, h6, h7].map(hex32).join('');
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const MD5_S = [
|
|
155
|
-
7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
|
|
156
|
-
5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
|
|
157
|
-
4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
|
|
158
|
-
6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21,
|
|
159
|
-
];
|
|
160
|
-
const MD5_K = Array.from({ length: 64 }, (_, i) => Math.floor(Math.abs(Math.sin(i + 1)) * 2 ** 32) >>> 0);
|
|
161
|
-
|
|
162
|
-
function md5Hex(bytes) {
|
|
163
|
-
const msg = paddedBytes(bytes, 64, 8, true);
|
|
164
|
-
let a0 = 0x67452301;
|
|
165
|
-
let b0 = 0xefcdab89;
|
|
166
|
-
let c0 = 0x98badcfe;
|
|
167
|
-
let d0 = 0x10325476;
|
|
168
|
-
const m = new Array(16);
|
|
169
|
-
|
|
170
|
-
for (let offset = 0; offset < msg.length; offset += 64) {
|
|
171
|
-
for (let i = 0; i < 16; i++) {
|
|
172
|
-
const j = offset + i * 4;
|
|
173
|
-
m[i] = (msg[j] | (msg[j + 1] << 8) | (msg[j + 2] << 16) | (msg[j + 3] << 24)) >>> 0;
|
|
174
|
-
}
|
|
175
|
-
let a = a0, b = b0, c = c0, d = d0;
|
|
176
|
-
|
|
177
|
-
for (let i = 0; i < 64; i++) {
|
|
178
|
-
let f, g;
|
|
179
|
-
if (i < 16) { f = (b & c) | (~b & d); g = i; }
|
|
180
|
-
else if (i < 32) { f = (d & b) | (~d & c); g = (5 * i + 1) % 16; }
|
|
181
|
-
else if (i < 48) { f = b ^ c ^ d; g = (3 * i + 5) % 16; }
|
|
182
|
-
else { f = c ^ (b | ~d); g = (7 * i) % 16; }
|
|
183
|
-
f = (f + a + MD5_K[i] + m[g]) >>> 0;
|
|
184
|
-
a = d;
|
|
185
|
-
d = c;
|
|
186
|
-
c = b;
|
|
187
|
-
b = (b + rotl32(f, MD5_S[i])) >>> 0;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
a0 = (a0 + a) >>> 0;
|
|
191
|
-
b0 = (b0 + b) >>> 0;
|
|
192
|
-
c0 = (c0 + c) >>> 0;
|
|
193
|
-
d0 = (d0 + d) >>> 0;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const out = new Uint8Array(16);
|
|
197
|
-
for (const [i, word] of [a0, b0, c0, d0].entries()) {
|
|
198
|
-
out[i * 4] = word & 0xff;
|
|
199
|
-
out[i * 4 + 1] = (word >>> 8) & 0xff;
|
|
200
|
-
out[i * 4 + 2] = (word >>> 16) & 0xff;
|
|
201
|
-
out[i * 4 + 3] = (word >>> 24) & 0xff;
|
|
202
|
-
}
|
|
203
|
-
return bytesToHex(out);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const MASK64 = (1n << 64n) - 1n;
|
|
207
|
-
const SHA512_H0 = [
|
|
208
|
-
0x6a09e667f3bcc908n, 0xbb67ae8584caa73bn, 0x3c6ef372fe94f82bn, 0xa54ff53a5f1d36f1n,
|
|
209
|
-
0x510e527fade682d1n, 0x9b05688c2b3e6c1fn, 0x1f83d9abfb41bd6bn, 0x5be0cd19137e2179n,
|
|
210
|
-
];
|
|
211
|
-
const SHA512_K = [
|
|
212
|
-
0x428a2f98d728ae22n, 0x7137449123ef65cdn, 0xb5c0fbcfec4d3b2fn, 0xe9b5dba58189dbbcn,
|
|
213
|
-
0x3956c25bf348b538n, 0x59f111f1b605d019n, 0x923f82a4af194f9bn, 0xab1c5ed5da6d8118n,
|
|
214
|
-
0xd807aa98a3030242n, 0x12835b0145706fben, 0x243185be4ee4b28cn, 0x550c7dc3d5ffb4e2n,
|
|
215
|
-
0x72be5d74f27b896fn, 0x80deb1fe3b1696b1n, 0x9bdc06a725c71235n, 0xc19bf174cf692694n,
|
|
216
|
-
0xe49b69c19ef14ad2n, 0xefbe4786384f25e3n, 0x0fc19dc68b8cd5b5n, 0x240ca1cc77ac9c65n,
|
|
217
|
-
0x2de92c6f592b0275n, 0x4a7484aa6ea6e483n, 0x5cb0a9dcbd41fbd4n, 0x76f988da831153b5n,
|
|
218
|
-
0x983e5152ee66dfabn, 0xa831c66d2db43210n, 0xb00327c898fb213fn, 0xbf597fc7beef0ee4n,
|
|
219
|
-
0xc6e00bf33da88fc2n, 0xd5a79147930aa725n, 0x06ca6351e003826fn, 0x142929670a0e6e70n,
|
|
220
|
-
0x27b70a8546d22ffcn, 0x2e1b21385c26c926n, 0x4d2c6dfc5ac42aedn, 0x53380d139d95b3dfn,
|
|
221
|
-
0x650a73548baf63den, 0x766a0abb3c77b2a8n, 0x81c2c92e47edaee6n, 0x92722c851482353bn,
|
|
222
|
-
0xa2bfe8a14cf10364n, 0xa81a664bbc423001n, 0xc24b8b70d0f89791n, 0xc76c51a30654be30n,
|
|
223
|
-
0xd192e819d6ef5218n, 0xd69906245565a910n, 0xf40e35855771202an, 0x106aa07032bbd1b8n,
|
|
224
|
-
0x19a4c116b8d2d0c8n, 0x1e376c085141ab53n, 0x2748774cdf8eeb99n, 0x34b0bcb5e19b48a8n,
|
|
225
|
-
0x391c0cb3c5c95a63n, 0x4ed8aa4ae3418acbn, 0x5b9cca4f7763e373n, 0x682e6ff3d6b2b8a3n,
|
|
226
|
-
0x748f82ee5defb2fcn, 0x78a5636f43172f60n, 0x84c87814a1f0ab72n, 0x8cc702081a6439ecn,
|
|
227
|
-
0x90befffa23631e28n, 0xa4506cebde82bde9n, 0xbef9a3f7b2c67915n, 0xc67178f2e372532bn,
|
|
228
|
-
0xca273eceea26619cn, 0xd186b8c721c0c207n, 0xeada7dd6cde0eb1en, 0xf57d4f7fee6ed178n,
|
|
229
|
-
0x06f067aa72176fban, 0x0a637dc5a2c898a6n, 0x113f9804bef90daen, 0x1b710b35131c471bn,
|
|
230
|
-
0x28db77f523047d84n, 0x32caab7b40c72493n, 0x3c9ebe0a15c9bebcn, 0x431d67c49c100d4cn,
|
|
231
|
-
0x4cc5d4becb3e42b6n, 0x597f299cfc657e2an, 0x5fcb6fab3ad6faecn, 0x6c44198c4a475817n,
|
|
232
|
-
];
|
|
233
|
-
|
|
234
|
-
function rotr64(x, n) {
|
|
235
|
-
return ((x >> BigInt(n)) | (x << BigInt(64 - n))) & MASK64;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function shr64(x, n) {
|
|
239
|
-
return x >> BigInt(n);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function add64(...xs) {
|
|
243
|
-
let out = 0n;
|
|
244
|
-
for (const x of xs) out = (out + x) & MASK64;
|
|
245
|
-
return out;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
function sha512Hex(bytes) {
|
|
249
|
-
const msg = paddedBytes(bytes, 128, 16);
|
|
250
|
-
const h = [...SHA512_H0];
|
|
251
|
-
const w = new Array(80).fill(0n);
|
|
252
|
-
|
|
253
|
-
for (let offset = 0; offset < msg.length; offset += 128) {
|
|
254
|
-
for (let i = 0; i < 16; i++) {
|
|
255
|
-
let word = 0n;
|
|
256
|
-
for (let j = 0; j < 8; j++) word = (word << 8n) | BigInt(msg[offset + i * 8 + j]);
|
|
257
|
-
w[i] = word;
|
|
258
|
-
}
|
|
259
|
-
for (let i = 16; i < 80; i++) {
|
|
260
|
-
const s0 = rotr64(w[i - 15], 1) ^ rotr64(w[i - 15], 8) ^ shr64(w[i - 15], 7);
|
|
261
|
-
const s1 = rotr64(w[i - 2], 19) ^ rotr64(w[i - 2], 61) ^ shr64(w[i - 2], 6);
|
|
262
|
-
w[i] = add64(w[i - 16], s0, w[i - 7], s1);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
let [a, b, c, d, e, f, g, hh] = h;
|
|
266
|
-
for (let i = 0; i < 80; i++) {
|
|
267
|
-
const S1 = rotr64(e, 14) ^ rotr64(e, 18) ^ rotr64(e, 41);
|
|
268
|
-
const ch = (e & f) ^ (~e & g);
|
|
269
|
-
const temp1 = add64(hh, S1, ch, SHA512_K[i], w[i]);
|
|
270
|
-
const S0 = rotr64(a, 28) ^ rotr64(a, 34) ^ rotr64(a, 39);
|
|
271
|
-
const maj = (a & b) ^ (a & c) ^ (b & c);
|
|
272
|
-
const temp2 = add64(S0, maj);
|
|
273
|
-
hh = g;
|
|
274
|
-
g = f;
|
|
275
|
-
f = e;
|
|
276
|
-
e = add64(d, temp1);
|
|
277
|
-
d = c;
|
|
278
|
-
c = b;
|
|
279
|
-
b = a;
|
|
280
|
-
a = add64(temp1, temp2);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
h[0] = add64(h[0], a);
|
|
284
|
-
h[1] = add64(h[1], b);
|
|
285
|
-
h[2] = add64(h[2], c);
|
|
286
|
-
h[3] = add64(h[3], d);
|
|
287
|
-
h[4] = add64(h[4], e);
|
|
288
|
-
h[5] = add64(h[5], f);
|
|
289
|
-
h[6] = add64(h[6], g);
|
|
290
|
-
h[7] = add64(h[7], hh);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
return h.map((x) => x.toString(16).padStart(16, '0')).join('');
|
|
294
|
-
}
|
package/lib/eyelang/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Public JavaScript API surface for embedders and the browser playground.
|
|
2
|
-
// The CLI imports the same parser, program, solver, and term primitives from here.
|
|
3
|
-
export { Program, makeProgram } from './program.js';
|
|
4
|
-
export { parseClauses, parseProgramText } from './parser.js';
|
|
5
|
-
export { Solver } from './solver.js';
|
|
6
|
-
export * from './term.js';
|
|
7
|
-
export { BuiltinRegistry, createDefaultRegistry, getDefaultRegistry } from './builtins/registry.js';
|
|
8
|
-
|
|
9
|
-
import { Env, copyResolved, termIsGround, termToString } from './term.js';
|
|
10
|
-
import { Program } from './program.js';
|
|
11
|
-
import { Solver } from './solver.js';
|
|
12
|
-
import { whyNoProof, whyProof } from './explain.js';
|
|
13
|
-
import { getDefaultRegistry } from './builtins/registry.js';
|
|
14
|
-
|
|
15
|
-
export function run(source, options = {}) {
|
|
16
|
-
const includeWhy = options.proof === true || options.why === true || options.explain === true;
|
|
17
|
-
const parseOptions = { ...options, sourceMetadata: includeWhy, markRecursive: includeWhy };
|
|
18
|
-
const program = source instanceof Program ? source : Program.parse(source, parseOptions);
|
|
19
|
-
const runOptions = options.registry ? options : { ...options, registry: getDefaultRegistry() };
|
|
20
|
-
const solver = new Solver(program, runOptions);
|
|
21
|
-
const output = [];
|
|
22
|
-
const goals = program.materializationGoals();
|
|
23
|
-
const materializedKeys = new Set(goals.map((goal) => `${goal.name}/${goal.arity}`));
|
|
24
|
-
const facts = program.sourceFactLines(materializedKeys);
|
|
25
|
-
const seen = new Set();
|
|
26
|
-
for (const goal of goals) {
|
|
27
|
-
solver.solutionsSeen = 0;
|
|
28
|
-
for (const env of solver.solve([goal], new Env(), 0)) {
|
|
29
|
-
const resolved = copyResolved(goal, env);
|
|
30
|
-
if (!termIsGround(resolved)) continue;
|
|
31
|
-
const line = `${termToString(resolved, new Env(), true)}.\n`;
|
|
32
|
-
if (facts.has(line) || seen.has(line)) continue;
|
|
33
|
-
seen.add(line);
|
|
34
|
-
output.push(line);
|
|
35
|
-
if (includeWhy) appendExplanation(output, program, resolved, runOptions.registry);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return { stdout: output.join(''), stats: solver.stats };
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function appendExplanation(output, program, resolved, registry) {
|
|
42
|
-
const proof = whyProof(program, resolved, { registry });
|
|
43
|
-
output.push(proof.text);
|
|
44
|
-
if (!proof.ok) output.push(whyNoProof(resolved));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export * from './explain.js';
|
package/lib/eyelang/package.json
DELETED