Hi,
But Prolog alone is very weak as a language that
allows program verification. You would need to
pair a declarative language such as Prolog, Haskell,
etc.. with a theorem prover.
You can also pair imperative languages Java etc..
with a theorem prover. Theorem provers that can
do that and that can reflect the verified languages,
are HOL/Isabelle, Coq, etc..
So I consider the claims made about Prolog and
e-Coins some crazy marketing hype that might cause
more harm than good. Its just bull shit. You can
make the same errors with or without Prolog
backtracking, and other programming languages also
allow backtracking for example Haskell you can use
some continuation, and in Java you might even use
simple loops. It was just yesterday that I
implemented Xpath (the small subset from the XSLT
prototype) via Java loops (with an fixed array keeping
the choice points):
/**
* <p>Find a first dom element.</p>
*
* @param pos The child number.
* @param e The child dom element.
* @return The found dom element, or null.
*/
private DomElement findFirst(int pos, DomElement e) {
if (!locs.get(pos).checkElement(e))
return null;
if (pos == locs.size() - 1)
return e;
DomNode[] children = e.snapshotChildren();
for (int i = 0; i < children.length; i++) {
DomNode child = children[i];
if (!(child instanceof DomElement))
continue;
e = findFirst(pos + 1, (DomElement) child);
if (e != null) {
LocationHit hit = hits.get(pos);
hit.setChildren(children);
hit.setPos(i);
return e;
}
}
return null;
}
/**
* <p>Find a next dom element.</p>
*
* @return The found dom element, or null.
*/
private DomElement findNext() {
int pos = hits.size() - 1;
while (pos >= 0) {
LocationHit hit = hits.get(pos);
DomNode[] children = hit.getChildren();
for (int i = hit.getPos() + 1; i < children.length; i++) {
DomNode child = children[i];
if (!(child instanceof DomElement))
continue;
DomElement e = findFirst(pos + 1, (DomElement) child);
if (e != null) {
hit.setPos(i);
return e;
}
}
pos--;
}
return null;
}
Unfortunately CLP(*) can never replace a theorem prover.
In a theorem prover you have quantifier rules and semi-
automatic guidance (human interaction to complete a proof),
which so far I don't see many CLP(*) implementations offering.
Their aim is different.
Also to reflect portions of the verified language typically a
higher order logic is used and some calculus of construction,
this is all terrain that would need to find its way into
Prolog, only found in prototypes such as λ-Prolog (*).
So ordinary Prolog has already lost the game.
Bye
(*) One way or the other you would need to implement
some higher order unification.