When creating a new clause for a predicate H in the program, the following goal will give you a clause in the correct format:
clause_key(H,ClId), rewrite_source_clause(clause(H,Body),ClId,Clause),
Usage:clause_key(H,ClId)
ClId is the clause key that an additional clause of predicate H should have.
Usage:clauses_keys(H,ClIds)
ClIds are the clause keys of all clauses already known for predicate H.
Usage:last_clause(ClId)
ClId is the clause key of the last known clause of the predicate to which it corresponds.
NewClauses is the result of applying the format transformation to the list of clauses Clauses.
Usage:rewrite_source_clause(Clause0,ClId,Clause)
Clause is an structure representing the clause Clause0 identified by ClId (does nothing for directives).
Usage:decode_litkey(AtId,F,A,C,G)
AtId identifies the Gth literal of the body of the Cth clause of predicate F/A.
Usage:is_clkey(Id)
Succeeds if Id is a valid clause identifier. The predicate name must not contain '/' characters.
Usage:is_litkey(Id)
Succeeds if Id is a valid atom identifier. The predicate name must not contain '/' characters.
Usage:is_entrykey(Id)
Succeeds if Id is a valid entry point identifier (predkey for exported predicates, clkey for entry assertions)
Orig_ClId is the clause identifier resulting from replacing the name of a newly generated predicate with the name of its corresponding predicate in the original program.
Usage:
Usage:clid_of_atomid(AtomId,ClId)
Returns in ClId the clause identifier corresponding to AtomId goal identifier.
clause(clause(Head,Body):Clid) :- cgoal(Head), clausebody(Body), clkey(Clid). clause(directive(Body):Clid) :- clausebody(Body), drid(Clid).
Body is a conjunction of simple goals; if a goal is a meta-predicate, its meta-arguments are terms of the form '$'(Term,Body,Type), where Term is the original goal term, Type the type of meta-term as in the meta_predicate directive, and, if Type corresponds to an executable form of meta-term, Body is the clausebody that corresponds to Term.
clausebody(L) :- literal_ppkey(L). clausebody((L,B)) :- literal_ppkey(L), clausebody(B).
literal_ppkey(Lit:PPKey) :- cgoal(Lit), litkey(PPKey). literal_ppkey(builtin(B):noinfo) :- cgoal(B). literal_ppkey(!).
Usage:litkey(Key)
Key is an atom that uniquely identifies a program point of a program clause body literal.
Usage:clkey(Id)
Id is an atom that uniquely identifies a program clause.
Usage:predkey(Id)
Id is an atom that uniquely identifies a program predicate.
Usage:get_predkey(F,A,Key)
Key is the key corresponding to predicate F/A
Usage:get_clkey(F,A,Cl,ClKey)
ClKey is the key corresponding to clause F/A/Cl
Usage:get_litkey(F,A,Cl,Lit,ClKey)
ClKey is the key corresponding to clause F/A/Cl/Lit
Body is a conjunction of simple goals:
body((G,B)) :- cgoal(G), body(B). body(G) :- cgoal(G).
Usage:drid(Id)
Id is a number that uniquely identifies a program directive.
head(0). head(1). head(X) :- cgoal(X).
Usage:head(Head)
Head is a clause head identifier.