Axiom lists in eXPL are collections of axioms generated during the processing of a query and are made available in the query result. Axiom lists are also accessible during processing which permits a list to be arranged in any desired order. An insertion sort can be found in "Sort Cities Example" of eXPL Calculator.
Format
An Axiom list declaration has format:
list name(source).
Unlike a Value or Term list, there is no type specifier. The source can be a previously declared axiom or template. In the latter case, the list contains the snapshot axioms created on each successful unification step during execution of a query, Note that the name of a template is normally allowed to be the same as the axion with which it unifies, but this is not allowed if the template is the source of an axiom list.
Axiom list indexes start from zero. The list items are Term lists to allow axiom access using a second array index. So given an Axiom list named "city_list",
is the first axiom in the list and
is a reference to the name of the first city.
Axiom list items are not likely to be used within queries except perhaps for ordering the results. An item can be assigned to a temporary variable during a swap operation, but that is about all that is allowed. To reference an Axiom list the same rules apply as for a Value list item. ie. an integer literal, variable or expression must be used.
Here is an example of a template declaration followed by an Axiom list declaration to capture the result:
template high_city(name ? altitude > 5000, altitude);
// Solution is a list named 'city_list' which receives 'high_city' axioms
list city_list(high_city);
The opposite example shows the city_list in action.
