1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* This file is part of the source code of the software program
* Vampire. It is protected by applicable
* copyright laws.
*
* This source code is distributed under the licence found here
* https://vprover.github.io/license.html
* and in the source directory
*/
/**
* @file Normalisation.hpp
* Defines class Normalisation implementing the normalisation inference rule.
* @since 24/12/2003 Manchester
*/
#ifndef __Normalisation__
#define __Normalisation__
#include "Forwards.hpp"
#include "Lib/Comparison.hpp"
#include "Kernel/Unit.hpp"
#include "SymCounter.hpp"
namespace Shell {
using namespace Lib;
using namespace Kernel;
/**
* Class implementing normalisation-related procedures.
* @since 03/04/2004 Torrevieja, lots renumberSymbols removed
*/
class Normalisation
{
public:
Normalisation();
void normalise(Problem&);
UnitList* normalise(UnitList*);
bool lessThan(Literal*, Literal*);
bool lessThan(Unit*, Unit*);
private:
void normalise(Unit*);
Comparison compare(Term*, Term*);
Comparison compare(Formula*, Formula*);
Comparison compare(Literal*, Literal*);
bool lessThan(Formula*, Formula*);
bool lessThan(Clause*, Clause*);
Comparison compare(TermList ss, TermList ts);
/**
* Return the result of comparison of two integers i1 and i2
*/
inline static
Comparison compare (int i1, int i2)
{
return i1 > i2
? GREATER
: i1 == i2
? EQUAL
: LESS;
}
inline static
Comparison compare (unsigned i1, unsigned i2)
{ return i1 > i2 ? GREATER : i1 == i2 ? EQUAL : LESS; }
/**
* Return the result of comparison of two booleans b1 and b2.
* @since 30/04/2005 Manchester
*/
inline static
Comparison compare (bool b1, bool b2)
{
return b1 ? (b2 ? EQUAL : LESS) : (b2 ? GREATER : EQUAL);
}
/** Counter of the number of symbols */
SymCounter _counter;
}; // class Normalisation
}
#endif