Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions Test/TestUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ Stack<TermList> collect(unsigned functor, Term* t) {
template<class Comparisons>
bool TestUtils::eqModAC_(TermList lhs, TermList rhs, Comparisons comp)
{
if (lhs == rhs) { return true; }
// NB: deliberately no `lhs == rhs` fast path. Two syntactically identical
// subterms still have to agree with the renaming `comp` is building up, so
// returning early here lets an inconsistent renaming through.
if (lhs.isVar() && rhs.isVar()) {
return comp.var(lhs.var(), rhs.var());
} else if (lhs.isTerm() && rhs.isTerm()) {
Expand Down Expand Up @@ -270,7 +272,7 @@ bool TestUtils::eqModACRect(Kernel::TermList lhs, Kernel::TermList rhs)
auto vl = iterTraits(vi(new VariableIterator(lhs))).collect<Stack>();
vl.sort();
vl.dedup();
auto vr = iterTraits(vi(new VariableIterator(lhs))).collect<Stack>();
auto vr = iterTraits(vi(new VariableIterator(rhs))).collect<Stack>();
vr.sort();
vr.dedup();

Expand Down
3 changes: 2 additions & 1 deletion UnitTests/tInferences_HOL_Injectivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ TEST_GENERATION(success_2,
.EXPECTED(exactly(clause({ ap(inv(), {z, ap(f, {x, z})}) == x })))
)

// f is injective in its second argument, so the inverse takes the first
TEST_GENERATION(success_3,
Generation::AsymmetricTest()
.input( clause({ y.sort(srt) == z, ap(f, {x, z}) != ap(f, {x, y}) }))
.EXPECTED(exactly(clause({ ap(inv(), {z, ap(f, {x, z})}) == x })))
.EXPECTED(exactly(clause({ ap(inv(), {x, ap(f, {x, z})}) == z })))
)