The MeTTa libraries
!(import! &self (library lib_x)) loads one. The entries below reproduce each library's own (@doc ...) atoms, generated by extensions/python/tools/libdoc.py, so they are true by construction; help! and get-doc answer the same atoms live. The coverage table is the burn-down surface: a library appears below it by gaining @doc atoms beside its definitions.
| library | names | documented |
|---|---|---|
| lib_builtin_types | 190 | 0 |
| lib_combinatorics | 6 | 0 |
| lib_conformance | 1 | 0 |
| lib_constraints | 5 | 0 |
| lib_crypto | 2 | 0 |
| lib_datastructures | 26 | 9 |
| lib_datetime | 2 | 0 |
| lib_derived | 1 | 1 |
| lib_dict | 7 | 0 |
| lib_doc | 0 | 0 |
| lib_file | 3 | 3 |
| lib_gitimport | 0 | 0 |
| lib_he | 0 | 0 |
| lib_import | 2 | 2 |
| lib_json | 0 | 0 |
| lib_measure | 16 | 0 |
| lib_memo | 0 | 0 |
| lib_mm2 | 5 | 0 |
| lib_nars | 38 | 0 |
| lib_patrick | 4 | 0 |
| lib_pln | 49 | 0 |
| lib_redis | 0 | 0 |
| lib_reflect | 10 | 9 |
| lib_regex | 6 | 0 |
| lib_roman | 36 | 0 |
| lib_soft | 5 | 0 |
| lib_spaces | 5 | 0 |
| lib_strategy | 24 | 0 |
| lib_string | 0 | 0 |
| lib_tabling | 6 | 0 |
| lib_thread | 37 | 0 |
| lib_torch | 20 | 0 |
| lib_vector | 5 | 0 |
| lib_zar | 4 | 0 |
lib_datastructures
ft-empty
lib_datastructures.metta:45
The empty finger tree; every other tree grows from it with ft-push-front and ft-push-back.
Returns: FTEmpty
ft-is-empty
lib_datastructures.metta:50
Whether a finger tree holds nothing.
- a finger tree
Returns: True or False
ft-pop-front
lib_datastructures.metta:79
The front element and the remaining tree, as the pair ($x $rest). Popping the empty tree has no answer.
- a nonempty finger tree
Returns: ($front $rest)
ft-pop-back
lib_datastructures.metta:100
The back element and the remaining tree, as the pair ($x $rest): ft-pop-front's mirror.
- a nonempty finger tree
Returns: ($back $rest)
ft-front
lib_datastructures.metta:119
The front element, the tree untouched.
- a nonempty finger tree
Returns: the first element
ft-back
lib_datastructures.metta:126
The back element, the tree untouched.
- a nonempty finger tree
Returns: the last element
ft-from-list
lib_datastructures.metta:136
A finger tree holding the expression's elements in order.
- an expression, for instance (1 2 3)
Returns: a finger tree
ft-to-list
lib_datastructures.metta:146
The elements front to back, as an expression: ft-from-list's inverse.
- a finger tree
Returns: an expression
ft-concat
lib_datastructures.metta:197
Both trees' elements, left then right, in O(log n): the operation finger trees exist to make cheap.
- the left finger tree
- the right finger tree
Returns: one finger tree
Undocumented: FTDeep, FTEmpty, FTSingle, FTree, add-unique-or-fail, dequeue, empty-queue, enqueue, ft-app3, ft-borrow-l, ft-borrow-r, ft-node-digit, ft-nodes, ft-push-back, ft-push-front, ft-push-list-back, ft-push-list-front
lib_derived
once
lib_derived.metta:41
(: once (-> Atom %Undefined%))The first answer of an expression, and no more. Derived here as (take 1 ...); the engine's own once is the same form fused into the compiler
- The expression to take one answer of
Returns: Its first answer
lib_file
temp-path!
lib_file.metta:40
A unique fresh path in the system temporary directory, created exclusively so concurrent runners cannot mint the same name; the caller owns the file
- a name prefix for the path
Returns: String
file-exists
lib_file.metta:44
True when a regular file exists at the path, False otherwise
- the path
Returns: Bool
dir-exists
lib_file.metta:48
True when a directory exists at the path, False otherwise
- the path
Returns: Bool
lib_import
import_prolog_functions_from_file
lib_import.metta:32
Consults a Prolog file and registers the named predicates as MeTTa functions
- the Prolog file, as (library name.pl) or a path
- the predicate names to register
Returns: unit
import_prolog_functions_from_module
lib_import.metta:37
Loads a Prolog module and registers the named predicates as MeTTa functions
- the Prolog module, as (library name.pl) or a path
- the predicate names to register
Returns: unit
lib_reflect
builtins
lib_reflect.metta:29
Every builtin name, one per solution
special-forms
lib_reflect.metta:32
Every translator special form, one per solution. These are compiled rather than called, so they are in no registry
functions
lib_reflect.metta:36
Every function the engine knows, builtin or not
user-functions
lib_reflect.metta:39
Every function this space defines itself
arity-of
lib_reflect.metta:42
The registered arities for a name, one per solution
- the name
Returns: an arity
knows?
lib_reflect.metta:48
Whether the engine knows a name at all, as True or False
- the name
Returns: True or False
extension-points
lib_reflect.metta:74
Every extension point the engine declares, as (name arity kind), one per solution
Returns: (name arity kind)
surface-counts
lib_reflect.metta:79
How many builtins, special forms, functions and user functions
Returns: ((key count) ...)
surface-json
lib_reflect.metta:86
The engine's whole surface as a JSON string, for external tools
Returns: a JSON string
Undocumented: origin-of