dlvhex
2.5.0
|
Public Member Functions | |
FunctionRewriter (FunctionPlugin::CtxData &ctxdata) | |
virtual | ~FunctionRewriter () |
ID | composeTerm (ProgramCtx &ctx, ID composedTerm, Rule &rule) |
ID | decomposeTerm (ProgramCtx &ctx, ID composedTerm, Rule &rule) |
virtual void | rewrite (ProgramCtx &ctx) |
Rewriting funcition. | |
Private Attributes | |
FunctionPlugin::CtxData & | ctxdata |
Definition at line 134 of file FunctionPlugin.cpp.
FunctionRewriter::FunctionRewriter | ( | FunctionPlugin::CtxData & | ctxdata | ) | [inline] |
Definition at line 140 of file FunctionPlugin.cpp.
virtual FunctionRewriter::~FunctionRewriter | ( | ) | [inline, virtual] |
Definition at line 141 of file FunctionPlugin.cpp.
ID FunctionRewriter::composeTerm | ( | ProgramCtx & | ctx, |
ID | composedTerm, | ||
Rule & | rule | ||
) |
Definition at line 148 of file FunctionPlugin.cpp.
References Term::arguments, Rule::body, ExternalAtom::inputs, ID::isNestedTerm(), Rule::kind, ID::MAINKIND_ATOM, ID::MAINKIND_TERM, ID::posLiteralFromAtom(), ExternalAtom::predicate, ID::PROPERTY_RULE_EXTATOMS, ProgramCtx::registry(), ID::SUBKIND_ATOM_EXTERNAL, ID::SUBKIND_TERM_CONSTANT, and Atom::tuple.
Referenced by decomposeTerm(), and rewrite().
ID FunctionRewriter::decomposeTerm | ( | ProgramCtx & | ctx, |
ID | composedTerm, | ||
Rule & | rule | ||
) |
Definition at line 177 of file FunctionPlugin.cpp.
References Term::arguments, Rule::body, composeTerm(), ExternalAtom::inputs, ID::isNestedTerm(), Rule::kind, ID::MAINKIND_ATOM, ID::MAINKIND_TERM, ID::posLiteralFromAtom(), ExternalAtom::predicate, ID::PROPERTY_RULE_EXTATOMS, ProgramCtx::registry(), ID::SUBKIND_ATOM_EXTERNAL, ID::SUBKIND_TERM_CONSTANT, and Atom::tuple.
Referenced by rewrite().
void FunctionRewriter::rewrite | ( | ProgramCtx & | ctx | ) | [virtual] |
Rewriting funcition.
The rewriting is applied to a ProgramCtx object.
ctx | The current program context |
Especially ctx.edb and ctx.idb may be the subject of rewriting.
Implements PluginRewriter.
Definition at line 206 of file FunctionPlugin.cpp.
References ID::ALL_ONES, Rule::body, composeTerm(), decomposeTerm(), Rule::head, ProgramCtx::idb, ExternalAtom::inputs, ID::isExternalAtom(), ID::isNaf(), ID::isOrdinaryAtom(), Rule::kind, Atom::kind, ID::nafLiteralFromAtom(), ID::posLiteralFromAtom(), ExternalAtom::predicate, ProgramCtx::registry(), ID::SUBKIND_ATOM_ORDINARYN, ID::SUBKIND_MASK, and Atom::tuple.
FunctionPlugin::CtxData& FunctionRewriter::ctxdata [private] |
Definition at line 138 of file FunctionPlugin.cpp.