![]() |
Logic Programs |
![]() |
AProVE Help System → Input Languages → | Logic Programs |
AProVE supports a subset of the Prolog language as input language for logic programs. Termination analysis will be performed by first transforming the logic program into a Term Rewriting System. Soundness of this transformation guarantees that proving termination of the generated TRS is sufficient to prove termination of the original logic program.
In some cases even a complete transformation can be achieved which allows AProVE to give proof of Non-Termination as well.
AProVE expects lines of Prolog programs to be one of the following:
At the moment AProVE recognizes rules of the form head :- body where the body consists of predicates connected by "," (logical and) or ";" (logical or). Each predicate's arguments can be terms build from constants, variables and functions.
Furthermore the following special Prolog symbols and structures are familiar to the AProVE system:
% mode: P(g,g,a).
% query: P(g,g,a).
Both of them supply the AProVE system with additional information about how the predicate symbols of the program are used by specifying which of a predicate's arguments are allowed to contain free variables during application of a rule and which are not. The former ones are those arguments that are marked with a "g" (standing for "ground"), the latter ones are those marked with an "a" (standing for "any"). This information is necessary for the transformation into a TRS.
More intuitively described, the ground arguments are being used as input arguments to the predicate, while the others are used as output. For those who prefer this notation, the AProVE system accepts "i" and "o" instead of "g" and "a" as well.
Both mode lines and query mode lines have got the same syntactic structure. The only difference between them is that the AProVE system treats a normal mode line as a hint at how the predicate is intended to be used, while query mode lines also constitute the kind of of queries, termination analysis will be performed for. Rules not necessary to process any of the predicates that are directly or indirectly connected to one of the queried predicates will be ignored entirely. Normal prolog style queries will be treated like query mode lines. See the Unrequested Clause Remover for details.
For example
% query: append(g,g,a).
append([], Xs, Xs).
append([H|T], Xs, [H|Ys]) :- append(T, Xs, Ys).
is a valid logic program.