Skip to content

uwe-koeckemann/AIDDL

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

The AIDDL Framework

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.

Overview

./material/figures/overview.png

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.

AIDDL Files

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.

Basic Type Hierarchy

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.

NameReferenceDescriptionExamples
Termorg.aiddl.termEvery AIDDL expression is a term.see below
Symbolicorg.aiddl.term.symbolicNon-numerical constants.a e1 + #integer
Booleanorg.aiddl.term.symbolic.booleanBoolean constantstrue false
Variableorg.aiddl.term.variableNamed variables beginning with ? or anonymous variables _?x ~?e1 ~_
Stringorg.aiddl.term.stringAny string of characters in quotes.~”a”~ ~”abc”~ ~”1 2 3”~
Numericalorg.aiddl.term.numericalDifferent types of numerical values. All numerical types can be compared and used in the same computation.see below
Integerorg.aiddl.term.numerical.integerPositive or negative integers.0 -3 11
Rationalorg.aiddl.term.numerical.rationalPositive or negative rational numbers.0/1 -1/3 110/13
Realorg.aiddl.term.numerical.realPositive or negative real numbers.0.0 -1.3 1.1
Infinityorg.aiddl.term.numerical.infPositive or negative infinity.INF +INF -INF
Collectionorg.aiddl.term.collectionCollections of terms.see below
Setorg.aiddl.term.collection.setA set of terms. Cannot be matched to other terms.{} {e1 e2 e3} {1 1 2}
Listorg.aiddl.term.collection.listA list of terms.[] [e1 e2 e3] [1 1 2]
Tupleorg.aiddl.term.tupleA tuple of terms. Unlike lists, we assume tuples will not be extended.() ~(e1 e2 e3) (1 1 2)
Referenceorg.aiddl.term.referenceA 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 Referenceorg.aiddl.term.fun-refReference to a function. Allows using functions as data.^org.aiddl.eval.add ^(lambda (?x ?y) (* ?x ?y))
Key-Value Pairorg.aiddl.term.key-valueA 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

Grammar

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"

Function Definition (#def)

Type Definition (#type)

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.

KeyExplanationExample
#basic-typeA basic AIDDL type term.(basic-type org.aiddl.term.symbolic)
#or-typeOne of various type choices.(or-type [t1 t2 t3])
#set-ofSet of another type.(set-of t)
#list-ofList of another type.(list-of t)
#collection-ofCollection of another type.(collection-of t)
#enumElement of a set.(enum {a b c})
#signed-tupleTuple 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-tupleA tuple containing keys whose values have designated types.(key-value-tuple [key1:t1 key2:t2 key3:t3])
#typed-key-valueA type for key and value of a key-value term.(typed-key-value t1 t2)
#numerical-rangeAny 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 (#interface)

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 ))

Support

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

Acknowledgments

This work was supported by European Union H2020 Project AI4EU under grant agreement ID 825619 as part of Task 7.4 on Integrative AI.

About

Domain definition language and framework for integrative AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published