Skip to content

Conversation

@ana-pantilie
Copy link
Contributor

@ana-pantilie ana-pantilie commented Jul 26, 2021

Fixes #2570

Completes all cases of Predicate.simplify.

I didn't add any tests for simplifyEquals because it only calls Equals.simplify, which we will need to modify for #2610.


Review checklist

The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.

  • Summary. Write a summary of the changes. Explain what you did to fix the issue, and why you did it. Present the changes in a logical order. Instead of writing a summary in the pull request, you may push a clean Git history.
  • Documentation. Write documentation for new functions. Update documentation for functions that changed, or complete documentation where it is missing.
  • Tests. Write unit tests for every change. Write the unit tests that were missing before the changes. Include any examples from the reported issue as integration tests.
  • Clean up. The changes are already clean. Clean up anything near the changes that you noticed while working. This does not mean only spatially near the changes, but logically near: any code that interacts with the changes!

@ana-pantilie ana-pantilie mentioned this pull request Jul 26, 2021
4 tasks
@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-add0.sh -0.019094 0.000000
test/regression-evm/test-sum-to-n.sh -0.011720 0.000000
test/regression-evm/test-branching-no-invalid.sh -0.019727 -0.000037
test/regression-evm/test-straight-line-no-invalid.sh -0.021987 0.000001
test/regression-evm/test-branching-invalid.sh -0.019488 0.000000
test/regression-evm/test-pop1.sh -0.022343 0
test/regression-evm/test-straight-line.sh -0.021746 0
test/regression-evm/test-sumTo10.sh -0.006909 -0.001035
test/regression-wasm/test-locals.sh -0.038651 0.000399
test/regression-wasm/test-simple-arithmetic.sh -0.042259 0.000728
test/regression-wasm/test-wrc20.sh -0.018818 0.003771
test/regression-wasm/test-loops.sh -0.050052 -0.000001
test/regression-wasm/test-memory.sh -0.037327 0.000055

@ana-pantilie ana-pantilie marked this pull request as ready for review July 28, 2021 10:18
@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-add0.sh -0.020708 0.113486
test/regression-evm/test-sum-to-n.sh -0.012601 0
test/regression-evm/test-branching-no-invalid.sh -0.021378 0
test/regression-evm/test-straight-line-no-invalid.sh -0.023464 0
test/regression-evm/test-branching-invalid.sh -0.021160 0
test/regression-evm/test-pop1.sh -0.023840 0
test/regression-evm/test-straight-line.sh -0.023264 0
test/regression-evm/test-sumTo10.sh -0.008209 -0.003771
test/regression-wasm/test-locals.sh -0.040330 -0.000003
test/regression-wasm/test-simple-arithmetic.sh -0.043972 0.000454
test/regression-wasm/test-wrc20.sh -0.020159 -0.002484
test/regression-wasm/test-loops.sh -0.051849 -0.000003
test/regression-wasm/test-memory.sh -0.038862 0.000111

@ana-pantilie ana-pantilie requested a review from JKTKops July 28, 2021 14:15
Copy link
Contributor

@JKTKops JKTKops left a comment

Choose a reason for hiding this comment

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

Couple of minor comments, but looks good to me.

_ -> simplifyPredicateTODO sideCondition predicate & MultiOr.observeAllT
where
_ :< predicateF = Recursive.project predicate
~avoid = freeVariableNames sideCondition
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't where bindings lazy by default? What is this ~ for?

This line wasn't changed, but asking anyway while we're here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have Strict on by default, maybe this changes the behavior? I don't know for certain, though.

simplifier NormalForm
simplifyEquals sideCondition sort equals =
Equals.simplify sideCondition equals'
>>= return . MultiOr.map (from @(Condition _))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why m >>= return . f instead of fmap f m?

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-pop1.sh -0.023846 0
test/regression-evm/test-straight-line.sh -0.023264 0
test/regression-evm/test-straight-line-no-invalid.sh -0.023464 0
test/regression-evm/test-branching-invalid.sh -0.021176 0
test/regression-evm/test-sum-to-n.sh -0.012604 0
test/regression-evm/test-branching-no-invalid.sh -0.021378 0
test/regression-evm/test-add0.sh -0.020762 0
test/regression-evm/test-sumTo10.sh -0.008209 0.001043
test/regression-wasm/test-memory.sh -0.038859 0.000111
test/regression-wasm/test-locals.sh -0.040330 -0.000002
test/regression-wasm/test-wrc20.sh -0.020150 -0.003738
test/regression-wasm/test-loops.sh -0.051833 -0.000003
test/regression-wasm/test-simple-arithmetic.sh -0.043976 0.000454

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-pop1.sh -0.023850 0.113157
test/regression-evm/test-straight-line.sh -0.023266 -0.005669
test/regression-evm/test-straight-line-no-invalid.sh -0.023472 0
test/regression-evm/test-branching-invalid.sh -0.021151 -0.000000
test/regression-evm/test-sum-to-n.sh -0.012607 0
test/regression-evm/test-branching-no-invalid.sh -0.021384 0
test/regression-evm/test-add0.sh -0.020756 0
test/regression-evm/test-sumTo10.sh -0.008211 0.001107
test/regression-wasm/test-memory.sh -0.038878 0.000141
test/regression-wasm/test-locals.sh -0.040350 0.000027
test/regression-wasm/test-wrc20.sh -0.020137 0.002064
test/regression-wasm/test-loops.sh -0.051873 0.000048
test/regression-wasm/test-simple-arithmetic.sh -0.043982 0.000454

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-pop1.sh -0.023838 0.000000
test/regression-evm/test-straight-line.sh -0.023266 0
test/regression-evm/test-straight-line-no-invalid.sh -0.023472 0
test/regression-evm/test-branching-invalid.sh -0.021200 0
test/regression-evm/test-sum-to-n.sh -0.012609 0
test/regression-evm/test-branching-no-invalid.sh -0.021384 0
test/regression-evm/test-add0.sh -0.020756 0
test/regression-evm/test-sumTo10.sh -0.008210 0.000932
test/regression-wasm/test-memory.sh -0.038868 0.000141
test/regression-wasm/test-locals.sh -0.040349 -0.000032
test/regression-wasm/test-wrc20.sh -0.020154 -0.004619
test/regression-wasm/test-loops.sh -0.051864 0.000048
test/regression-wasm/test-simple-arithmetic.sh -0.043986 0.000454

@ana-pantilie ana-pantilie merged commit 757e5e2 into master Jul 29, 2021
@ana-pantilie ana-pantilie deleted the overhaul-predicate-equals-2 branch July 29, 2021 10:41
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.

Overhaul predicate simplifier

3 participants