-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
…, move anti_unify to KDefinition
I think this problem can also be solved without creating a circular dependency by just calling |
@ehildenb That might work in some cases if a tight enough sort is able to be inferred based on the position of the new variable, but in general it doesn't (e.g. in this case it is appearing as the value of a Map, and |
Introducing circular imports like this feels like pretty bad coding practice, and I think we sholud avoid it when possible. It also is making this routine more complicated than it needs to be perhaps. I think we need to explore alternative solutions to this. One option may be to change where |
…ms a method of CTerm, improve test
…verification/pyk into noah/anti-unify-sort-fix
@ehildenb I looked at #544 and moved both the anti_unification functions into |
…hat no longer appear after abstraction during merge
…verification/pyk into noah/anti-unify-sort-fix
…bles while still keeping ones that will appear in the disjunction
I added the code from #544 that removes constraints from no longer used variables and integrated it with the system that produces the disjunction, so now those constraints on variables getting abstracted during the merge will no longer be removed, unless the option to include the disjunction is disabled. |
@nwatson22 it would be good to add some tests of the sort inference algorithm at this point. You can do it by adding tests of |
@ehildenb So, I've added tests for |
- Changed `anti_unify` and `anti_unify_with_constraints` to require a `KDefinition` which they use to grab the tightest sort for the terms they are abstracting - Since these actions are now associated with a specific K definition, moved them into `KDefinition` as methods. - Adds `KDefinition.least_common_supersort` which returns the most specific sort that will cover two terms (as long as one sort is a subsort of the other). - Uses this function in `KDefinition.sort` to determine the sort of a `KRewrite`. - Rewrote the tests for `anti_unify` and `anti_unify_with_constraints` to use `KDefinition` and test that the abstracted variables are now more tightly typed based on the original terms. This is an attempt to fix an issue in runtimeverification/evm-semantics#1934 where the looser sort bound is preventing simplification after the merging (anti-unification) of two nodes. --------- Co-authored-by: devops <[email protected]>
- Changed `anti_unify` and `anti_unify_with_constraints` to require a `KDefinition` which they use to grab the tightest sort for the terms they are abstracting - Since these actions are now associated with a specific K definition, moved them into `KDefinition` as methods. - Adds `KDefinition.least_common_supersort` which returns the most specific sort that will cover two terms (as long as one sort is a subsort of the other). - Uses this function in `KDefinition.sort` to determine the sort of a `KRewrite`. - Rewrote the tests for `anti_unify` and `anti_unify_with_constraints` to use `KDefinition` and test that the abstracted variables are now more tightly typed based on the original terms. This is an attempt to fix an issue in runtimeverification/evm-semantics#1934 where the looser sort bound is preventing simplification after the merging (anti-unification) of two nodes. --------- Co-authored-by: devops <[email protected]>
- Changed `anti_unify` and `anti_unify_with_constraints` to require a `KDefinition` which they use to grab the tightest sort for the terms they are abstracting - Since these actions are now associated with a specific K definition, moved them into `KDefinition` as methods. - Adds `KDefinition.least_common_supersort` which returns the most specific sort that will cover two terms (as long as one sort is a subsort of the other). - Uses this function in `KDefinition.sort` to determine the sort of a `KRewrite`. - Rewrote the tests for `anti_unify` and `anti_unify_with_constraints` to use `KDefinition` and test that the abstracted variables are now more tightly typed based on the original terms. This is an attempt to fix an issue in runtimeverification/evm-semantics#1934 where the looser sort bound is preventing simplification after the merging (anti-unification) of two nodes. --------- Co-authored-by: devops <[email protected]>
- Changed `anti_unify` and `anti_unify_with_constraints` to require a `KDefinition` which they use to grab the tightest sort for the terms they are abstracting - Since these actions are now associated with a specific K definition, moved them into `KDefinition` as methods. - Adds `KDefinition.least_common_supersort` which returns the most specific sort that will cover two terms (as long as one sort is a subsort of the other). - Uses this function in `KDefinition.sort` to determine the sort of a `KRewrite`. - Rewrote the tests for `anti_unify` and `anti_unify_with_constraints` to use `KDefinition` and test that the abstracted variables are now more tightly typed based on the original terms. This is an attempt to fix an issue in runtimeverification/evm-semantics#1934 where the looser sort bound is preventing simplification after the merging (anti-unification) of two nodes. --------- Co-authored-by: devops <[email protected]>
anti_unify
andanti_unify_with_constraints
to require aKDefinition
which they use to grab the tightest sort for the terms they are abstractingKDefinition
as methods.KDefinition.least_common_supersort
which returns the most specific sort that will cover two terms (as long as one sort is a subsort of the other).KDefinition.sort
to determine the sort of aKRewrite
.anti_unify
andanti_unify_with_constraints
to useKDefinition
and test that the abstracted variables are now more tightly typed based on the original terms.This is an attempt to fix an issue in runtimeverification/evm-semantics#1934 where the looser sort bound is preventing simplification after the merging (anti-unification) of two nodes.