Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring and Extending Unification with Abstraction #508

Merged
merged 226 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
226 commits
Select commit Hold shift + click to select a range
1f03dc5
added initial uwa unit tests
Nov 18, 2022
f5f8e25
output operators for subtition trees
Nov 18, 2022
c120be3
more uwa + indexing tests
Nov 21, 2022
fb2a014
made it possible to runn a subselection of the unit tests at once
Nov 21, 2022
d48eb1d
fixed robsubstitution test cases
Nov 21, 2022
9a9ba4a
bug fix
Nov 21, 2022
cfc8d10
fixed some testss
Nov 22, 2022
c132f37
Merge branch 'joe-substitution-tree-refactor' into joe-uwa-refactor
Dec 20, 2022
8d4322a
remove of dead code
Dec 20, 2022
dbb29ce
tidy
Dec 20, 2022
287eb87
fixed test case
Dec 20, 2022
ff3781d
cleanup
Dec 20, 2022
8aa6d16
created dedicated UnifcationConstraintStack class
Dec 20, 2022
0e28a82
got rid of very special variables
Dec 20, 2022
58bd989
tidy up
Dec 21, 2022
22b25c2
bit of tidy syntax sugar
Dec 21, 2022
4033142
cleanup
Dec 21, 2022
d9d0d37
fixed polymorphic optimization activation
Dec 22, 2022
39f5bb7
introduced MismatchHandlerTerm
Dec 22, 2022
c912d6e
Merge branch 'joe-substitution-tree-refactor' into joe-uwa-refactor
Jan 10, 2023
4cfdbaa
dead code removal
Jan 10, 2023
ba1d6a2
intermediate
Jan 11, 2023
6bdebf2
intermediate
Jan 27, 2023
fc0323c
Merge branch 'joe-substitution-tree-refactor' into joe-uwa-refactor
Jan 30, 2023
9447c5c
big merge
Jan 31, 2023
1edd570
all tests passing
Jan 31, 2023
42368c4
set up tests and dumm UWA strategy for bottom constraints & friends
Jan 31, 2023
2c2e967
implemented AC unification with abstraction for tests
Feb 1, 2023
75bee5a
intermediate
Feb 2, 2023
0815a8a
added IMPL_HASH_FROM_TUPLE
Feb 2, 2023
39c4738
intermed
Feb 2, 2023
39fb4e7
refactored MismatchHandlerTerm -> TermSpec, and extended TermSpec (al…
Feb 4, 2023
68709c8
added AC2 test unifcation with abstraction option
Feb 5, 2023
2331c8c
bug fix
Feb 7, 2023
b4706f1
bug fix
Feb 7, 2023
ecdc6ad
bug fix
Feb 7, 2023
3a77a7b
bug fix (all tests passing again)
Feb 7, 2023
4109b13
bug fix
Feb 8, 2023
0706a99
bug fix in BinaryResolution introduced in merging
Feb 8, 2023
5ec8fd3
bug fix
Feb 8, 2023
7b1d59c
made uwa mode a paremeter instead of reading from env.options
Feb 13, 2023
bbc5fde
got rid of HOMismatchHandler
Feb 13, 2023
bdc66e9
cleanup getting rid of virtual class mismatchHandler
Feb 13, 2023
a0405df
got rid of heap allocating MismatchHandler
Feb 13, 2023
f3bf19a
got rid of pointer indirections for MismatchHandler
Feb 13, 2023
5a15936
bug fix
Feb 14, 2023
54d2468
minor fix
Feb 14, 2023
d135714
gcc fixes
Feb 14, 2023
eeac67c
Merge branch 'joe-uwa-refactor' of github.com:vprover/vampire into jo…
Feb 14, 2023
e3b9a3e
added unit test
Feb 15, 2023
c19df32
added unit test
Feb 15, 2023
a06428f
recycling stacks in TermSpec
Feb 16, 2023
3d055d3
bug fix
Feb 17, 2023
4848fe5
bug fix
Feb 17, 2023
d81abee
out of memory bug fix
Feb 20, 2023
b0fb492
var namspace bug fix
Feb 20, 2023
c3d04ef
move semantics for new TermSpec
Feb 20, 2023
2296e2b
fixed stack use after return
Feb 21, 2023
a3e0dd8
fixed use after free(s)
Feb 21, 2023
8ff2afc
fixed subtle heap-use-after-free due to de-initialialization order of…
Feb 22, 2023
655832f
started framework for postprocessing uwa
Feb 22, 2023
223a330
implemented finalize
Feb 27, 2023
e98f980
uwa postpro implemented
Feb 27, 2023
7841d81
postpro check integrated in all rules
Feb 27, 2023
b2daf9b
renaming
Feb 27, 2023
ebd2d3e
renaming
Feb 27, 2023
68c51bf
moved Shell::Options::UnificationWithAbstraction from field to argume…
Feb 27, 2023
93bb9c6
renamed uwa fpi option
Feb 27, 2023
7f0840f
added assertion
Mar 20, 2023
4e2203e
renamed OldTermSpec to AtomicTermSpec
Mar 22, 2023
2a724e5
Merge branch 'joe-substitution-tree-refactor' into joe-uwa-refactor
Mar 23, 2023
8994896
fixes after merging
Mar 23, 2023
aefebe4
removed unused files
Apr 21, 2023
6830616
tidying of Indexing::UnificationAlgorithms
May 3, 2023
09145fa
tidying of Indexing::UnificationAlgorithms
May 3, 2023
9ca3563
tidying of Indexing::UnificationAlgorithms
May 3, 2023
ef68665
added assertion to see whether `RobSubstitution::root` call is really…
May 3, 2023
1afada1
gcc compile fix
May 3, 2023
0670148
renaming and documentation
May 4, 2023
0ab574d
Merge branch 'joe-substitution-tree-refactor' into joe-uwa-refactor
May 5, 2023
ae0b49d
fixes after merge
May 5, 2023
eeae8f4
documentation
May 5, 2023
549c69c
documentation
May 5, 2023
7f9bfe3
Release compile fix
May 5, 2023
73a2d53
Release compile fixes
May 6, 2023
bbd5a4d
made rob substitution use AtomicTermSpec to boost performance for
May 9, 2023
07d0427
inlining for helping the compiler with optimizations
May 9, 2023
4905017
recycling for tuples
May 9, 2023
444a8a3
introduced boxediterator which helps to avoid expensive moves in some…
May 9, 2023
3ba27b5
made CompositeGIE use Stack instead of linked lists to get nicer outp…
May 9, 2023
e155db6
minor miscellanious optimizations in subst tree
May 10, 2023
9041452
optimized term sharing (only for Term*, not for Literal*, and sorts y…
May 10, 2023
5080d75
optimized AutoDerefTermSpec
May 10, 2023
df28aa0
bug fix related to optimization of term sharing
May 10, 2023
9367b03
added guard to prevent unsound saturaiton
May 12, 2023
f2b273f
minor optimizations
May 15, 2023
865753a
hash fix
May 15, 2023
6ebf024
tidy
May 15, 2023
20f3969
Merge branch 'master' into joe-uwa-refactor
joe-hauns Jun 6, 2023
9a4b68e
got rid of unnecessary CALL calls
joe-hauns Jun 27, 2023
64bf49f
re-enabled optimization if uwa mode is OFF
joe-hauns Jun 27, 2023
1726523
added subs tree child select optimization for unification with abstra…
joe-hauns Jun 27, 2023
874d443
lib improvements
joe-hauns Jun 28, 2023
3976179
implemented termsharing optimization for literals as well
joe-hauns Jun 28, 2023
620382f
Merge branch 'joe-uwa-refactor' of github.com:vprover/vampire into jo…
joe-hauns Jun 28, 2023
1ebb2ad
added memo for RobSubstitution::apply, and minor optimization to comp…
joe-hauns Jun 28, 2023
581fff2
Bug fix the resulted from a combination of literal hashing + term sha…
joe-hauns Jun 28, 2023
a018854
optimized term sharing for two variable equalities
joe-hauns Jun 28, 2023
dc7e947
gcc template-releated fix
joe-hauns Jun 28, 2023
83a04c1
optimized apply for ground terms
joe-hauns Jun 28, 2023
f2f58ee
minor optimizations
joe-hauns Jun 28, 2023
841c47f
bug fix
joe-hauns Jun 29, 2023
35d5f83
Merge branch 'master' into joe-uwa-refactor
joe-hauns Jun 29, 2023
3724a58
renamed maybebool variants to be compatible with adress sanitizer which
joe-hauns Jun 29, 2023
791c66b
output operator with less intermediate string generations
joe-hauns Jun 29, 2023
0000527
made term->toString() work even when global problem is not initialized
joe-hauns Jun 29, 2023
1f0b565
reverted minor optimization that caused bug
joe-hauns Jun 29, 2023
bfb299c
bug fix in function extentionality abstraction
joe-hauns Jun 29, 2023
744d983
cleanup
joe-hauns Jun 29, 2023
222a0e7
preps for bool subterm abstraction
joe-hauns Jun 30, 2023
05ccf8a
minor optimizations in equality creation
joe-hauns Jul 13, 2023
2dc0c73
made superposition only compute constraints when needed
joe-hauns Jul 13, 2023
58218f1
got rid of unnecessary int conversion
joe-hauns Jul 20, 2023
8a666d5
optimized coproduct
joe-hauns Aug 8, 2023
43f82b9
new faster bottom up evaluation
joe-hauns Aug 9, 2023
7317007
better inlining and better bottom up evaluation for robsubitituion an…
joe-hauns Aug 9, 2023
cc415bf
minor fixes
joe-hauns Aug 9, 2023
d0b140c
removed old bottom up evaluation
joe-hauns Aug 9, 2023
07b5211
fixed bi-directional compare
joe-hauns Aug 11, 2023
35183f8
using bi-directional compare for Term::Top
joe-hauns Aug 11, 2023
eeb4451
fixed broken test
joe-hauns Aug 11, 2023
9e155bf
optimizing subst tree node comparison
joe-hauns Aug 16, 2023
23da023
optimized coproduct
joe-hauns Aug 17, 2023
78fc80a
more coproduct optimizations
joe-hauns Aug 17, 2023
cb4fed1
coproduct fix
joe-hauns Aug 18, 2023
db864ad
tidy
joe-hauns Aug 18, 2023
c99ec6e
Merge branch 'master' into joe-uwa-refactor
joe-hauns Aug 18, 2023
f9cfe31
relase compile import fix
joe-hauns Aug 18, 2023
563b3f7
more efficient unbound variable backtracking in RobSubstitution
joe-hauns Aug 18, 2023
b856056
gcc compile fix
joe-hauns Aug 21, 2023
3932e81
optimized substitution usage in parsing
joe-hauns Aug 24, 2023
89f3ae0
constness fix
joe-hauns Aug 24, 2023
164b285
minor optimization in subst trees
joe-hauns Aug 24, 2023
540dd82
removed broken assertion
joe-hauns Nov 6, 2023
6fa0858
Merge branch 'master' into joe-uwa-refactor
joe-hauns Nov 6, 2023
835b40c
radically removed CompositeTermSpec
joe-hauns Nov 28, 2023
245897a
Merge branch 'master' into joe-uwa-refactor
joe-hauns Nov 28, 2023
638921d
Merge branch 'joe-uwa-refactor' into joe-uwa-refactor-revert-to-old-t…
joe-hauns Nov 28, 2023
3478290
tidying
joe-hauns Nov 30, 2023
43e4cab
got rid of SLQueryResultIterator
joe-hauns Nov 30, 2023
ca4f6dc
Revert "got rid of SLQueryResultIterator"
joe-hauns Nov 30, 2023
0becd7e
removed dead code
joe-hauns Nov 30, 2023
cd6b233
removed dead code
joe-hauns Nov 30, 2023
305b6da
cleanup
joe-hauns Nov 30, 2023
a1ec6a9
resolved todos
joe-hauns Nov 30, 2023
82f8b39
removed PointerPtrIterator
joe-hauns Nov 30, 2023
cb3f524
removed PointerIterator
joe-hauns Nov 30, 2023
758cc97
dead code removal
joe-hauns Nov 30, 2023
eba5bc5
removed StaticCastIterator
joe-hauns Nov 30, 2023
acf9a39
dead code removal
joe-hauns Nov 30, 2023
2098845
removed NonequalFn
joe-hauns Nov 30, 2023
20e9759
removed FilteredDelIterator
joe-hauns Nov 30, 2023
13929f0
removed FilteredDelIterator
joe-hauns Nov 30, 2023
7be6485
removed `getConcatenatedIterator` in favor of `concatIters` and removed
joe-hauns Nov 30, 2023
ac67bc5
dead code removal
joe-hauns Nov 30, 2023
03930c8
removed getArrayishObjectIterator in favor of arrayIter
joe-hauns Nov 30, 2023
c166cc2
removed dead code
joe-hauns Nov 30, 2023
3dcbde5
tidying
joe-hauns Nov 30, 2023
800c351
removed dead code
joe-hauns Nov 30, 2023
77bb4c3
tidy
joe-hauns Nov 30, 2023
0f26ef3
tidy
joe-hauns Nov 30, 2023
b556495
simplified uwa fixed point iteration
joe-hauns Dec 1, 2023
48e6805
dead code removal
joe-hauns Dec 1, 2023
ec9f93b
new termsharing bug fix
joe-hauns Dec 1, 2023
d5eeeb5
added documentation
joe-hauns Dec 1, 2023
6e366b1
documentation
joe-hauns Dec 1, 2023
0f61351
updated documenation and renamed `MismatchHandler` to `AbstractionOra…
joe-hauns Dec 1, 2023
e389dff
Merge branch 'master' into joe-uwa-refactor
joe-hauns Dec 1, 2023
d2ebde8
fogot to check in files
joe-hauns Dec 1, 2023
f54a36c
gcc compile fix
joe-hauns Dec 1, 2023
e30a483
warning fix
joe-hauns Dec 1, 2023
bc64939
removed assertion
joe-hauns Dec 4, 2023
fe0dd64
update samplerSMT with theory reasoning options including the new uwa(s)
quickbeam123 Dec 8, 2023
28ee4e5
updated comment
joe-hauns Dec 11, 2023
63bc808
updated option description
joe-hauns Dec 11, 2023
72be1e7
comment
joe-hauns Dec 11, 2023
2c41fae
comment
joe-hauns Dec 11, 2023
64f25f2
comment
joe-hauns Dec 11, 2023
246b7a7
tidy
joe-hauns Dec 11, 2023
eb38ba5
Merge branch 'master' into joe-uwa-refactor
joe-hauns Dec 11, 2023
f724455
assertion violation fix
joe-hauns Dec 11, 2023
0062ad6
warning fix
joe-hauns Dec 11, 2023
7c254f8
bug fix
joe-hauns Dec 11, 2023
bf89925
fixed issue around uwa and two variable constraints
joe-hauns Dec 11, 2023
e9fa63b
fixed polymorphism incompatibility of new uwa
joe-hauns Dec 12, 2023
7249e1a
subtle bug fix related to occurs check in AC uwa and special variables
joe-hauns Dec 19, 2023
2cc6bcd
removed too defensive assertion
joe-hauns Dec 20, 2023
369275b
bug fix
joe-hauns Dec 20, 2023
1c9adf1
output operators for literal indices
joe-hauns Dec 21, 2023
1b8893f
introducing less variables for glue terms
joe-hauns Dec 21, 2023
fc24234
debug output & time tracing
joe-hauns Dec 21, 2023
fbc85bd
literal substitution tree testing code
joe-hauns Dec 21, 2023
6efc5de
fixed time profiling
joe-hauns Dec 21, 2023
851146d
fixed broken backtracking if uwa fixedpoint iteration is enabled
joe-hauns Dec 21, 2023
4f7f4b7
fixed endless loop in UWA fixedpoint iteration
joe-hauns Dec 21, 2023
f9553a7
documentation
joe-hauns Jan 8, 2024
7e3e30b
release fix
joe-hauns Jan 8, 2024
e6d2b9c
stack fixes
joe-hauns Jan 8, 2024
1d39386
documentation
joe-hauns Jan 8, 2024
e19199b
debug output
joe-hauns Jan 8, 2024
c58d5ba
Merge branch 'master' into joe-uwa-refactor
joe-hauns Jan 8, 2024
e75baf7
doc
joe-hauns Jan 11, 2024
77d2852
removed TermList::makeEmpty in favor of TermList::empty
joe-hauns Jan 11, 2024
c80f042
doc
joe-hauns Jan 15, 2024
7b445c9
fixed todo
joe-hauns Jan 15, 2024
647c4a3
fixed question answering in Bin Resolution
joe-hauns Jan 15, 2024
c2c4c46
fixed question answering in Superposition
joe-hauns Jan 15, 2024
a03ac81
added assertion
joe-hauns Jan 15, 2024
9ecb46d
fixed URR synthesis bug
joe-hauns Jan 15, 2024
aa56032
documentation
joe-hauns Jan 22, 2024
d3987b9
removed unnecessary constructor for substitutiontree
joe-hauns Jan 22, 2024
0c8c8c9
cleanup
joe-hauns Jan 22, 2024
e4fc8ff
typo
joe-hauns Jan 22, 2024
05f9068
tidy
joe-hauns Jan 22, 2024
0a8b866
Merge branch 'master' into joe-uwa-refactor
Feb 16, 2024
e84037b
without this deleted code?
Feb 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ cmake-build

# vim swap files
**/.*.swp
**/.*.swo
.ccls-cache
.cache/
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ set(VAMPIRE_KERNEL_SOURCES
Kernel/Problem.cpp
Kernel/Renaming.cpp
Kernel/RobSubstitution.cpp
Kernel/MismatchHandler.cpp
Kernel/UnificationWithAbstraction.cpp
Kernel/Signature.cpp
Kernel/SortHelper.cpp
Kernel/OperatorType.cpp
Expand Down Expand Up @@ -287,7 +287,7 @@ set(VAMPIRE_KERNEL_SOURCES
Kernel/RCClauseStack.hpp
Kernel/Renaming.hpp
Kernel/RobSubstitution.hpp
Kernel/MismatchHandler.hpp
Kernel/UnificationWithAbstraction.hpp
Kernel/Signature.hpp
Kernel/SortHelper.hpp
Kernel/OperatorType.hpp
Expand Down Expand Up @@ -639,8 +639,6 @@ set(VAMPIRE_SHELL_SOURCES
Shell/Token.hpp
Shell/TPTPPrinter.hpp
Shell/TweeGoalTransformation.hpp
Shell/UnificationWithAbstractionConfig.hpp
Shell/UnificationWithAbstractionConfig.cpp
Shell/UIHelper.hpp
Shell/VarManager.hpp
Shell/Lexer.hpp
Expand Down
4 changes: 2 additions & 2 deletions DP/SimpleCongruenceClosure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ vstring SimpleCongruenceClosure::CEq::toString(SimpleCongruenceClosure& parent)

void SimpleCongruenceClosure::ConstInfo::init() {
sigSymbol = NO_SIG_SYMBOL;
term.makeEmpty();
term = TermList::empty();
lit = 0;
namedPair = CPair(0,0);
reprConst = 0;
Expand Down Expand Up @@ -905,7 +905,7 @@ void SimpleCongruenceClosure::getModel(LiteralStack& model)

cInfo.processed = false;
cInfo.half_normalized = false;
cInfo.normalForm.makeEmpty();
cInfo.normalForm = TermList::empty();

if (cInfo.sigSymbol != NO_SIG_SYMBOL) { // either a symbol ...
// cout << " is sigsym ";
Expand Down
89 changes: 75 additions & 14 deletions Debug/Output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@
* @file Forwards.hpp
* Forward declarations of some classes
*/
#ifndef __Debug_Output__
#define __Debug_Output__
#ifndef __Debug_Output_HPP__
#define __Debug_Output_HPP__

#include <iostream>
#include <utility>
#include <tuple>

namespace Kernel {

template<class A, class B>
std::ostream& operator<<(std::ostream& out, std::pair<A,B> const& self)
{ return out << "(" << self.first << ", " << self.second << ")"; }
namespace Kernel {

/** Newtype in order to nicely output a pointer.
* Usage: `out << outputPtr(ptr) << std::endl;`
Expand All @@ -36,25 +34,88 @@ struct OutputPtr {
template<class T>
OutputPtr<T> outputPtr(T* self) { return { .self = self, }; }

template<class T>
void repeat(std::ostream& out, T const& c, int times)
{ for (int i = 0; i < times; i++) out << c; };


/** Newtype for outputting a datatype that implements it in multiline format.
* Usage: `out << multiline(substitutioTree) << std::endl;`
*
* You can implement this for a `MyType` by implementing
* std::ostream& operator<<(std::ostream&, OutputMultiline<MyType>)
*/
template<class T>
struct OutputMultiline { T const& self; };
struct OutputMultiline {
T const& self;
unsigned indent;

template<class T>
OutputMultiline<T> multiline(T const& self)
{ return { self }; }
static void outputIndent(std::ostream& out, unsigned indent)
{ repeat(out, " ", indent); };
};


template<class T>
void repeat(std::ostream& out, T const& c, int times)
{ for (int i = 0; i < times; i++) out << c; };
OutputMultiline<T> multiline(T const& self, unsigned indent = 0)
{ return { self, indent, }; }

static constexpr char const* INDENT = " ";
template<class Sep, class Iter>
struct OutputInterleaved {
Sep const& sep;
Iter iter;
};

template<class Sep, class Iter>
struct OutputInterleaved<Sep,Iter> outputInterleaved(Sep const& s, Iter i)
{ return OutputInterleaved<Sep, Iter>{s, std::move(i)}; }


template<class Iter>
auto commaSep(Iter i) { return outputInterleaved(", ", std::move(i)); }

template<unsigned i, unsigned sz, class Tup>
struct __OutputTuple
{
static void apply(std::ostream& out, Tup const& self)
{
out << std::get<i>(self) << ", ";
__OutputTuple<i + 1, sz, Tup>::apply(out, self);
}
};

template<unsigned i, class Tup>
struct __OutputTuple<i, i, Tup> {
static void apply(std::ostream& out, Tup const& self)
{
out << std::get<i>(self);
}
};

template<class... As>
std::ostream& operator<<(std::ostream& out, std::tuple<As...> const& self)
{
out << "(";
Kernel::__OutputTuple<0, std::tuple_size<std::tuple<As...>>::value - 1, std::tuple<As...>>::apply(out, self);
out << ")";
return out;
}

template<class Sep, class Iter>
std::ostream& operator<<(std::ostream& out, Kernel::OutputInterleaved<Sep, Iter> self)
{
if (self.iter.hasNext()) {
out << self.iter.next();
while (self.iter.hasNext()) {
out << self.sep << self.iter.next();
}
}
return out;
}

} // namespace Kernel
#endif // __Debug_Output__

template<class A, class B>
std::ostream& operator<<(std::ostream& out, std::pair<A,B> const& self)
{ return out << "(" << self.first << ", " << self.second << ")"; }

#endif // __Debug_Output_HPP__
32 changes: 3 additions & 29 deletions Debug/TimeProfiling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "Lib/Option.hpp"
#include "Kernel/Ordering.hpp"
#include "Debug/Assertion.hpp"
#include "Kernel/Term.hpp"
#include <chrono>
#include "Lib/MacroUtils.hpp"

Expand Down Expand Up @@ -74,6 +73,8 @@ namespace Shell {

#endif // VTIME_PROFILING

#if VTIME_PROFILING

/**
* A class to trace time for particular blocks. this class shall never be used directly,
* as it is preprocessed away when the flag VTIME_PROFILING is set to false.
Expand Down Expand Up @@ -187,34 +188,7 @@ class TimeTrace
bool _enabled;
};


template<class Ord>
class TimeTraceOrdering : public Kernel::Ordering
{
const char* _nameLit;
const char* _nameTerm;
Ord _ord;
public:
TimeTraceOrdering(const char* nameLit, const char* nameTerm, Ord ord)
: _nameLit(nameLit)
, _nameTerm(nameTerm)
, _ord(std::move(ord))
{ }

~TimeTraceOrdering() override { }

Result compare(Kernel::Literal* l1, Kernel::Literal* l2) const final override
{ TIME_TRACE(_nameLit); return _ord.compare(l1,l2); }

Result compare(Kernel::TermList l1, Kernel::TermList l2) const final override
{ TIME_TRACE(_nameTerm); return _ord.compare(l1,l2); }

void show(std::ostream& out) const final override
{ _ord.show(out); }

Ord & inner() { return _ord; }
Ord const& inner() const { return _ord; }
};
#endif // VTIME_PROFILING

} // namespace Shell

Expand Down
1 change: 1 addition & 0 deletions Debug/Tracer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <iostream>
#include <iomanip>
#include "Debug/Output.hpp"

namespace Debug {

Expand Down
2 changes: 1 addition & 1 deletion FMB/FiniteModelBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,7 @@ bool FiniteModelBuilder::HackyDSAE::increaseModelSizes(DArray<unsigned>& newSort

// test 2a -- generator constraints
{
Constraint_Generator_Heap::Iterator it(_constraints_generators);
auto it = _constraints_generators.iter();
while (it.hasNext()) {
if (checkConstriant(newSortSizes,it.next()->_vals)) {
goto next_candidate;
Expand Down
4 changes: 2 additions & 2 deletions FMB/FunctionRelationshipInference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void FunctionRelationshipInference::findFunctionRelationships(ClauseIterator cla

ClauseList* checkingClauses = getCheckingClauses();

ClauseIterator cit = pvi(getConcatenatedIterator(clauses,pvi(ClauseList::Iterator(checkingClauses))));
ClauseIterator cit = pvi(concatIters(clauses,ClauseList::Iterator(checkingClauses)));

Problem prb(cit,false);
Options opt; // default saturation algorithm options
Expand Down Expand Up @@ -348,7 +348,7 @@ Formula* FunctionRelationshipInference::getName(TermList fromSrt, TermList toSrt
else
_labelMap_nonstrict.insert(label,make_pair(fsT,tsT));

return new AtomicFormula(Literal::create(label,0,true,false,0));
return new AtomicFormula(Literal::create(label, /* polarity */ true, {}));
}

}
14 changes: 4 additions & 10 deletions FMB/Monotonicity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ Monotonicity::Monotonicity(ClauseList* clauses, unsigned srt) : _srt(srt)
ClauseIterator cit = pvi(ClauseList::Iterator(clauses));
while(cit.hasNext()){
Clause* c = cit.next();
Clause::Iterator lit(*c);
while(lit.hasNext()){
Literal* l = lit.next();
for (auto l : c->iterLits()) {
monotone(c,l);
}
}
Expand Down Expand Up @@ -115,9 +113,7 @@ void Monotonicity::safe(Clause* c, Literal* parent, TermList* t,Stack<SATLiteral
unsigned var = t->var();
TermList s = SortHelper::getVariableSort(*t,parent);
if(s.term()->functor()==_srt){
Clause::Iterator lit(*c);
while(lit.hasNext()){
Literal* l = lit.next();
for (auto l : c->iterLits()) {
if(guards(l,var,slits)){
// if guards returns true it means true will be added to the clause
// so don't bother creating it
Expand Down Expand Up @@ -261,7 +257,7 @@ void Monotonicity::addSortPredicates(bool withMon, ClauseList*& clauses, DArray<
if(!sortedVariables.isEmpty()){

Stack<Literal*> literals;
literals.loadFromIterator(Clause::Iterator(*cl));
literals.loadFromIterator(cl->iterLits());

Stack<std::pair<unsigned,unsigned>>::Iterator vit(sortedVariables);
while(vit.hasNext()){
Expand Down Expand Up @@ -356,10 +352,8 @@ void Monotonicity::addSortFunctions(bool withMon, ClauseList*& clauses)

Stack<Literal*> literals;

Clause::Iterator lit(*cl);
bool changed = false;
while(lit.hasNext()){
Literal* l = lit.next();
for (auto l : cl->iterLits()) {
Literal* lnew = l->arity() == 0 ? l : evaluateLiteralBottomUp(l, SortFunctionTransformer(isMonotonic,sortFunctions));
if(l!=lnew) {
changed=true;
Expand Down
9 changes: 0 additions & 9 deletions Forwards.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ struct EmptyStruct {};
typedef void (*VoidFunc)();

template<typename T> class VirtualIterator;
template<typename T, template<class> class ref_t> class ArrayishObjectIterator;

template<typename T> class ScopedPtr;
template<typename T> class SmartPtr;
Expand Down Expand Up @@ -59,8 +58,6 @@ using namespace Lib;
class Signature;

class Term;
typedef BiMap<unsigned, Term*> FuncSubtermMap;

class TermList;
typedef VirtualIterator<TermList> TermIterator;
typedef Stack<TermList> TermStack;
Expand All @@ -69,9 +66,6 @@ typedef List<unsigned> VList; // a list of variables (which are unsigned)
typedef List<TermList> SList; // a list of sorts (which are now, with polymorphism, TermLists)
typedef const SharedSet<unsigned> VarSet;

typedef std::pair<std::pair<TermList,unsigned>,std::pair<TermList,unsigned>> UnificationConstraint;
typedef Stack<UnificationConstraint> UnificationConstraintStack;
typedef Lib::SmartPtr<UnificationConstraintStack> UnificationConstraintStackSP;

class Literal;
typedef List<Literal*> LiteralList;
Expand Down Expand Up @@ -153,8 +147,6 @@ class TermSharing;
class ResultSubstitution;
typedef Lib::SmartPtr<ResultSubstitution> ResultSubstitutionSP;

struct SLQueryResult;
struct TermQueryResult;
};

namespace Saturation
Expand Down Expand Up @@ -197,5 +189,4 @@ class Options;
class Property;
class Statistics;
}

#endif /* __Forwards__ */
2 changes: 1 addition & 1 deletion Indexing/AcyclicityIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ namespace Indexing

void AcyclicityIndex::handleClause(Clause* c, bool adding)
{
ArrayishObjectIterator<Clause> it = c->getSelectedLiteralIterator();
auto it = c->getSelectedLiteralIterator();
while (it.hasNext()) {
if (adding) {
insert(it.next(), c);
Expand Down
1 change: 1 addition & 0 deletions Indexing/ClauseCodeTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class ClauseCodeTree : public CodeTree
{
void init(ClauseCodeTree* tree_, Clause* query_, bool sres_);
void reset();
bool keepRecycled() const { return lInfos.keepRecycled(); }
MichaelRawson marked this conversation as resolved.
Show resolved Hide resolved

Clause* next(int& resolvedQueryLit);

Expand Down
3 changes: 2 additions & 1 deletion Indexing/ClauseVariantIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "LiteralSubstitutionTree.hpp"

#include "ClauseVariantIndex.hpp"
#include "Indexing/IndexManager.hpp"

namespace Indexing
{
Expand Down Expand Up @@ -182,7 +183,7 @@ void SubstitutionTreeClauseVariantIndex::insert(Clause* cl)
}

if(!_strees[clen]) {
_strees[clen]=new LiteralSubstitutionTree();
_strees[clen] = new LiteralSubstitutionTree();
}
Literal* mainLit=getMainLiteral(cl->literals(), clen);
_strees[clen]->insert(mainLit, cl);
Expand Down
6 changes: 6 additions & 0 deletions Indexing/CodeTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@ class CodeTree
public:
bool next();

bool keepRecycled() const
{ return bindings.keepRecycled()
|| btStack.keepRecycled()
|| (firstsInBlocks && firstsInBlocks->keepRecycled()); }

protected:
void init(CodeOp* entry_, LitInfo* linfos_, size_t linfoCnt_,
CodeTree* tree_, Stack<CodeOp*>* firstsInBlocks_);
Expand Down Expand Up @@ -488,6 +493,7 @@ class CodeTree
public:
/** Variable bindings */
BindingArray bindings;
bool keepRecycled() const { return bindings.keepRecycled(); }

protected:
/** the matcher object is initialized but no execution of code was done yet */
Expand Down
Loading
Loading