Functions
The core library provides interfaces/traits for functions to target different needs.
Function: uses term as input and produces term as output
Example: use a planning problem to produce a plan
Example: use a machine learning problem to produce a decision tree
Initializable: inizalize a function with a term
Example: initial state for a search
Example: set a state machine to an initial state
Configurable: set parameters of a function
Example: set parameters of a search or of a learning algorithm
Default Functions
Each core implementation has a set of default functions that should behave the same across different core libraries.
The following is a complete list of all implemented evaluator functions that should be supported by every implementation of the AIDDL Core Library. Most lower case symbols (a,b,e,f,m,t,x) refer to terms that may also be evaluated. The symbol σ is a substitution. A substitution is a non-cyclic mapping from terms to terms. Applying a substitution σ = \{k_1:v_1, ... \} to a term x is written as xσ and results in a new term that recursively replaces all appearances of k_i in x by v_i. Another important concept is matching. A term a can be matched to a term b iff there exists a substitution σ such that aσ = b. Upper case letters represent collections, which can be either collection terms C, sets S, or lists L. In some cases we use set notation on collections (which may be lists) for simplicity.
Name | Arguments | Description |
|---|---|---|
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
org.aiddl.eval | ||
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
call |
| Call function referred to by |
lambda |
| Create reference to anonymous function defined by |
quote |
|
|
type |
| Check if |
signature |
|
|
equals |
|
|
not-equals |
|
|
matches |
|
|
first |
| first element of |
last |
| last element of |
size |
|
|
get-key |
|
|
get-idx |
|
|
let |
|
|
if |
| if |
cond |
|
|
map |
|
|
filter |
|
|
reduce |
| |
match |
| |
zip |
| |
key |
|
|
value |
|
|
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
.logic | ||
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
not |
| true if |
and |
| true if all |
or |
| true if any |
forall |
|
|
exists |
|
|
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
.collection | ||
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
in |
|
|
contains |
|
|
contains-all |
|
|
contains-any |
|
|
contains-match |
|
|
add-element |
|
|
add-all |
|
|
remove |
|
|
remove-all |
|
|
sum |
|
|
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
.collection.list | ||
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
concat |
|
|
% head |
| first element of |
% tail |
| last element of |
% cut-head |
|
|
% cut-tail |
|
|
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
.collection.set | ||
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
union |
|
|
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
.numerical | ||
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
add |
|
|
sub |
|
|
mult |
|
|
div |
|
|
modulo |
|
|
greater-than |
|
|
greater-than-eq |
|
|
less-than |
|
|
less-than-eq |
|
|
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
.term | Default type check functions | |
------------------ | ----------------------------------- | ---------------------------------------------------------------------------- |
term |
| true |
numerical |
|
|
integer |
|
|
rational |
|
|
real |
|
|
infinity |
|
|
symbolic |
|
|
boolean |
|
|
string |
|
|
variable |
|
|
reference |
|
|
fun-ref |
|
|
collection |
|
|
list |
|
|
set |
|
|
tuple |
|
|
key-value |
|
|