Skip to content

Commit

Permalink
Merge pull request #63 from VUISIS/fix_recursive_symbolic_constraints
Browse files Browse the repository at this point in the history
Assert equality between user constants that unify to the same variabl…
  • Loading branch information
balasub authored Sep 13, 2024
2 parents d9682fe + e67da65 commit 93b634d
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 93b634d

Please sign in to comment.