Skip to content

iCog-Labs-Dev/MM2-Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MORK Helper Extension Package

Helper extension package for MORK grounding functions.

Current helpers included:

  • length
  • car
  • cdr
  • cons
  • decons
  • partitions
  • factorial
  • falling_factorial

Example:

(pure (factorial-result $out) $out
  (i64_to_string (factorial (i64_from_string 5))))

Safe binomial-style usage:

;; C(n,k) = falling_factorial(n,k) / factorial(k)
(pure (choose-result $out) $out
  (i64_to_string
    (div_i64
      (falling_factorial (i64_from_string 25) (i64_from_string 3))
      (factorial (i64_from_string 3)))))

What this package does

This package applies a small patch to a MORK checkout:

  1. Copies helper_ext.rs into kernel/src/helper_ext.rs
  2. Wires module/import/registration in kernel sources
  3. Builds MORK release binary

Requirements

  • git
  • Rust toolchain (nightly-compatible for MORK)
  • cargo
  • perl
  • rg (ripgrep)

Quick Start (from GitHub)

git clone https://github.com/tezena/MM2-Helper.git
cd MM2-Helper
bash setup_mork_helper_ext.sh /absolute/path/to/MORK

If /absolute/path/to/MORK does not exist, the script clones upstream MORK there automatically.

Run MORK

/absolute/path/to/MORK/target/release/mork run your_file.metta

Re-run after updates

If you update this package later, run the setup command again:

bash setup_mork_helper_ext.sh /absolute/path/to/MORK

The script is designed to be repeatable and keeps wiring in sync.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors