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

Fix match_with_constraint #4499

Merged
merged 13 commits into from
Oct 7, 2024
Merged

Fix match_with_constraint #4499

merged 13 commits into from
Oct 7, 2024

Conversation

tothtamas28
Copy link
Contributor

@tothtamas28 tothtamas28 commented Jul 4, 2024

Fixes #4496

@rv-jenkins rv-jenkins changed the base branch from master to develop July 4, 2024 09:10
Copy link
Contributor Author

@tothtamas28 tothtamas28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CTerm.constraint seems to have two different uses.

pyk/src/pyk/cterm/cterm.py Outdated Show resolved Hide resolved
pyk/src/pyk/cterm/cterm.py Outdated Show resolved Hide resolved
@Stevengre Stevengre force-pushed the fix-cterm-match branch 4 times, most recently from b7c5bff to d5bcbd2 Compare August 20, 2024 09:00
@Stevengre Stevengre force-pushed the fix-cterm-match branch 2 times, most recently from ec7162c to 4fa4e82 Compare September 20, 2024 01:52
@Stevengre
Copy link
Contributor

Since #4628 determines the apply in CSubst and provides a cterm_match that aligns with this apply, we can proceed to fix match_with_constraint using cterm_match.

@Stevengre
Copy link
Contributor

Downstream Validation:

Other Repos

No direct use.

CTerm.match

The following check carries some risk because match_with_constraint conducts a syntactic match and does not return an evaluated constraint. However, it is still an improvement over the original implementation, which always returns true when provided with a tighter cterm.

if csubst.constraint != mlTop(GENERATED_TOP_CELL):
return None

Cterm.anti_unify

Return a correct constraint.

KCFG.create_cover

Return a correct constraint.

KCFG.lift_split_edge

Need Refactor

KCFG.lift_split_split

Need Refactor

KCFG.merge_node

Need Simplify

@Stevengre Stevengre marked this pull request as ready for review September 23, 2024 01:20
not_none(a.cterm.match_with_constraint(cterm)).add_constraint(constraint)
for (cterm, constraint) in new_cterms_with_constraints
]
new_cterms_with_constraints = [csubst(a.cterm) for csubst in csubsts]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified by using create_split_by_nodes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename the variable to new_cterms then, instead of new_cterms_with_constraints.

Copy link
Member

@ehildenb ehildenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stevengre I'm approving, but please see my suggestion for renaming a variable that is now simpler (new_cterms_with_constraints => new_cterms perhaps?).

I think it's OK for now to wait for Petar to explain the need for that extra check, but let's leave it in for now. Once you have an example of where that check is hindering us from making progress, then it will be easier to add the appropriate test and weaken the check in a follow-up PR.

@rv-jenkins rv-jenkins merged commit 8bf17a3 into develop Oct 7, 2024
17 checks passed
@rv-jenkins rv-jenkins deleted the fix-cterm-match branch October 7, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CTerm.match_with_constraint does not return expected CSubst.constraints
5 participants