Skip to content

Commit

Permalink
Assert equality between user constants that unify to the same variabl…
Browse files Browse the repository at this point in the history
…e in a match
  • Loading branch information
balasub committed May 30, 2024
1 parent d5b1460 commit e67da65
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Src/Core/Common/Rules/CoreRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,32 @@ private bool ApplyMatch(SymExecuter facts, Matcher m, Term t, int bindingLevel)
return false;
}

foreach (var item in partitions)
{
var curr = item.Value;
List<Term> terms = new List<Term>();
if (curr.Count > 2)
{
foreach (var term in curr)
{
if (term.Symbol is UserCnstSymb && term.Groundness == Groundness.Variable)
{
UserCnstSymb userCnstSymb = (UserCnstSymb)term.Symbol;
if (userCnstSymb.IsAutoGen && userCnstSymb.Name.StartsWith("pm@"))
{
terms.Add(term);
}
}
}

for (int i = 0; i < terms.Count - 1; i++)
{
facts.PendEqualityConstraint(terms[i], terms[i + 1]);
}
}

}

return true;
}

Expand Down

0 comments on commit e67da65

Please sign in to comment.