The MeTTa concept can be implemented on top of the AtomSpace. This repo contains a proof-of-concept.
Version 0.0.1
A fraction of the MeTTa language can be easily imported as Atomese. The code here is a proof of concept of this mapping. At this time, only the simplest mapping is done: the declaration of functions.
The code "works"; see the MeTTa example for a working demo.
This code makes use of the "Foreign Abstract Syntax Tress"
(ForeignAST
) code in the base AtomSpace. This AST code also supports
a proof-of-concept for DataLog. See
https://github.com/opencog/atomspace/tree/master/opencog/atoms/foreign
Implement match
, ground
, and multivalued propagation.
-
match
takes some space, a pattern, and a template does two-sided matching of the pattern on the space (i.e. unification) and fills in the bindings in the template, and returns all results. So, likeMeetLink
but it also unifies. The unifier code in the opencog/unify git repo can be used for that. -
ground
takes some Python/C/Rust function and binds it to a symbol This is handled in the base AtomSpace, with thelib:
wrapper. It just needs to be exposed here. -
Multivalued propagation means a function can return more than one thing, and its arguments can be multi-valued too. It will expand that appropriately. So, for example,
(= A x); (= A y); !(P A A)
returns{(P x x), (P x y), (P y x), (P y y)}
Cartesian product.
To build the MeTTa layer, the packages listed below are required.
- The OpenCog AtomSpace.
- https://github.com/opencog/atomspace
- It uses exactly the same build procedure as this package. Be sure
to
sudo make install
at the end.
Be sure to install the pre-requisites first! Perform the following steps at the shell prompt:
cd to project root dir
mkdir build
cd build
cmake ..
make -j4
sudo make install
make -j4 check
Libraries will be built into subdirectories within build, mirroring the structure of the source directory root.
See the examples
subdirectory.