souffle
2.0.2-371-g6315b36
|
Intermediate representation of a horn clause. More...
#include <Clause.h>
Public Member Functions | |
void | addToBody (Own< Literal > literal) |
Add a literal to the body of the clause. More... | |
void | apply (const NodeMapper &map) override |
Apply the mapper to all child nodes. More... | |
Clause (Own< Atom > head={}, VecOwn< Literal > bodyLiterals={}, Own< ExecutionPlan > plan={}, SrcLocation loc={}) | |
void | clearExecutionPlan () |
Resets the execution plan. More... | |
Clause * | clone () const override |
Create a clone (i.e. More... | |
std::vector< Literal * > | getBodyLiterals () const |
Obtains a copy of the internally maintained body literals. More... | |
std::vector< const Node * > | getChildNodes () const override |
Obtain a list of all embedded AST child nodes. More... | |
const ExecutionPlan * | getExecutionPlan () const |
Obtains the execution plan associated to this clause or null if there is none. More... | |
Atom * | getHead () const |
Return the atom that represents the head of the clause. More... | |
void | setBodyLiterals (VecOwn< Literal > body) |
Set the bodyLiterals of clause to body . More... | |
void | setExecutionPlan (Own< ExecutionPlan > plan) |
Updates the execution plan associated to this clause. More... | |
void | setHead (Own< Atom > h) |
Set the head of clause to h . More... | |
Public Member Functions inherited from souffle::ast::Node | |
std::string | extloc () const |
Return source location of the syntactic element. More... | |
const SrcLocation & | getSrcLoc () const |
Return source location of the Node. More... | |
Node (SrcLocation loc={}) | |
bool | operator!= (const Node &other) const |
Inequality check for two AST nodes. More... | |
bool | operator== (const Node &other) const |
Equivalence check for two AST nodes. More... | |
void | setSrcLoc (SrcLocation l) |
Set source location for the Node. More... | |
virtual | ~Node ()=default |
Protected Member Functions | |
bool | equal (const Node &node) const override |
Abstract equality check for two AST nodes. More... | |
void | print (std::ostream &os) const override |
Output to a given output stream. More... | |
Protected Attributes | |
VecOwn< Literal > | bodyLiterals |
Body literals of clause. More... | |
Own< Atom > | head |
Head of the clause. More... | |
Own< ExecutionPlan > | plan |
User defined execution plan (if not defined, plan is null) More... | |
Intermediate representation of a horn clause.
A clause can either be:
|
inline |
Definition at line 53 of file Clause.h.
References bodyLiterals.
|
inlineoverridevirtual |
Apply the mapper to all child nodes.
Reimplemented from souffle::ast::Node.
Definition at line 103 of file Clause.h.
References bodyLiterals, and head.
|
inline |
|
inlineoverridevirtual |
|
inlineoverrideprotectedvirtual |
Abstract equality check for two AST nodes.
Reimplemented from souffle::ast::Node.
|
inline |
Obtains a copy of the internally maintained body literals.
Definition at line 79 of file Clause.h.
Referenced by souffle::ast::transform::RemoveRelationCopiesTransformer::removeRelationCopies(), and souffle::ast::transform::PartitionBodyLiteralsTransformer::transform().
|
inlineoverridevirtual |
|
inline |
|
inline |
Return the atom that represents the head of the clause.
Definition at line 74 of file Clause.h.
Referenced by souffle::ast::transform::RemoveRelationCopiesTransformer::removeRelationCopies(), and souffle::ast::transform::PartitionBodyLiteralsTransformer::transform().
|
inlineoverrideprotectedvirtual |
Output to a given output stream.
Implements souffle::ast::Node.
Definition at line 119 of file Clause.h.
|
inline |
|
protected |