#include "Test/UnitTesting.hpp"
#include "Test/SyntaxSugar.hpp"
#include "Inferences/PushUnaryMinus.hpp"
#include "Test/SyntaxSugar.hpp"
#include "Test/TestUtils.hpp"
#include "Test/SimplificationTester.hpp"
using namespace std;
using namespace Kernel;
using namespace Inferences;
using namespace Test;
class PumSimplTester : public Test::Simplification::SimplificationTester
{
public:
virtual Kernel::Clause* simplify(Kernel::Clause* in) override
{
PushUnaryMinus pum;
return pum.simplify(in);
}
virtual bool eq(Kernel::Clause* lhs, Kernel::Clause* rhs) const override
{ return TestUtils::eqModAC(lhs, rhs); }
};
REGISTER_SIMPL_TESTER(PumSimplTester)
#define MY_SYNTAX_SUGAR \
NUMBER_SUGAR(Real) \
DECL_DEFAULT_VARS \
DECL_CONST(a, Real) \
DECL_CONST(b, Real) \
DECL_FUNC(f, {Real}, Real) \
DECL_PRED(p, {Real}) \
DECL_PRED(q, {Real}) \
TEST_SIMPLIFY(test_1,
Simplification::Success()
.input( clause({ p(-(a + b)) }))
.expected( clause({ p(-a + -b) }))
)
TEST_SIMPLIFY(test_2,
Simplification::NotApplicable()
.input( clause({ p(-a + -b) }))
)
TEST_SIMPLIFY(test_3,
Simplification::NotApplicable()
.input( clause({ p(a) }))
)
TEST_SIMPLIFY(test_4,
Simplification::Success()
.input( clause({ p(-(a + b)), p(a) }))
.expected( clause({ p(-a + -b), p(a) }))
)
TEST_SIMPLIFY(test_5,
Simplification::Success()
.input( clause({ p(a), p(-(a + b)) }))
.expected( clause({ p(a), p(-a + -b) }))
)