-
Notifications
You must be signed in to change notification settings - Fork 149
More list simps #1467
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
base: develop
Are you sure you want to change the base?
More list simps #1467
Conversation
This adds LENGTH_TAKE_EQ_MIN and makes DROP_TAKE_EQ_NIL simps. Rational for making LENGTH_TAKE_EQ_MIN simp is that before that rewriting DROP n (TAKE n ls) = [] would rewrite with DROP_EQ_NIL !ls n. DROP n ls = [] <=> LENGTH ls <= n to LENGTH (TAKE n ls) <= n With this simp rule it will rewrite to MIN n (LENGTH ls) <= n
List auto simplifications should be updated carefully because many user code depends on the current (imperfect) status. I don't like the following theorems becoming automatic, because 1) the RHS term didn't get smaller; 2) number subtractions and
|
I'm confused. These two theorems were already simp. |
I just updated the syntax from using export_rewrites. |
For this theorem I have realized that HOL4 is terrible with MIN and MAX. I plan to write a general conv simp procedure on lattices while this PR remains as a draft. |
Alright, it seems that
I was thinking that |
I like the look of the one that does |
There's no more issues on CI images. The remaining broken theories (currently only |
I'm planning such that the new breakages are fixed by a better simplification rule/ decision procedure for MAX and MIN. Or lattices in general #1434 . |
Add more simps about lists
This adds LENGTH_TAKE_EQ_MIN
and makes DROP_TAKE_EQ_NIL simps.
Rational for making LENGTH_TAKE_EQ_MIN simp is that
before that rewriting
DROP n (TAKE n ls) = []
would rewrite with DROP_EQ_NIL
!ls n. DROP n ls = [] <=> LENGTH ls <= n
to
LENGTH (TAKE n ls) <= n
With this simp rule it will rewrite to
MIN n (LENGTH ls) <= n