List of declarations
Declaring term types
:- structure(...). % formerly called type
:- ctype(...). % will be renamed into primitive
:- operator(...). % this is for infix functors, etc., as in Prolog
Declaring item types
item declaration declares which value type specific structures have. In future versions of dyna, different structures can be items with different value types. So, it will be possible to declare boolean and double items in one program:
:- structure(isUpperCase(string word)). :- item(isUpperCase, bool, false). :- structure(word(string w, int from, int to)). :- item(word, double, 0).
This means that isUpperCase has boolean values, and the default value is false. word has double values, and the default value (for non-derived items) is 0.
However, this is not yet implemented. It is only possible to define a general type for every item:
:- item(item, double, 0).
which admittedly looks a bit mysterious and redundant. To understand this declaration you have to know that
item is a type, just like goal, or isUpperCase. In fact,
item is the automatically declared supertype for all of these. Therefore,
:- item(item, double, 0). means that this supertype carries double values with 0 as the default. Since
item is a supertype, all subtypes inherit this property.
:- foreign(...). % to declare user axioms
:- computed(...). % to declare new functions like log or *
:- accumulator(...). % to declare new accumulation operators like +=
Miscellaneous Dyna-C++ interface
Choosing computational strategies
:- agenda(...). :- pragma(...).