SMT-RAT
24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
DuplicateSimplifier.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
BaseSimplifier.h
"
4
#include "../ExpressionPool.h"
5
6
namespace
smtrat
{
7
namespace
expression {
8
namespace
simplifier {
9
10
struct
DuplicateSimplifier
:
public
BaseSimplifier
{
11
const
ExpressionContent
*
simplify
(
const
NaryExpression
& expr)
const
{
12
if
(expr.
type
==
IFF
)
return
nullptr
;
13
if
(expr.
type
==
XOR
)
return
nullptr
;
14
Expressions
expressions(expr.
expressions
.begin(), expr.
expressions
.end());
15
auto
it = std::unique(expressions.begin(), expressions.end());
16
if
(it == expressions.end())
return
nullptr
;
17
expressions.erase(it, expressions.end());
18
return
ExpressionPool::create
(expr.
type
, std::move(expressions));
19
}
20
};
21
22
}
23
}
24
}
BaseSimplifier.h
smtrat::expression::ExpressionPool::create
const ExpressionContent * create(carl::Variable::Arg var)
smtrat::expression::Expressions
std::vector< Expression > Expressions
Definition:
ExpressionTypes.h:21
smtrat::expression::XOR
@ XOR
Definition:
ExpressionTypes.h:28
smtrat::expression::IFF
@ IFF
Definition:
ExpressionTypes.h:28
smtrat
Class to create the formulas for axioms.
Definition:
handle_options.h:10
smtrat::expression::ExpressionContent
Definition:
ExpressionContent.h:96
smtrat::expression::NaryExpression
Definition:
ExpressionContent.h:70
smtrat::expression::NaryExpression::expressions
Expressions expressions
Definition:
ExpressionContent.h:72
smtrat::expression::NaryExpression::type
NaryType type
Definition:
ExpressionContent.h:71
smtrat::expression::simplifier::BaseSimplifier
Definition:
BaseSimplifier.h:9
smtrat::expression::simplifier::DuplicateSimplifier
Definition:
DuplicateSimplifier.h:10
smtrat::expression::simplifier::DuplicateSimplifier::simplify
const ExpressionContent * simplify(const NaryExpression &expr) const
Definition:
DuplicateSimplifier.h:11
smtrat-expressions
simplifier
DuplicateSimplifier.h
Generated by
1.9.1