A DCG-goal is a term of one of the following forms:
some Vars DCG-goalSemantics:
transform(V_in, V_out, some Vars DCG_goal) =
some Vars transform(V_in, V_out, DCG_goal)
all Vars DCG-goalSemantics:
transform(V_in, V_out, all Vars DCG_goal) =
all Vars transform(V_in, V_out, DCG_goal)
, DCG-goal2Semantics:
transform(V_in, V_out, (DCG-goal1, DCG-goal2)) =
(transform(V_in, V_new, DCG_goal1),
transform(V_new, V_out, DCG_goal2))
where V_new is a fresh variable.
; DCG-goal2Semantics:
transform(V_in, V_out, (DCG_goal1 ; DCG_goal2)) =
( transform(V_in, V_out, DCG_goal1)
; transform(V_in, V_out, DCG_goal2) )
{ Goal }Semantics:
transform(V_in, V_out, { Goal }) = (Goal, V_out = V_in)
[Term, ...]Semantics:
transform(V_in, V_out, [Term1, ...]) = (V_in = [Term, ... | V_Out])
[]Semantics:
transform(V_in, V_out, []) = (V_out = V_in)
not DCG-goal\+ DCG-goalSemantics:
transform(V_in, V_out, not DCG_goal) =
(not transform(V_in, V_new, DCG_goal), V_out = V_in)
where V_new is a fresh variable.
if CondGoal then ThenGoal else ElseGoal -> ThenGoal ; ElseGoalSemantics:
transform(V_in, V_out, if CondGoal then ThenGoal else ElseGoal) =
if transform(V_in, V_cond, CondGoal) then
transform(V_cond, V_out, ThenGoal)
else
transform(V_in, V_out, ElseGoal)
=(Term)Semantics:
transform(V_in, V_out, =(Term)) = (Term = V_in, V_out = V_in)
:=(Term)Semantics:
transform(V_in, V_out, :=(Term)) = (V_out = Term)
=^ field_listSemantics:
transform(V_in, V_out, Term =^ field_list) =
(Term = V_in ^ field_list, V_out = V_in)
^ field_list := TermSemantics:
transform(V_in, V_out, ^ field_list := Term) =
(V_out = V_in ^ field_list := Term)
Semantics:
transform(V_in, V_out, p(A1, ..., AN)) =
p(A1, ..., AN, V_in, V_out)