The Artificial Intelligence Domain Definition Language (AIDDL) allows to model AI problems, data and how AI methods are connected in order to solve problems. This allows to create complex integrated AI systems by combining robust and well-studied components.
For installation, documentation, etc. check docs.aiddl.org.
AIDDL files represent modules containing type definitions (e.g., defining states or goal for planning, instance for machine learning), data (e.g., concrete state or goal for planning), functionality definitions (define computation based on input and output types), as well as function compositions that implemented the actual integrated system (functionality + control flow).
The Core Library implements AIDDL support for a programming language (parser, data structures, evaluator). The Common library is a collection of AI type definitions and algorithms that can be used for rapid prototyping of integrated AI systems. The Example Library is a collection of example project that demonstrate how AIDDL is used to create integrated AI systems. Examples use implementations from the Common Library.
An AIDDL file contains a module entry followed by any number of entries. There are a few entries with a special meaning (as indicated by their types) and some expressions can be evaluated. In the following we will go though each of these in turn.
Everything in an AIDDL file is an entry. Below we discussed a few entries with
special types (#mod
, #req
, #nms
, #def
).
A regular entry is a tuple with the form:
(t n v)
Here, the type t
can be either a basic type (e.g., org.aiddl.type.integer), or a
type defined as described below. The name n
is the name of the entry. Names are not
allowed to contain references. The value v
can be any term.
Everything written in AIDDL is a term. This section shows the basic type hierarchy, gives a few examples, and provides the AIDDL reference name for each type.
Name | Reference | Description | Examples |
---|---|---|---|
Term | org.aiddl.term | Every AIDDL expression is a term. | see below |
Symbolic | org.aiddl.term.symbolic | Non-numerical constants. | a e1 + #integer |
Boolean | org.aiddl.term.symbolic.boolean | Boolean constants | true false |
Variable | org.aiddl.term.variable | Named variables beginning with ? or anonymous variables _ | ?x ~?e1 ~_ |
String | org.aiddl.term.string | Any string of characters in quotes. | "a" "abc" "1 2 3" |
Numerical | org.aiddl.term.numerical | Different types of numerical values. All numerical types can be compared and used in the same computation. | see below |
Integer | org.aiddl.term.numerical.integer | Positive or negative integers. | 0 -3 11 |
Rational | org.aiddl.term.numerical.rational | Positive or negative rational numbers. | 0/1 -1/3 110/13 |
Real | org.aiddl.term.numerical.real | Positive or negative real numbers. | 0.0 -1.3 1.1 |
Infinity | org.aiddl.term.numerical.inf | Positive or negative infinity. | INF +INF -INF |
Collection | org.aiddl.term.collection | Collections of terms. | see below |
Set | org.aiddl.term.collection.set | A set of terms. Cannot be matched to other terms. | {} {e1 e2 e3} {1 1 2} |
List | org.aiddl.term.collection.list | A list of terms. | [] [e1 e2 e3] [1 1 2] |
Tuple | org.aiddl.term.tuple | A tuple of terms. Unlike lists, we assume tuples will not be extended. | () ~(e1 e2 e3) (1 1 2) |
Reference | org.aiddl.term.reference | A reference to an entry in a specific module. | e@m references entry named e in module m |
$e references entry named e in module where the reference appears (aka self reference) | |||
Function Reference | org.aiddl.term.fun-ref | Reference to a function. Allows using functions as data. | ^org.aiddl.eval.add ^(lambda (?x ?y) (* ?x ?y)) |
Key-Value Pair | org.aiddl.term.key-value | A key and a value term. | x:10 symbolic key x with integer value 10 |
?x:?y variable key ?x with variable value ?y | |||
x:y:z symbolic key x with key value pair y:z as a value |
The following grammar defines the AIDDL file format.
<AiddlFile> :: <Module> (<Entry>)* <Module> :: "(#mod" <Symbolic> <Symolic> ")" <Entry> :: "("<Term> <Term> <Term>")" <Term> :: <Numerical> | <Collection> | <Tuple> | <Symbolic> | <String> | <Variable> | <Reference> | <KeyValue> <Numerical> :: <Integer> | <Rational> | <Real> | <Infinity> <Collection> :: <List> | <Set> <List> :: "[" <Term>* "]" <Set> :: "{" <Term>* "}" <Tuple> :: "(" <Term>* ")" <Reference> :: <Term>"@"<Term> | "$"<Term> <FunRef> :: "^"<Term> <KeyValue> :: <Term>":"<Term> <Symbolic> :: (("a"-"z"|"A"-"Z"|"#")("a"-"z"|"A"-"Z"|"0"-"9"|"_"|"."|"-"|"'")*) |"+"|"-"|"/"|"*"|"&"|"|"|"!"|"="|"<"|">"|"=>"|"<=>"|"^"|"!="|"<="|">=" <String> :: "\"" [~\"]* "\"" <Variable> :: <NamedVariable> | "_" <NamedVariable> :: ?(("a"-"z"|"A"-"Z")("a"-"z"|"A"-"Z"|"0"-"9"|"_"|"."|"-"|"'")*) <Integer> :: ["-"]("0"|"1"-"9")("0"-"9"]* <Rational> :: ["-"]("0"|"1"-"9")("0"-"9")* "/" ("1"-"9"("0"-"9")*) <Real> :: ["-"] ("0"|"1"-"9")("0"-"9")* "." ("0"-"9")+ <Infinity> :: ["+"|"-"]"INF"
A type definition is an entry of type #type
. Each type is defined as a tuple
where the first element is one of the keys in the following table. For each type
in a module a function will be created that determines whether a term satisfies
the given type.
Key | Explanation | Example |
---|---|---|
#basic-type | A basic AIDDL type term. | (basic-type org.aiddl.term.symbolic) |
#or-type | One of various type choices. | (or-type [t1 t2 t3]) |
#set-of | Set of another type. | (set-of t) |
#list-of | List of another type. | (list-of t) |
#collection-of | Collection of another type. | (collection-of t) |
#enum | Element of a set. | (enum {a b c}) |
#signed-tuple | Tuple with a signature, minimum and maximum number of elements. | (signed-tuple [t1 t2] min:1 max:+INF repeat:1) |
Specifying repeat:n allows last n terms can be repeated (default 1). | ||
Default min and max values are length of type list. | ||
#key-value-tuple | A tuple containing keys whose values have designated types. | (key-value-tuple [key1:t1 key2:t2 key3:t3]) |
#typed-key-value | A type for key and value of a key-value term. | (typed-key-value t1 t2) |
#numerical-range | Any number within specified range. min and max are -INF and +INF | (numerical-range min:-1.0 max:1.0) |
by default. |
See AIDDL Type Test Cases for some examples.
Interfaces can be used summarize common functionality under a URI that connects input and output types. If a function implements an interface its inputs and outputs can be tested against the types specified in the interface.
An entry with type #interface
is a tuple containing a symbolic uri
and function
references to input
and output
types. The URI will be attached to the name
of the module the interface is defined in.
The following example defines an interface with URI
org.aiddl.common.planning.state-variable.planner
with input type problem
and
output type plan
(defined elsewhere in the same module).
(#mod self org.aiddl.common.planning.state-variable) (#interface planner ( uri : planner input : $problem output : $plan ))
Contact Uwe Köckemann (uwe.kockemann_at_oru.se) in case of questions, suggestions, feature requests, bug reports.
Join the discord server: https://discord.gg/Fb6CcWySsv
This work was supported by European Union H2020 Project AI4EU under grant agreement ID 825619 as part of Task 7.4 on Integrative AI.