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
/*
* 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
*/
#ifndef __BackwardSubsumptionDemodulation__
#define __BackwardSubsumptionDemodulation__
#include "InferenceEngine.hpp"
#include "Indexing/LiteralIndex.hpp"
#include "Kernel/MLMatcherSD.hpp"
namespace Inferences {
using namespace Indexing;
using namespace Kernel;
/**
* Subsumption Demodulation is a simplification rule that generalizes
* demodulation by combining subsumption and demodulation.
* The rule is defined as follows:
*
* l = r \/ C L[lΘ] \/ CΘ \/ D
* ------------------------------------
* L[rΘ] \/ CΘ \/ D
*
* where
* - C, D are clauses and Θ is a substitution,
* - lΘ > rΘ, and
* - L[lΘ] \/ D > (l = r)Θ.
*
* For a detailed description, see the paper
*
* Bernhard Gleiss, Laura Kovács, Jakob Rath:
* Subsumption Demodulation in First-Order Theorem Proving.
* Accepted for IJCAR 2020.
*
* This class implements the backward direction.
*/
class BackwardSubsumptionDemodulation
: public BackwardSimplificationEngine
{
public:
BackwardSubsumptionDemodulation(bool enableOrderingOptimizations);
void attach(SaturationAlgorithm* salg) override;
void detach() override;
void perform(Clause* premise, BwSimplificationRecordIterator& simplifications) override;
private:
std::shared_ptr<BackwardSubsumptionIndex> _index;
bool _preorderedOnly;
bool _allowIncompleteness;
const bool _enableOrderingOptimizations;
void performWithQueryLit(Clause* premise, Literal* candidateQueryLit, std::vector<BwSimplificationRecord>& simplifications);
bool simplifyCandidate(Clause* sideCl, Clause* mainCl, std::vector<BwSimplificationRecord>& simplifications);
bool rewriteCandidate(Clause* sideCl, Clause* mainCl, MLMatcherSD const& matcher, Clause*& replacement);
};
};
#endif /* __BackwardSubsumptionDemodulation__ */