Module element

This module provides list constructors. The module realizes a base class for the classes rep-resented by the module ring from this package and the module fraction from the package groebner. The super class relationship is implemented by a reexport/1 statement of the module element in each of the modules. So that functions that apply to elements in general can be implemented by methods for this module here.

Among such general functions we find the consing of an element with a list and returning a compound. This function is not directly available as a constructor but there are two special forms that make use of this general function by polymorphic dispatch. We provide a list con-structor [_ | _] which takes multiple expressions as arguments and another list constructor {_ | _} which takes an expression and a goal as arguments.

?- X is [1+2,3*4,5^6].
X is [3,12,15625]
?- X is { X^2 | between(1,10,X) }.
X is [1,4,9,16,25,36,49,64,81,100]

The element based consing returns a vector. The consing does currently not check that the second argument is a proper list and that all elements of the list are elements. The intention here is to use the consing to only create homogenous vectors of elements. The reader inter-ested in the methods of the vector should browse into the module vector.

The following list constructor special forms are defined:

X is [F | G]:
The special form succeeds in X in evaluating F and the elements of G by using poly-morphism and then creating a compound.
X is {F | G}:
The special form succeeds in X in evaluating F by using polymorphism whenever G succeeds, making copies and then creating a compound.

The following list constructor predicates are defined:

.(X, Y, Z):
The predicate succeeds in Z with the consing of X and Y.