File "railgun"
Since the recent version of Dogelog Player supports cyclic terms,
we could let the Jini out of the bottle, and provide the
experimental library(edge/railgun) to model delayed goals with
nothing else than the ISO core standard Prolog and Alain
Colmerauers rational trees. The results were a Lean CLP of ca. 100
lines of code.
Meanwhile the library is in steady iteration with major
milestones. The current state is that it provides the basic
CLP(FD) vocabulary as found in SWI-Prolog library(clpfd) by Markus
Triska. But it still differs considerably since its constraint
solver is not propagation based. Instead a static variable
ordering technique is deployed before labeling.
The following railgun predicates are provided:
- T in D:
- The predicate delays the goal in D on the term T.
- L ins D:
- The predicate delays the goal in D on the elements L.
- S #= T:
- The predicate delays the goal S =:= T on the terms S and T.
- S #\= T:
- The predicate delays the goal S =\= T on the terms S and T.
- S #< T:
- The predicate delays the goal S < T on the terms S and T.
- S #=< T:
- The predicate delays the goal S =< T on the terms S and T.
- S #> T:
- The predicate delays the goal S > T on the terms S and T.
- S #>= T:
- The predicate delays the goal S >= T on the terms S and T.
- all_different(L):
- The predicate delays the goal that all elements of L are
different.
- label(L):
- The predicate resolves the elements of L, left to right..
- labeling(O, L):
- The predicate resolves the elements of L, statically
reordered, accordingly to the option list O. The available
labeling options are:
zero: Reorder by degree only.
constr: Reorder by degree and number of constraints.
plausi: Reorder by degree and discounted number of constraints
and consistency tests.