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

Negates a given condition. More...

#include <Negation.h>

Inheritance diagram for souffle::ram::Negation:
Inheritance graph
Collaboration diagram for souffle::ram::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...
 
std::vector< const Node * > getChildNodes () const override
 Obtain list of all embedded child nodes. More...
 
const ConditiongetOperand () const
 Get operand of negation. More...
 
 Negation (Own< Condition > op)
 
- Public Member Functions inherited from souffle::ram::Node
bool operator!= (const Node &other) const
 Inequality check for two RAM nodes. More...
 
bool operator== (const Node &other) const
 Equivalence check for two RAM nodes. More...
 
virtual void rewrite (const Node *oldNode, Own< Node > newNode)
 Rewrite a child node. More...
 
virtual ~Node ()=default
 

Protected Member Functions

bool equal (const Node &node) const override
 Equality check for two RAM nodes. More...
 
void print (std::ostream &os) const override
 Print RAM node. More...
 

Protected Attributes

Own< Conditionoperand
 Operand. More...
 

Detailed Description

Negates a given condition.

For example:

(NOT t0 IN A)

Definition at line 49 of file Negation.h.

Constructor & Destructor Documentation

◆ Negation()

souffle::ram::Negation::Negation ( Own< Condition op)
inline

Definition at line 51 of file Negation.h.

53  {

Referenced by getOperand().

Member Function Documentation

◆ apply()

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

Apply the mapper to all child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 68 of file Negation.h.

70  {

◆ clone()

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

Create a clone (i.e.

deep copy) of this node

Implements souffle::ram::Condition.

Definition at line 64 of file Negation.h.

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

References operand.

◆ equal()

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

Equality check for two RAM nodes.

Default action is that nothing needs to be checked.

Reimplemented from souffle::ram::Node.

Definition at line 77 of file Negation.h.

◆ getChildNodes()

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

Obtain list of all embedded child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 60 of file Negation.h.

61  {
62  operand = map(std::move(operand));

References souffle::map(), and operand.

Here is the call graph for this function:

◆ getOperand()

const Condition& souffle::ram::Negation::getOperand ( ) const
inline

Get operand of negation.

Definition at line 56 of file Negation.h.

57  {
58  return new Negation(souffle::clone(operand));

References souffle::clone(), Negation(), and operand.

Here is the call graph for this function:

◆ print()

void souffle::ram::Negation::print ( std::ostream &  out) const
inlineoverrideprotectedvirtual

Print RAM node.

Implements souffle::ram::Node.

Definition at line 73 of file Negation.h.

Field Documentation

◆ operand

Own<Condition> souffle::ram::Negation::operand
protected

Operand.

Definition at line 83 of file Negation.h.

Referenced by clone(), getChildNodes(), and getOperand().


The documentation for this class was generated from the following file:
souffle::ram::Negation::Negation
Negation(Own< Condition > op)
Definition: Negation.h:51
souffle::map
auto map(const std::vector< A > &xs, F &&f)
Applies a function to each element of a vector and returns the results.
Definition: ContainerUtil.h:158
souffle::ram::Negation::print
void print(std::ostream &os) const override
Print RAM node.
Definition: Negation.h:73
souffle::clone
auto clone(const std::vector< A * > &xs)
Definition: ContainerUtil.h:172
souffle::ram::Negation::operand
Own< Condition > operand
Operand.
Definition: Negation.h:83