souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Protected Attributes
souffle::ast::Negation Class Reference

Negation of an atom negated atom. More...

#include <Negation.h>

Inheritance diagram for souffle::ast::Negation:
Inheritance graph
Collaboration diagram for souffle::ast::Negation:
Collaboration graph

Public Member Functions

void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
Negationclone () const override
 Create a clone (i.e. More...
 
AtomgetAtom () const
 Get negated atom. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain a list of all embedded AST child nodes. More...
 
 Negation (Own< Atom > atom, SrcLocation loc={})
 
- Public Member Functions inherited from souffle::ast::Literal
 Node (SrcLocation loc={})
 
- Public Member Functions inherited from souffle::ast::Node
std::string extloc () const
 Return source location of the syntactic element. More...
 
const SrcLocationgetSrcLoc () 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

Own< Atomatom
 Negated atom. More...
 

Detailed Description

Negation of an atom negated atom.

Example: !parent(x,y).

A negated atom can only occur in the body of a clause.

Definition at line 50 of file Negation.h.

Constructor & Destructor Documentation

◆ Negation()

souffle::ast::Negation::Negation ( Own< Atom atom,
SrcLocation  loc = {} 
)
inline

Definition at line 52 of file Negation.h.

53 {

References atom, souffle::clone(), and souffle::ast::Node::getSrcLoc().

Here is the call graph for this function:

Member Function Documentation

◆ apply()

void souffle::ast::Negation::apply ( const NodeMapper )
inlineoverridevirtual

Apply the mapper to all child nodes.

Reimplemented from souffle::ast::Node.

Definition at line 63 of file Negation.h.

65  :
66  void print(std::ostream& os) const override {

◆ clone()

Negation* souffle::ast::Negation::clone ( ) const
inlineoverridevirtual

Create a clone (i.e.

deep copy) of this node

Implements souffle::ast::Literal.

Reimplemented in souffle::ast::ProvenanceNegation.

Definition at line 59 of file Negation.h.

61  {

◆ equal()

bool souffle::ast::Negation::equal ( const Node ) const
inlineoverrideprotectedvirtual

Abstract equality check for two AST nodes.

Reimplemented from souffle::ast::Node.

Definition at line 76 of file Negation.h.

◆ getAtom()

Atom* souffle::ast::Negation::getAtom ( ) const
inline

Get negated atom.

Definition at line 55 of file Negation.h.

57  {

◆ getChildNodes()

std::vector<const Node*> souffle::ast::Negation::getChildNodes ( ) const
inlineoverridevirtual

Obtain a list of all embedded AST child nodes.

Reimplemented from souffle::ast::Node.

Definition at line 67 of file Negation.h.

70  {

◆ print()

void souffle::ast::Negation::print ( std::ostream &  os) const
inlineoverrideprotectedvirtual

Output to a given output stream.

Implements souffle::ast::Node.

Reimplemented in souffle::ast::ProvenanceNegation.

Definition at line 72 of file Negation.h.

Field Documentation

◆ atom

Own<Atom> souffle::ast::Negation::atom
protected

Negated atom.

Definition at line 83 of file Negation.h.

Referenced by Negation().


The documentation for this class was generated from the following file:
souffle::ast::Negation::print
void print(std::ostream &os) const override
Output to a given output stream.
Definition: Negation.h:72