data.buffer.parser.basic
⟷
Mathlib.Data.Buffer.Parser.Basic
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -253,14 +253,14 @@ variable {f}
@[simp]
theorem bind_eq_done :
(p >>= f) cb n = done n' b ↔ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ f a cb np = done n' b :=
- by cases hp : p cb n <;> simp [hp, ← bind_eq_bind, Parser.bind, and_assoc']
+ by cases hp : p cb n <;> simp [hp, ← bind_eq_bind, Parser.bind, and_assoc]
#align parser.bind_eq_done Parser.bind_eq_done
@[simp]
theorem bind_eq_fail :
(p >>= f) cb n = fail n' err ↔
p cb n = fail n' err ∨ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ f a cb np = fail n' err :=
- by cases hp : p cb n <;> simp [hp, ← bind_eq_bind, Parser.bind, and_assoc']
+ by cases hp : p cb n <;> simp [hp, ← bind_eq_bind, Parser.bind, and_assoc]
#align parser.bind_eq_fail Parser.bind_eq_fail
@[simp]
@@ -286,7 +286,7 @@ variable {f : α → β}
@[simp]
theorem map_eq_done : (f <$> p) cb n = done n' b ↔ ∃ a : α, p cb n = done n' a ∧ f a = b := by
- cases hp : p cb n <;> simp [← LawfulMonad.bind_pure_comp, hp, and_assoc', pure_eq_done]
+ cases hp : p cb n <;> simp [← LawfulMonad.bind_pure_comp, hp, and_assoc, pure_eq_done]
#align parser.map_eq_done Parser.map_eq_done
@[simp]
@@ -805,7 +805,7 @@ theorem remaining_ne_fail : remaining cb n ≠ fail n' err := by simp [remaining
#align parser.remaining_ne_fail Parser.remaining_ne_fail
theorem eof_eq_done {u : Unit} : eof cb n = done n' u ↔ n = n' ∧ cb.size ≤ n := by
- simp [eof, guard_eq_done, remaining_eq_done, tsub_eq_zero_iff_le, and_comm', and_assoc']
+ simp [eof, guard_eq_done, remaining_eq_done, tsub_eq_zero_iff_le, and_comm, and_assoc]
#align parser.eof_eq_done Parser.eof_eq_done
@[simp]
@@ -836,7 +836,7 @@ theorem foldrCore_succ_eq_fail {f : α → β → β} {p : Parser α} {reps :
n ≠ n' ∧
(p cb n = fail n' err ∨
∃ (np : ℕ) (a : α), p cb n = done np a ∧ foldrCore f p b reps cb np = fail n' err) :=
- by simp [foldr_core, and_comm']
+ by simp [foldr_core, and_comm]
#align parser.foldr_core_succ_eq_fail Parser.foldrCore_succ_eq_fail
theorem foldr_eq_done {f : α → β → β} {p : Parser α} {b' : β} :
@@ -903,7 +903,7 @@ theorem foldlCore_succ_eq_fail {f : β → α → β} {p : Parser α} {reps :
(p cb n = fail n' err ∨
∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldlCore f (f b a) p reps cb np = fail n' err) :=
- by simp [foldl_core, and_comm']
+ by simp [foldl_core, and_comm]
#align parser.foldl_core_succ_eq_fail Parser.foldlCore_succ_eq_fail
theorem foldl_eq_done {f : β → α → β} {p : Parser α} {b' : β} :
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -2528,7 +2528,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
intro l
induction' l with hd tl hl
· simp
- · simp [hl, pow_succ, mul_comm]
+ · simp [hl, pow_succ', mul_comm]
-- We convert the hypothesis that `parser.nat` has succeeded into an existential that there is
-- some list of digits that it has parsed in, and that those digits, when folded over by the
-- function above, give the value at hand.
@@ -2980,7 +2980,7 @@ theorem nat_eq_done {val : ℕ} :
intro l
induction' l with hd tl hl
· simp
- · simp [hl, pow_succ, mul_comm]
+ · simp [hl, pow_succ', mul_comm]
-- We prove that the parsed list of digits `(lhd :: ltl) : list ℕ` must be of length `m`
-- which is used later when the `parser.nat` fold places `ltl.length` in the exponent.
have hml : ltl.length + 1 = m := by simpa using many1_length_of_done hdl
@@ -3001,7 +3001,7 @@ theorem nat_eq_done {val : ℕ} :
-- Any complicated expression about list lengths is further simplified by the auxiliary
-- lemmas we just proved. Finally, we assist the simplifier by rearranging terms with our
-- `n + m + 1 - n = m + 1` proof and `mul_comm`.
- simp [this, hpow, Nat.ofDigits_append, mul_comm, ← pow_succ 10, hml, ltll]
+ simp [this, hpow, Nat.ofDigits_append, mul_comm, ← pow_succ' 10, hml, ltll]
· -- Consider the case that `n' ≤ n + 1`. But then since `n < n' ≤ n + 1`, `n' = n + 1`.
obtain rfl : n' = n + 1 := le_antisymm hn'' (Nat.succ_le_of_lt hn)
-- This means we have only parsed in a single character, so the resulting parsed in list
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -543,7 +543,7 @@ instance orelse [p.mono] [q.mono] : (p <|> q).mono :=
· obtain h | ⟨h, -, -⟩ := orelse_eq_done.mp hx <;> simpa [h] using of_done h
· by_cases h : n = posx
· simp [hx, h]
- · simp only [orelse_eq_fail_of_mono_ne h] at hx
+ · simp only [orelse_eq_fail_of_mono_ne h] at hx
exact of_fail hx
#align parser.mono.orelse Parser.Mono.orelse
@@ -758,11 +758,11 @@ theorem charBuf_eq_done {cb' : CharBuffer} :
· rintro ⟨h, rfl⟩
by_cases hn : n < cb.size
· have : n < cb.to_list.length := by simpa using hn
- rw [← List.cons_nthLe_drop_succ this, List.cons_prefix_iff] at h
+ rw [← List.cons_nthLe_drop_succ this, List.cons_prefix_iff] at h
use n + 1, h.right
simpa [Buffer.nthLe_toList, add_comm, add_left_comm, add_assoc, hn] using h.left.symm
· have : cb.to_list.length ≤ n := by simpa using hn
- rw [List.drop_eq_nil_of_le this] at h
+ rw [List.drop_eq_nil_of_le this] at h
simpa using h
#align parser.char_buf_eq_done Parser.charBuf_eq_done
@@ -1006,7 +1006,7 @@ theorem many'_eq_done {p : Parser α} :
· exact Or.inl hl
· have hl2 := hl
simp only [foldr_core_eq_done, or_false_iff, exists_and_left, and_false_iff, false_and_iff,
- exists_eq_right_right] at hl
+ exists_eq_right_right] at hl
obtain ⟨np, hp, h⟩ := hl
refine' Or.inr ⟨np, _, _, hl2, hp, h⟩
· rintro (h | ⟨np, a, l, hp, h⟩)
@@ -1220,7 +1220,7 @@ theorem charBuf_iff {cb' : CharBuffer} : Static (charBuf cb') ↔ cb' = Buffer.n
cases' hc : cb'.size with n
· simp only [eq_self_iff_true, iff_true_iff]
exact ⟨fun _ _ _ _ h => by simpa [hc] using (char_buf_eq_done.mp h).left⟩
- · rw [hc] at this
+ · rw [hc] at this
simpa [Nat.succ_ne_zero] using not_of_ne this (Nat.succ_ne_zero n).symm
#align parser.static.char_buf_iff Parser.Static.charBuf_iff
@@ -1347,7 +1347,7 @@ theorem nat : ¬nat.Static :=
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.Static → (F p).Static) :
Static (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ;
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h;
exact static.of_done h⟩
#align parser.static.fix Parser.Static.fix
@@ -1441,7 +1441,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).Bounded ↔ p.Bo
constructor
intro _ _ hn
obtain ⟨_, _, h⟩ := bounded.exists (@Parser.decorateErrors α msgs p) hn
- simp [decorate_errors_eq_fail] at h
+ simp [decorate_errors_eq_fail] at h
exact h.right.right
· intro
constructor
@@ -1497,7 +1497,7 @@ theorem str_iff {s : String} : (str s).Bounded ↔ s ≠ "" :=
by
rw [str, decorate_error_iff]
cases hs : s.to_list
- · have : s = "" := by cases s; rw [String.toList] at hs ; simpa [hs]
+ · have : s = "" := by cases s; rw [String.toList] at hs; simpa [hs]
simp [pure, this]
· have : s ≠ "" := by intro H; simpa [H] using hs
simp only [this, iff_true_iff, Ne.def, not_false_iff]
@@ -1956,7 +1956,7 @@ instance nat : nat.ErrStatic :=
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.ErrStatic → (F p).ErrStatic) :
ErrStatic (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ;
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h;
exact err_static.of_fail h⟩
#align parser.err_static.fix Parser.ErrStatic.fix
@@ -2057,7 +2057,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).step ↔ p.step
· intro
constructor
intro _ _ _ _ h
- rw [decorate_errors_eq_done] at h
+ rw [decorate_errors_eq_done] at h
exact of_done h
#align parser.step.decorate_errors_iff Parser.Step.decorateErrors_iff
@@ -2149,7 +2149,7 @@ instance digit : digit.step :=
#align parser.step.digit Parser.Step.digit
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.step → (F p).step) : Step (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ; exact of_done h⟩
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h; exact of_done h⟩
#align parser.step.fix Parser.Step.fix
end Step
@@ -2181,8 +2181,8 @@ theorem many1_eq_done_iff_many_eq_done [p.step] [p.Bounded] {x : α} {xs : List
simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
cases' tl with hd' tl'
· simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
- · rw [← @IH hd' tl'] at hm ; swap; rfl
- simp only [many1_eq_done, many, foldr] at hm
+ · rw [← @IH hd' tl'] at hm; swap; rfl
+ simp only [many1_eq_done, many, foldr] at hm
obtain ⟨np, hp', hf⟩ := hm
obtain rfl : np = n + 1 + 1 := step.of_done hp'
simpa [Nat.sub_succ, many_eq_done, hp, hk, foldr_core_eq_done, hp'] using hf
@@ -2201,10 +2201,10 @@ theorem many1_eq_done_iff_many_eq_done [p.step] [p.Bounded] {x : α} {xs : List
· simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
· simp [hp]
rw [← @IH hd' tl' (n + 1) n']; swap; rfl
- rw [hk, foldr_core_eq_done, or_comm] at hm
+ rw [hk, foldr_core_eq_done, or_comm] at hm
obtain hm | ⟨np, hd', tl', hp', hf, hm⟩ := hm
· simpa using hm
- simp only at hm
+ simp only at hm
obtain ⟨rfl, rfl⟩ := hm
obtain rfl : np = n + 1 + 1 := step.of_done hp'
simp [Nat.sub_succ, many, many1_eq_done, hp, hk, foldr_core_eq_done, hp', ← hf, foldr]
@@ -2292,7 +2292,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).Prog ↔ p.Prog
· intro
constructor
intro _ _ _ _ h
- rw [decorate_errors_eq_done] at h
+ rw [decorate_errors_eq_done] at h
exact of_done h
#align parser.prog.decorate_errors_iff Parser.Prog.decorateErrors_iff
@@ -2387,7 +2387,7 @@ instance nat : nat.Prog :=
#align parser.prog.nat Parser.Prog.nat
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.Prog → (F p).Prog) : Prog (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ; exact of_done h⟩
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h; exact of_done h⟩
#align parser.prog.fix Parser.Prog.fix
end Prog
@@ -2405,14 +2405,14 @@ theorem many_sublist_of_done [p.step] [p.Bounded] {l : List α} (h : p.anyM cb n
∀ k < n' - n, p.anyM cb (n + k) = done n' (l.drop k) :=
by
induction' l with hd tl hl generalizing n
- · rw [many_eq_done_nil] at h
+ · rw [many_eq_done_nil] at h
simp [h.left]
intro m hm
cases m
· exact h
rw [List.drop, Nat.add_succ, ← Nat.succ_add]
apply hl
- · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
+ · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
obtain ⟨_, hp, h⟩ := h
convert h
exact (step.of_done hp).symm
@@ -2424,9 +2424,9 @@ theorem many_eq_nil_of_done [p.step] [p.Bounded] {l : List α} (h : p.anyM cb n
by
induction' l with hd tl hl generalizing n
· convert h
- rw [many_eq_done_nil] at h
+ rw [many_eq_done_nil] at h
exact h.left.symm
- · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
+ · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
obtain ⟨_, -, h⟩ := h
exact hl h
#align parser.many_eq_nil_of_done Parser.many_eq_nil_of_done
@@ -2434,9 +2434,9 @@ theorem many_eq_nil_of_done [p.step] [p.Bounded] {l : List α} (h : p.anyM cb n
theorem many_eq_nil_of_out_of_bound [p.Bounded] {l : List α} (h : p.anyM cb n = done n' l)
(hn : cb.size < n) : n' = n ∧ l = [] := by
cases l
- · rw [many_eq_done_nil] at h
+ · rw [many_eq_done_nil] at h
exact ⟨h.left.symm, rfl⟩
- · rw [many_eq_done] at h
+ · rw [many_eq_done] at h
obtain ⟨np, hp, -⟩ := h
exact absurd (bounded.of_done hp) hn.not_lt
#align parser.many_eq_nil_of_out_of_bound Parser.many_eq_nil_of_out_of_bound
@@ -2448,14 +2448,14 @@ theorem many1_length_of_done [p.mono] [p.step] [p.Bounded] {l : List α}
· simpa using h
· obtain ⟨k, hk⟩ : ∃ k, n' = n + k + 1 := Nat.exists_eq_add_of_lt (prog.of_done h)
subst hk
- simp only [many1_eq_done] at h
+ simp only [many1_eq_done] at h
obtain ⟨_, hp, h⟩ := h
obtain rfl := step.of_done hp
cases tl
- · simp only [many_eq_done_nil, add_left_inj, exists_and_right, self_eq_add_right] at h
+ · simp only [many_eq_done_nil, add_left_inj, exists_and_right, self_eq_add_right] at h
rcases h with ⟨rfl, -⟩
simp
- rw [← many1_eq_done_iff_many_eq_done] at h
+ rw [← many1_eq_done_iff_many_eq_done] at h
specialize hl h
simp [hl, add_comm, add_assoc, Nat.sub_succ]
#align parser.many1_length_of_done Parser.many1_length_of_done
@@ -2464,13 +2464,13 @@ theorem many1_bounded_of_done [p.step] [p.Bounded] {l : List α} (h : many1 p cb
n' ≤ cb.size := by
induction' l with hd tl hl generalizing n n'
· simpa using h
- · simp only [many1_eq_done] at h
+ · simp only [many1_eq_done] at h
obtain ⟨np, hp, h⟩ := h
obtain rfl := step.of_done hp
cases tl
- · simp only [many_eq_done_nil, exists_and_right] at h
+ · simp only [many_eq_done_nil, exists_and_right] at h
simpa [← h.left] using bounded.of_done hp
- · rw [← many1_eq_done_iff_many_eq_done] at h
+ · rw [← many1_eq_done_iff_many_eq_done] at h
exact hl h
#align parser.many1_bounded_of_done Parser.many1_bounded_of_done
@@ -2532,7 +2532,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- We convert the hypothesis that `parser.nat` has succeeded into an existential that there is
-- some list of digits that it has parsed in, and that those digits, when folded over by the
-- function above, give the value at hand.
- simp only [Nat, pure_eq_done, natm, decorate_error_eq_done, bind_eq_done] at h
+ simp only [Nat, pure_eq_done, natm, decorate_error_eq_done, bind_eq_done] at h
obtain ⟨n', l, hp, rfl, rfl⟩ := h
-- We now want to stop working with the `cb : char_buffer` and parse positions `n` and `n'`,
-- and just deal with the parsed digit list `l : list ℕ`. To do so, we have to show that
@@ -2558,7 +2558,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- character at position `n`, which we now call `chd : char`.
have chdh : chd.to_nat - '0'.toNat = lhd :=
by
- simp only [many1_eq_done] at hp
+ simp only [many1_eq_done] at hp
-- We know that `parser.digit` succeeded, so it has moved to a possibly different position.
-- In fact, we know that this new position is `n + 1`, by the `step` property of
-- `parser.digit`.
@@ -2569,15 +2569,15 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- that the `n`th character of `cb`, let's say `c`, when converted to a `ℕ` via
-- `char.to_nat c - '0'.to_nat`, must be equal to the resulting value, `lhd` in our case.
simp only [digit_eq_done, Buffer.read_eq_nthLe_toList, hx, Buffer.length_toList, true_and_iff,
- add_left_inj, List.length, List.nthLe, eq_self_iff_true, exists_and_left, Fin.val_mk] at hp
+ add_left_inj, List.length, List.nthLe, eq_self_iff_true, exists_and_left, Fin.val_mk] at hp
rcases hp with ⟨_, hn, rfl, _, _⟩
-- But we already know the list corresponding to `cb : char_buffer` from position `n` and on
-- is equal to `(chd :: ctl) : list char`, so our `c` above must satisfy `c = chd`.
have hn' : n < cb.to_list.length := by simpa using hn
- rw [← List.cons_nthLe_drop_succ hn'] at hx
+ rw [← List.cons_nthLe_drop_succ hn'] at hx
-- We can ignore proving any correspondence of `ctl : list char` to the other portions of the
-- `cb : char_buffer`.
- simp only at hx
+ simp only at hx
simp [hx]
-- We know that we parsed in more than one character because of the `prog` property of
-- `parser.digit`, which the `many1` parser combinator retains. In other words, we know that
@@ -2591,7 +2591,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
by
cases ltl
· simp
- · rw [many1_eq_done] at hp
+ · rw [many1_eq_done] at hp
obtain ⟨_, hp, hp'⟩ := hp
simpa [step.of_done hp, many1_eq_done_iff_many_eq_done] using hp'
-- Now we case on the two possibilities, that there was only a single digit parsed in, and
@@ -2604,7 +2604,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- in reverse.
rcases hdm with (rfl | hdm)
· -- Case that `ltl = []`.
- simp only [many1_eq_done, many_eq_done_nil, exists_and_right] at hp
+ simp only [many1_eq_done, many_eq_done_nil, exists_and_right] at hp
-- This means we must have failed parsing with `parser.digit` at some other position,
-- which we prove must be `n + 1` via the `step` property.
obtain ⟨_, hp, rfl, hp'⟩ := hp
@@ -2654,7 +2654,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- parsing in at position `n` using a `bounded` parser, so we must have that
-- `n < cb.size`.
have := bounded.of_done hp
- rw [hc] at this
+ rw [hc] at this
-- But then `n < 0`, a contradiction.
exact absurd n.zero_le this.not_le
· simp
@@ -2694,7 +2694,7 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
-- the resulting value given by `parser.nat`, and focus solely on the `list ℕ` generated by
-- `parser.digit.many1`.
simp only [Nat, pure_eq_done, and_left_comm, decorate_error_eq_done, bind_eq_done, exists_eq_left,
- exists_and_left] at h
+ exists_and_left] at h
obtain ⟨xs, h, -⟩ := h
-- We want to avoid having to make statements about the `cb : char_buffer` itself. Instead, we
-- induct on the `xs : list ℕ` that `parser.digit.many1` produced.
@@ -2707,14 +2707,14 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
-- induction hypothesis on the remaining `tl`.
-- We break apart a `many1` success into a success of the underlying `parser.digit` to give `hd`
-- and a `parser.digit.many` which gives `tl`. We first deal with the `hd`.
- rw [many1_eq_done] at h
+ rw [many1_eq_done] at h
-- Right away, we can throw away the information about the "new" position that `parser.digit`
-- ended on because we will soon prove that it must have been `n + 1`.
obtain ⟨_, hp, h⟩ := h
-- The main lemma here is `digit_eq_done`, which already proves the necessary conditions about
-- the character at hand. What is left to do is properly unpack the information.
simp only [digit_eq_done, and_comm, and_left_comm, digit_eq_fail, true_and_iff, exists_eq_left,
- eq_self_iff_true, exists_and_left, exists_and_left] at hp
+ eq_self_iff_true, exists_and_left, exists_and_left] at hp
obtain ⟨rfl, -, hn, ge0, le9, rfl⟩ := hp
-- Let's now consider a position `k` between `n` and `n'`, excluding `n'`.
intro hn k hk hk'
@@ -2730,7 +2730,7 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
-- position `k` was not "numeric" or we are out of bounds. More importantly, when `many`
-- successfully produces a `[]`, it does not progress the parser head, so we have that
-- `n + 1 = n'`. This will lead to a contradiction because now we have `n < k` and `k < n + 1`.
- simp only [many_eq_done_nil, exists_and_right] at h
+ simp only [many_eq_done_nil, exists_and_right] at h
-- Extract out just the `n + 1 = n'`.
obtain ⟨rfl, -⟩ := h
-- Form the contradictory hypothesis, and discharge the goal.
@@ -2739,7 +2739,7 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
· -- Case where `tl ≠ []`. But that means that `many` produced a nonempty list as a result, so
-- `many1` would have successfully parsed at this position too. We use this statement to
-- rewrite our hypothesis into something that works with the induction hypothesis, and apply it.
- rw [← many1_eq_done_iff_many_eq_done] at h
+ rw [← many1_eq_done_iff_many_eq_done] at h
apply hl h
-- All that is left to prove is that our `k` is at least our new "lower bound" `n + 1`, which
-- we have from our original split of the `n ≤ k`, since we are now on the `n < k` case.
@@ -2766,7 +2766,7 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
-- `∀ (hn : n' < cb.size)`. Thus we only have to prove the lemma for the cases where `n'` is still
-- "in-bounds".
simp only [Nat, pure_eq_done, and_left_comm, decorate_error_eq_done, bind_eq_done, exists_eq_left,
- exists_and_left] at h
+ exists_and_left] at h
obtain ⟨xs, h, -⟩ := h
-- We want to avoid having to make statements about the `cb : char_buffer` itself. Instead, we
-- induct on the `xs : list ℕ` that `parser.digit.many1` produced.
@@ -2783,14 +2783,14 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
· -- Case where `tl = []`, so we parsed in only `hd`. That must mean that `parser.digit` failed
-- at `n + 1`.
simp only [many1_eq_done, many_eq_done_nil, and_left_comm, exists_and_right, exists_eq_left] at
- h
+ h
-- We throw away the success information of what happened at position `n`, and we do not need
-- the "error" value that the failure produced.
obtain ⟨-, _, h⟩ := h
-- If `parser.digit` failed at `n + 1`, then either we hit a non-numeric character, or
-- we are out of bounds. `digit_eq_fail` provides us with those two cases.
simp only [digit_eq_done, and_comm, and_left_comm, digit_eq_fail, true_and_iff, exists_eq_left,
- eq_self_iff_true, exists_and_left] at h
+ eq_self_iff_true, exists_and_left] at h
obtain ⟨rfl, h⟩ | ⟨h, -⟩ := h
· -- First case: we are still in bounds, but the character is not numeric. We must prove
-- that we are still in bounds. But we know that from our initial requirement.
@@ -2805,9 +2805,9 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
· -- Case where `tl ≠ []`. But that means that `many` produced a nonempty list as a result, so
-- `many1` would have successfully parsed at this position too. We use this statement to
-- rewrite our hypothesis into something that works with the induction hypothesis, and apply it.
- rw [many1_eq_done] at h
+ rw [many1_eq_done] at h
obtain ⟨_, -, h⟩ := h
- rw [← many1_eq_done_iff_many_eq_done] at h
+ rw [← many1_eq_done_iff_many_eq_done] at h
exact hl h
#align parser.nat_of_done_bounded Parser.nat_of_done_bounded
@@ -2853,9 +2853,9 @@ theorem nat_eq_done {val : ℕ} :
-- We clone the success hypothesis `h` so that we can supply it back later.
have H := h
-- We unwrap the `parser.nat` success down to the `many1` success, throwing away other info.
- rw [Nat] at h
+ rw [Nat] at h
simp only [decorate_error_eq_done, bind_eq_done, pure_eq_done, and_left_comm, exists_eq_left,
- exists_and_left] at h
+ exists_and_left] at h
obtain ⟨_, h, -⟩ := h
-- Now we get our existential witness that `n' ≤ cb.size`.
replace h := many1_bounded_of_done h
@@ -2891,7 +2891,7 @@ theorem nat_eq_done {val : ℕ} :
induction' H : cb.to_list.drop n with hd tl IH generalizing n
· -- Base case: there are no characters at position `n` or onwards, which means that
-- `cb.size ≤ n`. But this is a contradiction, since we have `n < n' ≤ cb.size`.
- rw [List.drop_eq_nil_iff_le] at H
+ rw [List.drop_eq_nil_iff_le] at H
refine' absurd ((lt_of_le_of_lt H hn).trans_le hn') _
simp
· -- Inductive case: we prove that if we could have parsed from `n + 1`, we could have also parsed
@@ -2904,7 +2904,7 @@ theorem nat_eq_done {val : ℕ} :
-- list.drop (n + 1), which fits out induction hypothesis conditions better. To use the
-- rearranging lemma, we must prove that we are "dropping" in bounds, which we supply on-the-fly
simp only [←
- List.cons_nthLe_drop_succ (show n < cb.to_list.length by simpa using hn.trans_le hn')] at H
+ List.cons_nthLe_drop_succ (show n < cb.to_list.length by simpa using hn.trans_le hn')] at H
-- We prove that parsing our `n`th character, `hd`, would have resulted in a success from
-- `parser.digit`, with the appropriate `ℕ` success value. We use this later to simplify the
-- unwrapped fold, since `hd` is our head character.
@@ -2951,7 +2951,7 @@ theorem nat_eq_done {val : ℕ} :
simpa using hdl
-- Case `l = lhd :: ltl`. We can rewrite the fold of the function inside `parser.nat` on
-- `lhd :: ltl`, which will be used to rewrite in the goal.
- simp only [natm, List.foldr] at hvl
+ simp only [natm, List.foldr] at hvl
-- We also expand the fold in the goal, using the expanded fold from our hypothesis, powered
-- by `many1_eq_done` to proceed in the parsing. We know exactly what the next `many` will
-- produce from `many1_eq_done_iff_many_eq_done.mp` of our `hdl` hypothesis. Finally,
mathlib commit https://github.com/leanprover-community/mathlib/commit/b1abe23ae96fef89ad30d9f4362c307f72a55010
@@ -1193,7 +1193,7 @@ theorem sat_iff {p : Char → Prop} [DecidablePred p] : Static (sat p) ↔ ∀ c
exact zero_ne_one (of_done this)
· contrapose!
simp only [Iff, sat_eq_done, and_imp, exists_prop, exists_and_right, exists_and_left,
- exists_imp, not_forall]
+ exists_imp, Classical.not_forall]
rintro _ _ _ a h hne rfl hp -
exact ⟨a, hp⟩
#align parser.static.sat_iff Parser.Static.sat_iff
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,10 +3,10 @@ Copyright (c) 2020 Yakov Pechersky. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
-/
-import Mathbin.Data.String.Basic
-import Mathbin.Data.Buffer.Basic
-import Mathbin.Data.Nat.Digits
-import Leanbin.Data.Buffer.Parser
+import Data.String.Basic
+import Data.Buffer.Basic
+import Data.Nat.Digits
+import Data.Buffer.Parser
#align_import data.buffer.parser.basic from "leanprover-community/mathlib"@"2fe465deb81bcd7ccafa065bb686888a82f15372"
@@ -2811,7 +2811,7 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
exact hl h
#align parser.nat_of_done_bounded Parser.nat_of_done_bounded
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:567:6: unsupported: specialize @hyp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:570:6: unsupported: specialize @hyp -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/-- The `val : ℕ` produced by a successful parse of a `cb : char_buffer` is the numerical value
represented by the string of decimal digits (possibly padded with 0s on the left)
mathlib commit https://github.com/leanprover-community/mathlib/commit/63721b2c3eba6c325ecf8ae8cca27155a4f6306f
@@ -2944,7 +2944,7 @@ theorem nat_eq_done {val : ℕ} :
obtain ⟨l, hdl, hvl⟩ := IH
-- Of course, the parsed in list from position `n` would be `l` prepended with the result
-- of parsing in `hd`, which is provided explicitly.
- use (hd.to_nat - '0'.toNat)::l
+ use(hd.to_nat - '0'.toNat)::l
-- We case on `l : list ℕ` so that we can make statements about the fold on `l`
cases' l with lhd ltl
·-- As before, if `l = []` then `many1` produced a `[]` success, which is a contradiction.
@@ -3006,7 +3006,7 @@ theorem nat_eq_done {val : ℕ} :
obtain rfl : n' = n + 1 := le_antisymm hn'' (Nat.succ_le_of_lt hn)
-- This means we have only parsed in a single character, so the resulting parsed in list
-- is explicitly formed from an expression we can construct from `hd`.
- use [hd.to_nat - '0'.toNat]
+ use[hd.to_nat - '0'.toNat]
-- Our list expression simplifies nicely because it is a fold over a singleton, so we
-- do not have to supply any auxiliary lemmas for it, other than what we already know about
-- `hd` and the function defined in `parser.nat`. However, we will have to prove that our
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,17 +2,14 @@
Copyright (c) 2020 Yakov Pechersky. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
-
-! This file was ported from Lean 3 source module data.buffer.parser.basic
-! leanprover-community/mathlib commit 2fe465deb81bcd7ccafa065bb686888a82f15372
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.String.Basic
import Mathbin.Data.Buffer.Basic
import Mathbin.Data.Nat.Digits
import Leanbin.Data.Buffer.Parser
+#align_import data.buffer.parser.basic from "leanprover-community/mathlib"@"2fe465deb81bcd7ccafa065bb686888a82f15372"
+
/-!
# Parsers
mathlib commit https://github.com/leanprover-community/mathlib/commit/2fe465deb81bcd7ccafa065bb686888a82f15372
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
! This file was ported from Lean 3 source module data.buffer.parser.basic
-! leanprover-community/mathlib commit bb9d1c5085e0b7ea619806a68c5021927cecb2a6
+! leanprover-community/mathlib commit 2fe465deb81bcd7ccafa065bb686888a82f15372
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -16,6 +16,9 @@ import Leanbin.Data.Buffer.Parser
/-!
# Parsers
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
`parser α` is the type that describes a computation that can ingest a `char_buffer`
and output, if successful, a term of type `α`.
This file expands on the definitions in the core library, proving that all the core library
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -785,7 +785,7 @@ theorem oneOf'_eq_done {cs : List Char} :
theorem str_eq_charBuf (s : String) : str s = charBuf s.toList.toBuffer :=
by
- ext (cb n)
+ ext cb n
rw [str, char_buf]
congr
· simp [Buffer.toString, String.asString_inv_toList]
mathlib commit https://github.com/leanprover-community/mathlib/commit/2a0ce625dbb0ffbc7d1316597de0b25c1ec75303
@@ -52,7 +52,7 @@ section DefnLemmas
variable {α β : Type} (msgs : Thunk (List String)) (msg : Thunk String)
-variable (p q : Parser α) (cb : CharBuffer) (n n' : ℕ) {err : Dlist String}
+variable (p q : Parser α) (cb : CharBuffer) (n n' : ℕ) {err : Std.DList String}
variable {a : α} {b : β}
@@ -78,7 +78,7 @@ class Static : Prop where
/-- A `parser α` is defined to be `err_static` if it does not move on error.
-/
class ErrStatic : Prop where
- of_fail : ∀ {cb : CharBuffer} {n n' : ℕ} {err : Dlist String}, p cb n = fail n' err → n = n'
+ of_fail : ∀ {cb : CharBuffer} {n n' : ℕ} {err : Std.DList String}, p cb n = fail n' err → n = n'
#align parser.err_static Parser.ErrStatic
/-- A `parser α` is defined to be `step` if it always moves exactly one char forward on success.
@@ -98,11 +98,12 @@ class Prog : Prop where
-/
class Bounded : Prop where
ex' :
- ∀ {cb : CharBuffer} {n : ℕ}, cb.size ≤ n → ∃ (n' : ℕ) (err : Dlist String), p cb n = fail n' err
+ ∀ {cb : CharBuffer} {n : ℕ},
+ cb.size ≤ n → ∃ (n' : ℕ) (err : Std.DList String), p cb n = fail n' err
#align parser.bounded Parser.Bounded
theorem Bounded.exists (p : Parser α) [p.Bounded] {cb : CharBuffer} {n : ℕ} (h : cb.size ≤ n) :
- ∃ (n' : ℕ) (err : Dlist String), p cb n = fail n' err :=
+ ∃ (n' : ℕ) (err : Std.DList String), p cb n = fail n' err :=
Bounded.ex' h
#align parser.bounded.exists Parser.Bounded.exists
@@ -121,7 +122,7 @@ class ConditionallyUnfailing : Prop where
theorem fail_iff :
(∀ pos' result, p cb n ≠ done pos' result) ↔
- ∃ (pos' : ℕ) (err : Dlist String), p cb n = fail pos' err :=
+ ∃ (pos' : ℕ) (err : Std.DList String), p cb n = fail pos' err :=
by cases p cb n <;> simp
#align parser.fail_iff Parser.fail_iff
@@ -395,15 +396,15 @@ theorem failure_eq_failure : @Parser.failure α = failure :=
#align parser.failure_eq_failure Parser.failure_eq_failure
@[simp]
-theorem failure_def : (failure : Parser α) cb n = fail n Dlist.empty :=
+theorem failure_def : (failure : Parser α) cb n = fail n Std.DList.empty :=
rfl
#align parser.failure_def Parser.failure_def
theorem not_failure_eq_done : ¬(failure : Parser α) cb n = done n' a := by simp
#align parser.not_failure_eq_done Parser.not_failure_eq_done
-theorem failure_eq_fail : (failure : Parser α) cb n = fail n' err ↔ n = n' ∧ err = Dlist.empty := by
- simp [eq_comm]
+theorem failure_eq_fail :
+ (failure : Parser α) cb n = fail n' err ↔ n = n' ∧ err = Std.DList.empty := by simp [eq_comm]
#align parser.failure_eq_fail Parser.failure_eq_fail
theorem seq_eq_done {f : Parser (α → β)} {p : Parser α} :
@@ -466,7 +467,7 @@ theorem guard_eq_done {p : Prop} [Decidable p] {u : Unit} :
#align parser.guard_eq_done Parser.guard_eq_done
theorem guard_eq_fail {p : Prop} [Decidable p] :
- @guard Parser _ p _ cb n = fail n' err ↔ ¬p ∧ n = n' ∧ err = Dlist.empty := by
+ @guard Parser _ p _ cb n = fail n' err ↔ ¬p ∧ n = n' ∧ err = Std.DList.empty := by
by_cases hp : p <;> simp [guard, hp, eq_comm, pure_eq_done]
#align parser.guard_eq_fail Parser.guard_eq_fail
@@ -695,7 +696,7 @@ end DefnLemmas
section Done
variable {α β : Type} {cb : CharBuffer} {n n' : ℕ} {a a' : α} {b : β} {c : Char} {u : Unit}
- {err : Dlist String}
+ {err : Std.DList String}
theorem anyChar_eq_done :
anyChar cb n = done n' c ↔ ∃ hn : n < cb.size, n' = n + 1 ∧ cb.read ⟨n, hn⟩ = c :=
@@ -704,7 +705,8 @@ theorem anyChar_eq_done :
split_ifs with h <;> simp [h, eq_comm]
#align parser.any_char_eq_done Parser.anyChar_eq_done
-theorem anyChar_eq_fail : anyChar cb n = fail n' err ↔ n = n' ∧ err = Dlist.empty ∧ cb.size ≤ n :=
+theorem anyChar_eq_fail :
+ anyChar cb n = fail n' err ↔ n = n' ∧ err = Std.DList.empty ∧ cb.size ≤ n :=
by
simp_rw [any_char]
split_ifs with h <;> simp [← not_lt, h, eq_comm]
@@ -727,7 +729,7 @@ theorem sat_eq_done {p : Char → Prop} [DecidablePred p] :
theorem sat_eq_fail {p : Char → Prop} [DecidablePred p] :
sat p cb n = fail n' err ↔
- n = n' ∧ err = Dlist.empty ∧ ∀ h : n < cb.size, ¬p (cb.read ⟨n, h⟩) :=
+ n = n' ∧ err = Std.DList.empty ∧ ∀ h : n < cb.size, ¬p (cb.read ⟨n, h⟩) :=
by
dsimp only [sat]
split_ifs <;> simp [*, eq_comm]
@@ -824,12 +826,12 @@ theorem foldrCore_eq_done {f : α → β → β} {p : Parser α} {reps : ℕ} {b
#align parser.foldr_core_eq_done Parser.foldrCore_eq_done
@[simp]
-theorem foldrCore_zero_eq_fail {f : α → β → β} {p : Parser α} {err : Dlist String} :
- foldrCore f p b 0 cb n = fail n' err ↔ n = n' ∧ err = Dlist.empty := by
+theorem foldrCore_zero_eq_fail {f : α → β → β} {p : Parser α} {err : Std.DList String} :
+ foldrCore f p b 0 cb n = fail n' err ↔ n = n' ∧ err = Std.DList.empty := by
simp [foldr_core, eq_comm]
#align parser.foldr_core_zero_eq_fail Parser.foldrCore_zero_eq_fail
-theorem foldrCore_succ_eq_fail {f : α → β → β} {p : Parser α} {reps : ℕ} {err : Dlist String} :
+theorem foldrCore_succ_eq_fail {f : α → β → β} {p : Parser α} {reps : ℕ} {err : Std.DList String} :
foldrCore f p b (reps + 1) cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
@@ -850,10 +852,10 @@ theorem foldr_eq_done {f : α → β → β} {p : Parser α} {b' : β} :
by simp [foldr, foldr_core_eq_done]
#align parser.foldr_eq_done Parser.foldr_eq_done
-theorem foldr_eq_fail_iff_mono_at_end {f : α → β → β} {p : Parser α} {err : Dlist String} [p.mono]
- (hc : cb.size ≤ n) :
+theorem foldr_eq_fail_iff_mono_at_end {f : α → β → β} {p : Parser α} {err : Std.DList String}
+ [p.mono] (hc : cb.size ≤ n) :
foldr f p b cb n = fail n' err ↔
- n < n' ∧ (p cb n = fail n' err ∨ ∃ a : α, p cb n = done n' a ∧ err = Dlist.empty) :=
+ n < n' ∧ (p cb n = fail n' err ∨ ∃ a : α, p cb n = done n' a ∧ err = Std.DList.empty) :=
by
have : cb.size - n = 0 := tsub_eq_zero_iff_le.mpr hc
simp only [foldr, foldr_core_succ_eq_fail, this, and_left_comm, foldr_core_zero_eq_fail,
@@ -863,7 +865,7 @@ theorem foldr_eq_fail_iff_mono_at_end {f : α → β → β} {p : Parser α} {er
· exact mono.of_done h
#align parser.foldr_eq_fail_iff_mono_at_end Parser.foldr_eq_fail_iff_mono_at_end
-theorem foldr_eq_fail {f : α → β → β} {p : Parser α} {err : Dlist String} :
+theorem foldr_eq_fail {f : α → β → β} {p : Parser α} {err : Std.DList String} :
foldr f p b cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
@@ -890,12 +892,12 @@ theorem foldlCore_eq_done {f : β → α → β} {p : Parser α} {reps : ℕ} {b
#align parser.foldl_core_eq_done Parser.foldlCore_eq_done
@[simp]
-theorem foldlCore_zero_eq_fail {f : β → α → β} {p : Parser α} {err : Dlist String} :
- foldlCore f b p 0 cb n = fail n' err ↔ n = n' ∧ err = Dlist.empty := by
+theorem foldlCore_zero_eq_fail {f : β → α → β} {p : Parser α} {err : Std.DList String} :
+ foldlCore f b p 0 cb n = fail n' err ↔ n = n' ∧ err = Std.DList.empty := by
simp [foldl_core, eq_comm]
#align parser.foldl_core_zero_eq_fail Parser.foldlCore_zero_eq_fail
-theorem foldlCore_succ_eq_fail {f : β → α → β} {p : Parser α} {reps : ℕ} {err : Dlist String} :
+theorem foldlCore_succ_eq_fail {f : β → α → β} {p : Parser α} {reps : ℕ} {err : Std.DList String} :
foldlCore f b p (reps + 1) cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
@@ -917,7 +919,7 @@ theorem foldl_eq_done {f : β → α → β} {p : Parser α} {b' : β} :
by simp [foldl, foldl_core_eq_done]
#align parser.foldl_eq_done Parser.foldl_eq_done
-theorem foldl_eq_fail {f : β → α → β} {p : Parser α} {err : Dlist String} :
+theorem foldl_eq_fail {f : β → α → β} {p : Parser α} {err : Std.DList String} :
foldl f b p cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
@@ -926,10 +928,10 @@ theorem foldl_eq_fail {f : β → α → β} {p : Parser α} {err : Dlist String
by simp [foldl, foldl_core_succ_eq_fail]
#align parser.foldl_eq_fail Parser.foldl_eq_fail
-theorem foldl_eq_fail_iff_mono_at_end {f : β → α → β} {p : Parser α} {err : Dlist String} [p.mono]
- (hc : cb.size ≤ n) :
+theorem foldl_eq_fail_iff_mono_at_end {f : β → α → β} {p : Parser α} {err : Std.DList String}
+ [p.mono] (hc : cb.size ≤ n) :
foldl f b p cb n = fail n' err ↔
- n < n' ∧ (p cb n = fail n' err ∨ ∃ a : α, p cb n = done n' a ∧ err = Dlist.empty) :=
+ n < n' ∧ (p cb n = fail n' err ∨ ∃ a : α, p cb n = done n' a ∧ err = Std.DList.empty) :=
by
have : cb.size - n = 0 := tsub_eq_zero_iff_le.mpr hc
simp only [foldl, foldl_core_succ_eq_fail, this, and_left_comm, ne_iff_lt_iff_le, exists_eq_left,
@@ -956,7 +958,7 @@ theorem many_eq_done {p : Parser α} {x : α} {xs : List α} :
by simp [many, foldr_eq_done, and_comm, and_assoc, and_left_comm]
#align parser.many_eq_done Parser.many_eq_done
-theorem many_eq_fail {p : Parser α} {err : Dlist String} :
+theorem many_eq_fail {p : Parser α} {err : Std.DList String} :
many p cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
@@ -1022,7 +1024,7 @@ theorem many1_eq_done {p : Parser α} {l : List α} :
simp [many1, seq_eq_done, map_eq_done]
#align parser.many1_eq_done Parser.many1_eq_done
-theorem many1_eq_fail {p : Parser α} {err : Dlist String} :
+theorem many1_eq_fail {p : Parser α} {err : Std.DList String} :
many1 p cb n = fail n' err ↔
p cb n = fail n' err ∨ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ many p cb np = fail n' err :=
by simp [many1, seq_eq_fail]
@@ -1094,7 +1096,7 @@ theorem digit_eq_done {k : ℕ} :
theorem digit_eq_fail :
digit cb n = fail n' err ↔
n = n' ∧
- err = Dlist.ofList ["<digit>"] ∧
+ err = Std.DList.ofList ["<digit>"] ∧
∀ h : n < cb.size, ¬(fun c => '0' ≤ c ∧ c ≤ '9') (cb.read ⟨n, h⟩) :=
by simp [digit, sat_eq_fail]
#align parser.digit_eq_fail Parser.digit_eq_fail
@@ -1104,7 +1106,7 @@ end Done
namespace Static
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
- {cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
+ {cb : CharBuffer} {n' n : ℕ} {err : Std.DList String} {a : α} {b : β} {sep : Parser Unit}
theorem not_of_ne (h : p cb n = done n' a) (hne : n ≠ n') : ¬Static p := by intro;
exact hne (of_done h)
@@ -1355,7 +1357,7 @@ namespace Bounded
variable {α β : Type} {msgs : Thunk (List String)} {msg : Thunk String}
-variable {p q : Parser α} {cb : CharBuffer} {n n' : ℕ} {err : Dlist String}
+variable {p q : Parser α} {cb : CharBuffer} {n n' : ℕ} {err : Std.DList String}
variable {a : α} {b : β}
@@ -1618,7 +1620,7 @@ end Bounded
namespace Unfailing
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
- {cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
+ {cb : CharBuffer} {n' n : ℕ} {err : Std.DList String} {a : α} {b : β} {sep : Parser Unit}
theorem of_bounded [p.Bounded] : ¬Unfailing p :=
by
@@ -1677,7 +1679,7 @@ instance mapM' {l : List α} {f : α → Parser β} [∀ a, (f a).Unfailing] : (
theorem failure : ¬@Parser.Unfailing α failure :=
by
intro h
- have : (failure : Parser α) Buffer.nil 0 = fail 0 Dlist.empty := by simp
+ have : (failure : Parser α) Buffer.nil 0 = fail 0 Std.DList.empty := by simp
exact of_fail this
#align parser.unfailing.failure Parser.Unfailing.failure
@@ -1764,7 +1766,7 @@ end Unfailing
namespace ErrStatic
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
- {cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
+ {cb : CharBuffer} {n' n : ℕ} {err : Std.DList String} {a : α} {b : β} {sep : Parser Unit}
theorem not_of_ne (h : p cb n = fail n' err) (hne : n ≠ n') : ¬ErrStatic p := by intro;
exact hne (of_fail h)
@@ -1963,7 +1965,7 @@ end ErrStatic
namespace Step
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
- {cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
+ {cb : CharBuffer} {n' n : ℕ} {err : Std.DList String} {a : α} {b : β} {sep : Parser Unit}
theorem not_step_of_static_done [Static p] (h : ∃ cb n n' a, p cb n = done n' a) : ¬Step p :=
by
@@ -2155,7 +2157,7 @@ end Step
section Step
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
- {cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
+ {cb : CharBuffer} {n' n : ℕ} {err : Std.DList String} {a : α} {b : β} {sep : Parser Unit}
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -2213,7 +2215,7 @@ end Step
namespace Prog
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
- {cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
+ {cb : CharBuffer} {n' n : ℕ} {err : Std.DList String} {a : α} {b : β} {sep : Parser Unit}
-- see Note [lower instance priority]
instance (priority := 100) of_step [Step p] : Prog p :=
@@ -2392,7 +2394,7 @@ end Prog
variable {α β : Type} {msgs : Thunk (List String)} {msg : Thunk String}
-variable {p q : Parser α} {cb : CharBuffer} {n n' : ℕ} {err : Dlist String}
+variable {p q : Parser α} {cb : CharBuffer} {n n' : ℕ} {err : Std.DList String}
variable {a : α} {b : β}
mathlib commit https://github.com/leanprover-community/mathlib/commit/8efcf8022aac8e01df8d302dcebdbc25d6a886c8
@@ -285,7 +285,7 @@ variable {f : α → β}
@[simp]
theorem map_eq_done : (f <$> p) cb n = done n' b ↔ ∃ a : α, p cb n = done n' a ∧ f a = b := by
- cases hp : p cb n <;> simp [← LawfulMonad.bind_pure_comp_eq_map, hp, and_assoc', pure_eq_done]
+ cases hp : p cb n <;> simp [← LawfulMonad.bind_pure_comp, hp, and_assoc', pure_eq_done]
#align parser.map_eq_done Parser.map_eq_done
@[simp]
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -1526,8 +1526,6 @@ instance foldlCore_zero {f : β → α → β} {b : β} : (foldlCore f b p 0).Bo
variable {reps : ℕ} [hpb : p.Bounded] (he : ∀ cb n n' err, p cb n = fail n' err → n ≠ n')
-include hpb he
-
theorem foldrCore {f : α → β → β} : (foldrCore f p b reps).Bounded :=
by
cases reps
@@ -1570,15 +1568,11 @@ theorem many : p.anyM.Bounded :=
foldr he
#align parser.bounded.many Parser.Bounded.many
-omit hpb
-
theorem manyChar {pc : Parser Char} [pc.Bounded]
(he : ∀ cb n n' err, pc cb n = fail n' err → n ≠ n') : pc.manyChar.Bounded := by
convert bounded.map; exact many he
#align parser.bounded.many_char Parser.Bounded.manyChar
-include hpb
-
theorem many' : p.many'.Bounded := by convert bounded.and_then; exact many he
#align parser.bounded.many' Parser.Bounded.many'
mathlib commit https://github.com/leanprover-community/mathlib/commit/7e5137f579de09a059a5ce98f364a04e221aabf0
@@ -2815,7 +2815,7 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
exact hl h
#align parser.nat_of_done_bounded Parser.nat_of_done_bounded
-/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:564:6: unsupported: specialize @hyp -/
+/- ./././Mathport/Syntax/Translate/Tactic/Lean3.lean:567:6: unsupported: specialize @hyp -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/-- The `val : ℕ` produced by a successful parse of a `cb : char_buffer` is the numerical value
represented by the string of decimal digits (possibly padded with 0s on the left)
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -98,36 +98,36 @@ class Prog : Prop where
-/
class Bounded : Prop where
ex' :
- ∀ {cb : CharBuffer} {n : ℕ}, cb.size ≤ n → ∃ (n' : ℕ)(err : Dlist String), p cb n = fail n' err
+ ∀ {cb : CharBuffer} {n : ℕ}, cb.size ≤ n → ∃ (n' : ℕ) (err : Dlist String), p cb n = fail n' err
#align parser.bounded Parser.Bounded
theorem Bounded.exists (p : Parser α) [p.Bounded] {cb : CharBuffer} {n : ℕ} (h : cb.size ≤ n) :
- ∃ (n' : ℕ)(err : Dlist String), p cb n = fail n' err :=
+ ∃ (n' : ℕ) (err : Dlist String), p cb n = fail n' err :=
Bounded.ex' h
#align parser.bounded.exists Parser.Bounded.exists
/-- A `parser a` is defined to be `unfailing` if it always produces a `done` `parse_result`.
-/
class Unfailing : Prop where
- ex' : ∀ (cb : CharBuffer) (n : ℕ), ∃ (n' : ℕ)(a : α), p cb n = done n' a
+ ex' : ∀ (cb : CharBuffer) (n : ℕ), ∃ (n' : ℕ) (a : α), p cb n = done n' a
#align parser.unfailing Parser.Unfailing
/-- A `parser a` is defined to be `conditionally_unfailing` if it produces a
`done` `parse_result` as long as it is parsing within the provided `char_buffer`.
-/
class ConditionallyUnfailing : Prop where
- ex' : ∀ {cb : CharBuffer} {n : ℕ}, n < cb.size → ∃ (n' : ℕ)(a : α), p cb n = done n' a
+ ex' : ∀ {cb : CharBuffer} {n : ℕ}, n < cb.size → ∃ (n' : ℕ) (a : α), p cb n = done n' a
#align parser.conditionally_unfailing Parser.ConditionallyUnfailing
theorem fail_iff :
(∀ pos' result, p cb n ≠ done pos' result) ↔
- ∃ (pos' : ℕ)(err : Dlist String), p cb n = fail pos' err :=
+ ∃ (pos' : ℕ) (err : Dlist String), p cb n = fail pos' err :=
by cases p cb n <;> simp
#align parser.fail_iff Parser.fail_iff
theorem success_iff :
- (∀ pos' err, p cb n ≠ fail pos' err) ↔ ∃ (pos' : ℕ)(result : α), p cb n = done pos' result := by
- cases p cb n <;> simp
+ (∀ pos' err, p cb n ≠ fail pos' err) ↔ ∃ (pos' : ℕ) (result : α), p cb n = done pos' result :=
+ by cases p cb n <;> simp
#align parser.success_iff Parser.success_iff
variable {p q cb n n' msgs msg}
@@ -155,7 +155,7 @@ theorem Static.iff :
#align parser.static.iff Parser.Static.iff
theorem exists_done (p : Parser α) [p.Unfailing] (cb : CharBuffer) (n : ℕ) :
- ∃ (n' : ℕ)(a : α), p cb n = done n' a :=
+ ∃ (n' : ℕ) (a : α), p cb n = done n' a :=
Unfailing.ex' cb n
#align parser.exists_done Parser.exists_done
@@ -172,7 +172,7 @@ instance (priority := 100) conditionallyUnfailing_of_unfailing [p.Unfailing] :
#align parser.conditionally_unfailing_of_unfailing Parser.conditionallyUnfailing_of_unfailing
theorem exists_done_in_bounds (p : Parser α) [p.ConditionallyUnfailing] {cb : CharBuffer} {n : ℕ}
- (h : n < cb.size) : ∃ (n' : ℕ)(a : α), p cb n = done n' a :=
+ (h : n < cb.size) : ∃ (n' : ℕ) (a : α), p cb n = done n' a :=
ConditionallyUnfailing.ex' h
#align parser.exists_done_in_bounds Parser.exists_done_in_bounds
@@ -251,14 +251,14 @@ variable {f}
@[simp]
theorem bind_eq_done :
- (p >>= f) cb n = done n' b ↔ ∃ (np : ℕ)(a : α), p cb n = done np a ∧ f a cb np = done n' b := by
- cases hp : p cb n <;> simp [hp, ← bind_eq_bind, Parser.bind, and_assoc']
+ (p >>= f) cb n = done n' b ↔ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ f a cb np = done n' b :=
+ by cases hp : p cb n <;> simp [hp, ← bind_eq_bind, Parser.bind, and_assoc']
#align parser.bind_eq_done Parser.bind_eq_done
@[simp]
theorem bind_eq_fail :
(p >>= f) cb n = fail n' err ↔
- p cb n = fail n' err ∨ ∃ (np : ℕ)(a : α), p cb n = done np a ∧ f a cb np = fail n' err :=
+ p cb n = fail n' err ∨ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ f a cb np = fail n' err :=
by cases hp : p cb n <;> simp [hp, ← bind_eq_bind, Parser.bind, and_assoc']
#align parser.bind_eq_fail Parser.bind_eq_fail
@@ -332,8 +332,8 @@ theorem orelse_eq_done :
·
rcases lt_trichotomy nq n with (H | rfl | H) <;>
first
- |simp [hp, hn, hq, H, not_lt_of_lt H, lt_irrefl, ← orelse_eq_orelse,
- Parser.orelse]|simp [hp, hn, hq, lt_irrefl, ← orelse_eq_orelse, Parser.orelse]
+ | simp [hp, hn, hq, H, not_lt_of_lt H, lt_irrefl, ← orelse_eq_orelse, Parser.orelse]
+ | simp [hp, hn, hq, lt_irrefl, ← orelse_eq_orelse, Parser.orelse]
· simp [hp, hn, ← orelse_eq_orelse, Parser.orelse]
#align parser.orelse_eq_done Parser.orelse_eq_done
@@ -351,8 +351,10 @@ theorem orelse_eq_fail_eq :
·
rcases lt_trichotomy nq n with (H | rfl | H) <;>
first
- |simp [hp, hq, hn, ← orelse_eq_orelse, Parser.orelse, H, ne_of_gt H, ne_of_lt H,
- not_lt_of_lt H]|simp [hp, hq, hn, ← orelse_eq_orelse, Parser.orelse, lt_irrefl]
+ |
+ simp [hp, hq, hn, ← orelse_eq_orelse, Parser.orelse, H, ne_of_gt H, ne_of_lt H,
+ not_lt_of_lt H]
+ | simp [hp, hq, hn, ← orelse_eq_orelse, Parser.orelse, lt_irrefl]
· simp [hp, hn, ← orelse_eq_orelse, Parser.orelse]
#align parser.orelse_eq_fail_eq Parser.orelse_eq_fail_eq
@@ -406,40 +408,40 @@ theorem failure_eq_fail : (failure : Parser α) cb n = fail n' err ↔ n = n'
theorem seq_eq_done {f : Parser (α → β)} {p : Parser α} :
(f <*> p) cb n = done n' b ↔
- ∃ (nf : ℕ)(f' : α → β)(a : α), f cb n = done nf f' ∧ p cb nf = done n' a ∧ f' a = b :=
+ ∃ (nf : ℕ) (f' : α → β) (a : α), f cb n = done nf f' ∧ p cb nf = done n' a ∧ f' a = b :=
by simp [seq_eq_bind_map]
#align parser.seq_eq_done Parser.seq_eq_done
theorem seq_eq_fail {f : Parser (α → β)} {p : Parser α} :
(f <*> p) cb n = fail n' err ↔
- f cb n = fail n' err ∨ ∃ (nf : ℕ)(f' : α → β), f cb n = done nf f' ∧ p cb nf = fail n' err :=
+ f cb n = fail n' err ∨ ∃ (nf : ℕ) (f' : α → β), f cb n = done nf f' ∧ p cb nf = fail n' err :=
by simp [seq_eq_bind_map]
#align parser.seq_eq_fail Parser.seq_eq_fail
theorem seqLeft_eq_done {p : Parser α} {q : Parser β} :
- (p <* q) cb n = done n' a ↔ ∃ (np : ℕ)(b : β), p cb n = done np a ∧ q cb np = done n' b :=
+ (p <* q) cb n = done n' a ↔ ∃ (np : ℕ) (b : β), p cb n = done np a ∧ q cb np = done n' b :=
by
have :
∀ p q : ℕ → α → Prop,
- (∃ (np : ℕ)(x : α), p np x ∧ q np x ∧ x = a) ↔ ∃ np : ℕ, p np a ∧ q np a :=
+ (∃ (np : ℕ) (x : α), p np x ∧ q np x ∧ x = a) ↔ ∃ np : ℕ, p np a ∧ q np a :=
fun _ _ => ⟨fun ⟨np, x, hp, hq, rfl⟩ => ⟨np, hp, hq⟩, fun ⟨np, hp, hq⟩ => ⟨np, a, hp, hq, rfl⟩⟩
simp [seq_left_eq, seq_eq_done, map_eq_done, this]
#align parser.seq_left_eq_done Parser.seqLeft_eq_done
theorem seqLeft_eq_fail {p : Parser α} {q : Parser β} :
(p <* q) cb n = fail n' err ↔
- p cb n = fail n' err ∨ ∃ (np : ℕ)(a : α), p cb n = done np a ∧ q cb np = fail n' err :=
+ p cb n = fail n' err ∨ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ q cb np = fail n' err :=
by simp [seq_left_eq, seq_eq_fail]
#align parser.seq_left_eq_fail Parser.seqLeft_eq_fail
theorem seqRight_eq_done {p : Parser α} {q : Parser β} :
- (p *> q) cb n = done n' b ↔ ∃ (np : ℕ)(a : α), p cb n = done np a ∧ q cb np = done n' b := by
+ (p *> q) cb n = done n' b ↔ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ q cb np = done n' b := by
simp [seq_right_eq, seq_eq_done, map_eq_done, and_comm, and_assoc]
#align parser.seq_right_eq_done Parser.seqRight_eq_done
theorem seqRight_eq_fail {p : Parser α} {q : Parser β} :
(p *> q) cb n = fail n' err ↔
- p cb n = fail n' err ∨ ∃ (np : ℕ)(a : α), p cb n = done np a ∧ q cb np = fail n' err :=
+ p cb n = fail n' err ∨ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ q cb np = fail n' err :=
by simp [seq_right_eq, seq_eq_fail]
#align parser.seq_right_eq_fail Parser.seqRight_eq_fail
@@ -454,7 +456,7 @@ theorem mapM_eq_done {f : α → Parser β} {a : α} {l : List α} {b : β} {l'
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem mapM'_eq_done {f : α → Parser β} {a : α} {l : List α} :
(a::l).mapM' f cb n = done n' () ↔
- ∃ (np : ℕ)(b : β), f a cb n = done np b ∧ l.mapM' f cb np = done n' () :=
+ ∃ (np : ℕ) (b : β), f a cb n = done np b ∧ l.mapM' f cb np = done n' () :=
by simp [mmap']
#align parser.mmap'_eq_done Parser.mapM'_eq_done
@@ -540,7 +542,7 @@ instance orelse [p.mono] [q.mono] : (p <|> q).mono :=
· obtain h | ⟨h, -, -⟩ := orelse_eq_done.mp hx <;> simpa [h] using of_done h
· by_cases h : n = posx
· simp [hx, h]
- · simp only [orelse_eq_fail_of_mono_ne h] at hx
+ · simp only [orelse_eq_fail_of_mono_ne h] at hx
exact of_fail hx
#align parser.mono.orelse Parser.Mono.orelse
@@ -754,11 +756,11 @@ theorem charBuf_eq_done {cb' : CharBuffer} :
· rintro ⟨h, rfl⟩
by_cases hn : n < cb.size
· have : n < cb.to_list.length := by simpa using hn
- rw [← List.cons_nthLe_drop_succ this, List.cons_prefix_iff] at h
+ rw [← List.cons_nthLe_drop_succ this, List.cons_prefix_iff] at h
use n + 1, h.right
simpa [Buffer.nthLe_toList, add_comm, add_left_comm, add_assoc, hn] using h.left.symm
· have : cb.to_list.length ≤ n := by simpa using hn
- rw [List.drop_eq_nil_of_le this] at h
+ rw [List.drop_eq_nil_of_le this] at h
simpa using h
#align parser.char_buf_eq_done Parser.charBuf_eq_done
@@ -811,13 +813,13 @@ theorem foldrCore_zero_eq_done {f : α → β → β} {p : Parser α} {b' : β}
theorem foldrCore_eq_done {f : α → β → β} {p : Parser α} {reps : ℕ} {b' : β} :
foldrCore f p b (reps + 1) cb n = done n' b' ↔
- (∃ (np : ℕ)(a : α)(xs : β),
+ (∃ (np : ℕ) (a : α) (xs : β),
p cb n = done np a ∧ foldrCore f p b reps cb np = done n' xs ∧ f a xs = b') ∨
n = n' ∧
b = b' ∧
∃ err,
p cb n = fail n err ∨
- ∃ (np : ℕ)(a : α), p cb n = done np a ∧ foldrCore f p b reps cb np = fail n err :=
+ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ foldrCore f p b reps cb np = fail n err :=
by simp [foldr_core, and_comm, and_assoc, pure_eq_done]
#align parser.foldr_core_eq_done Parser.foldrCore_eq_done
@@ -831,19 +833,19 @@ theorem foldrCore_succ_eq_fail {f : α → β → β} {p : Parser α} {reps :
foldrCore f p b (reps + 1) cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
- ∃ (np : ℕ)(a : α), p cb n = done np a ∧ foldrCore f p b reps cb np = fail n' err) :=
+ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ foldrCore f p b reps cb np = fail n' err) :=
by simp [foldr_core, and_comm']
#align parser.foldr_core_succ_eq_fail Parser.foldrCore_succ_eq_fail
theorem foldr_eq_done {f : α → β → β} {p : Parser α} {b' : β} :
foldr f p b cb n = done n' b' ↔
- (∃ (np : ℕ)(a : α)(x : β),
+ (∃ (np : ℕ) (a : α) (x : β),
p cb n = done np a ∧ foldrCore f p b (cb.size - n) cb np = done n' x ∧ f a x = b') ∨
n = n' ∧
b = b' ∧
∃ err,
p cb n = ParseResult.fail n err ∨
- ∃ (np : ℕ)(x : α),
+ ∃ (np : ℕ) (x : α),
p cb n = done np x ∧ foldrCore f p b (cb.size - n) cb np = fail n err :=
by simp [foldr, foldr_core_eq_done]
#align parser.foldr_eq_done Parser.foldr_eq_done
@@ -865,7 +867,7 @@ theorem foldr_eq_fail {f : α → β → β} {p : Parser α} {err : Dlist String
foldr f p b cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
- ∃ (np : ℕ)(a : α),
+ ∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldrCore f p b (cb.size - n) cb np = fail n' err) :=
by simp [foldr, foldr_core_succ_eq_fail]
#align parser.foldr_eq_fail Parser.foldr_eq_fail
@@ -877,12 +879,12 @@ theorem foldlCore_zero_eq_done {f : β → α → β} {p : Parser α} {b' : β}
theorem foldlCore_eq_done {f : β → α → β} {p : Parser α} {reps : ℕ} {b' : β} :
foldlCore f b p (reps + 1) cb n = done n' b' ↔
- (∃ (np : ℕ)(a : α), p cb n = done np a ∧ foldlCore f (f b a) p reps cb np = done n' b') ∨
+ (∃ (np : ℕ) (a : α), p cb n = done np a ∧ foldlCore f (f b a) p reps cb np = done n' b') ∨
n = n' ∧
b = b' ∧
∃ err,
p cb n = fail n err ∨
- ∃ (np : ℕ)(a : α),
+ ∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldlCore f (f b a) p reps cb np = fail n err :=
by simp [foldl_core, and_assoc, pure_eq_done]
#align parser.foldl_core_eq_done Parser.foldlCore_eq_done
@@ -897,19 +899,20 @@ theorem foldlCore_succ_eq_fail {f : β → α → β} {p : Parser α} {reps :
foldlCore f b p (reps + 1) cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
- ∃ (np : ℕ)(a : α), p cb n = done np a ∧ foldlCore f (f b a) p reps cb np = fail n' err) :=
+ ∃ (np : ℕ) (a : α),
+ p cb n = done np a ∧ foldlCore f (f b a) p reps cb np = fail n' err) :=
by simp [foldl_core, and_comm']
#align parser.foldl_core_succ_eq_fail Parser.foldlCore_succ_eq_fail
theorem foldl_eq_done {f : β → α → β} {p : Parser α} {b' : β} :
foldl f b p cb n = done n' b' ↔
- (∃ (np : ℕ)(a : α),
+ (∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldlCore f (f b a) p (cb.size - n) cb np = done n' b') ∨
n = n' ∧
b = b' ∧
∃ err,
p cb n = fail n err ∨
- ∃ (np : ℕ)(a : α),
+ ∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldlCore f (f b a) p (cb.size - n) cb np = fail n err :=
by simp [foldl, foldl_core_eq_done]
#align parser.foldl_eq_done Parser.foldl_eq_done
@@ -918,7 +921,7 @@ theorem foldl_eq_fail {f : β → α → β} {p : Parser α} {err : Dlist String
foldl f b p cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
- ∃ (np : ℕ)(a : α),
+ ∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldlCore f (f b a) p (cb.size - n) cb np = fail n' err) :=
by simp [foldl, foldl_core_succ_eq_fail]
#align parser.foldl_eq_fail Parser.foldl_eq_fail
@@ -941,7 +944,7 @@ theorem many_eq_done_nil {p : Parser α} :
n = n' ∧
∃ err,
p cb n = fail n err ∨
- ∃ (np : ℕ)(a : α),
+ ∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldrCore List.cons p [] (cb.size - n) cb np = fail n err :=
by simp [many, foldr_eq_done]
#align parser.many_eq_done_nil Parser.many_eq_done_nil
@@ -957,7 +960,7 @@ theorem many_eq_fail {p : Parser α} {err : Dlist String} :
many p cb n = fail n' err ↔
n ≠ n' ∧
(p cb n = fail n' err ∨
- ∃ (np : ℕ)(a : α),
+ ∃ (np : ℕ) (a : α),
p cb n = done np a ∧ foldrCore List.cons p [] (cb.size - n) cb np = fail n' err) :=
by simp [many, foldr_eq_fail]
#align parser.many_eq_fail Parser.many_eq_fail
@@ -967,7 +970,7 @@ theorem manyChar_eq_done_empty {p : Parser Char} :
n = n' ∧
∃ err,
p cb n = fail n err ∨
- ∃ (np : ℕ)(c : Char),
+ ∃ (np : ℕ) (c : Char),
p cb n = done np c ∧ foldrCore List.cons p [] (cb.size - n) cb np = fail n err :=
by simp [many_char, many_eq_done_nil, map_eq_done, List.asString_eq]
#align parser.many_char_eq_done_empty Parser.manyChar_eq_done_empty
@@ -990,7 +993,7 @@ theorem manyChar_eq_many_of_toList {p : Parser Char} {s : String} :
theorem many'_eq_done {p : Parser α} :
many' p cb n = done n' u ↔
many p cb n = done n' [] ∨
- ∃ (np : ℕ)(a : α)(l : List α),
+ ∃ (np : ℕ) (a : α) (l : List α),
many p cb n = done n' (a::l) ∧
p cb n = done np a ∧ foldrCore List.cons p [] (Buffer.size cb - n) cb np = done n' l :=
by
@@ -1001,7 +1004,7 @@ theorem many'_eq_done {p : Parser α} :
· exact Or.inl hl
· have hl2 := hl
simp only [foldr_core_eq_done, or_false_iff, exists_and_left, and_false_iff, false_and_iff,
- exists_eq_right_right] at hl
+ exists_eq_right_right] at hl
obtain ⟨np, hp, h⟩ := hl
refine' Or.inr ⟨np, _, _, hl2, hp, h⟩
· rintro (h | ⟨np, a, l, hp, h⟩)
@@ -1021,7 +1024,7 @@ theorem many1_eq_done {p : Parser α} {l : List α} :
theorem many1_eq_fail {p : Parser α} {err : Dlist String} :
many1 p cb n = fail n' err ↔
- p cb n = fail n' err ∨ ∃ (np : ℕ)(a : α), p cb n = done np a ∧ many p cb np = fail n' err :=
+ p cb n = fail n' err ∨ ∃ (np : ℕ) (a : α), p cb n = done np a ∧ many p cb np = fail n' err :=
by simp [many1, seq_eq_fail]
#align parser.many1_eq_fail Parser.many1_eq_fail
@@ -1103,7 +1106,7 @@ namespace Static
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
{cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
-theorem not_of_ne (h : p cb n = done n' a) (hne : n ≠ n') : ¬Static p := by intro ;
+theorem not_of_ne (h : p cb n = done n' a) (hne : n ≠ n') : ¬Static p := by intro;
exact hne (of_done h)
#align parser.static.not_of_ne Parser.Static.not_of_ne
@@ -1215,7 +1218,7 @@ theorem charBuf_iff {cb' : CharBuffer} : Static (charBuf cb') ↔ cb' = Buffer.n
cases' hc : cb'.size with n
· simp only [eq_self_iff_true, iff_true_iff]
exact ⟨fun _ _ _ _ h => by simpa [hc] using (char_buf_eq_done.mp h).left⟩
- · rw [hc] at this
+ · rw [hc] at this
simpa [Nat.succ_ne_zero] using not_of_ne this (Nat.succ_ne_zero n).symm
#align parser.static.char_buf_iff Parser.Static.charBuf_iff
@@ -1342,7 +1345,7 @@ theorem nat : ¬nat.Static :=
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.Static → (F p).Static) :
Static (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h;
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ;
exact static.of_done h⟩
#align parser.static.fix Parser.Static.fix
@@ -1357,7 +1360,7 @@ variable {p q : Parser α} {cb : CharBuffer} {n n' : ℕ} {err : Dlist String}
variable {a : α} {b : β}
theorem done_of_unbounded (h : ¬p.Bounded) :
- ∃ (cb : CharBuffer)(n n' : ℕ)(a : α), p cb n = done n' a ∧ cb.size ≤ n :=
+ ∃ (cb : CharBuffer) (n n' : ℕ) (a : α), p cb n = done n' a ∧ cb.size ≤ n :=
by
contrapose! h
constructor
@@ -1436,7 +1439,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).Bounded ↔ p.Bo
constructor
intro _ _ hn
obtain ⟨_, _, h⟩ := bounded.exists (@Parser.decorateErrors α msgs p) hn
- simp [decorate_errors_eq_fail] at h
+ simp [decorate_errors_eq_fail] at h
exact h.right.right
· intro
constructor
@@ -1492,7 +1495,7 @@ theorem str_iff {s : String} : (str s).Bounded ↔ s ≠ "" :=
by
rw [str, decorate_error_iff]
cases hs : s.to_list
- · have : s = "" := by cases s; rw [String.toList] at hs; simpa [hs]
+ · have : s = "" := by cases s; rw [String.toList] at hs ; simpa [hs]
simp [pure, this]
· have : s ≠ "" := by intro H; simpa [H] using hs
simp only [this, iff_true_iff, Ne.def, not_false_iff]
@@ -1769,7 +1772,7 @@ namespace ErrStatic
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
{cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
-theorem not_of_ne (h : p cb n = fail n' err) (hne : n ≠ n') : ¬ErrStatic p := by intro ;
+theorem not_of_ne (h : p cb n = fail n' err) (hne : n ≠ n') : ¬ErrStatic p := by intro;
exact hne (of_fail h)
#align parser.err_static.not_of_ne Parser.ErrStatic.not_of_ne
@@ -1957,7 +1960,7 @@ instance nat : nat.ErrStatic :=
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.ErrStatic → (F p).ErrStatic) :
ErrStatic (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h;
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ;
exact err_static.of_fail h⟩
#align parser.err_static.fix Parser.ErrStatic.fix
@@ -2058,7 +2061,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).step ↔ p.step
· intro
constructor
intro _ _ _ _ h
- rw [decorate_errors_eq_done] at h
+ rw [decorate_errors_eq_done] at h
exact of_done h
#align parser.step.decorate_errors_iff Parser.Step.decorateErrors_iff
@@ -2150,7 +2153,7 @@ instance digit : digit.step :=
#align parser.step.digit Parser.Step.digit
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.step → (F p).step) : Step (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h; exact of_done h⟩
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ; exact of_done h⟩
#align parser.step.fix Parser.Step.fix
end Step
@@ -2182,8 +2185,8 @@ theorem many1_eq_done_iff_many_eq_done [p.step] [p.Bounded] {x : α} {xs : List
simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
cases' tl with hd' tl'
· simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
- · rw [← @IH hd' tl'] at hm; swap; rfl
- simp only [many1_eq_done, many, foldr] at hm
+ · rw [← @IH hd' tl'] at hm ; swap; rfl
+ simp only [many1_eq_done, many, foldr] at hm
obtain ⟨np, hp', hf⟩ := hm
obtain rfl : np = n + 1 + 1 := step.of_done hp'
simpa [Nat.sub_succ, many_eq_done, hp, hk, foldr_core_eq_done, hp'] using hf
@@ -2202,10 +2205,10 @@ theorem many1_eq_done_iff_many_eq_done [p.step] [p.Bounded] {x : α} {xs : List
· simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
· simp [hp]
rw [← @IH hd' tl' (n + 1) n']; swap; rfl
- rw [hk, foldr_core_eq_done, or_comm] at hm
+ rw [hk, foldr_core_eq_done, or_comm] at hm
obtain hm | ⟨np, hd', tl', hp', hf, hm⟩ := hm
· simpa using hm
- simp only at hm
+ simp only at hm
obtain ⟨rfl, rfl⟩ := hm
obtain rfl : np = n + 1 + 1 := step.of_done hp'
simp [Nat.sub_succ, many, many1_eq_done, hp, hk, foldr_core_eq_done, hp', ← hf, foldr]
@@ -2293,7 +2296,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).Prog ↔ p.Prog
· intro
constructor
intro _ _ _ _ h
- rw [decorate_errors_eq_done] at h
+ rw [decorate_errors_eq_done] at h
exact of_done h
#align parser.prog.decorate_errors_iff Parser.Prog.decorateErrors_iff
@@ -2388,7 +2391,7 @@ instance nat : nat.Prog :=
#align parser.prog.nat Parser.Prog.nat
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.Prog → (F p).Prog) : Prog (fix F) :=
- ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h; exact of_done h⟩
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h ; exact of_done h⟩
#align parser.prog.fix Parser.Prog.fix
end Prog
@@ -2406,14 +2409,14 @@ theorem many_sublist_of_done [p.step] [p.Bounded] {l : List α} (h : p.anyM cb n
∀ k < n' - n, p.anyM cb (n + k) = done n' (l.drop k) :=
by
induction' l with hd tl hl generalizing n
- · rw [many_eq_done_nil] at h
+ · rw [many_eq_done_nil] at h
simp [h.left]
intro m hm
cases m
· exact h
rw [List.drop, Nat.add_succ, ← Nat.succ_add]
apply hl
- · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
+ · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
obtain ⟨_, hp, h⟩ := h
convert h
exact (step.of_done hp).symm
@@ -2425,9 +2428,9 @@ theorem many_eq_nil_of_done [p.step] [p.Bounded] {l : List α} (h : p.anyM cb n
by
induction' l with hd tl hl generalizing n
· convert h
- rw [many_eq_done_nil] at h
+ rw [many_eq_done_nil] at h
exact h.left.symm
- · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
+ · rw [← many1_eq_done_iff_many_eq_done, many1_eq_done] at h
obtain ⟨_, -, h⟩ := h
exact hl h
#align parser.many_eq_nil_of_done Parser.many_eq_nil_of_done
@@ -2435,9 +2438,9 @@ theorem many_eq_nil_of_done [p.step] [p.Bounded] {l : List α} (h : p.anyM cb n
theorem many_eq_nil_of_out_of_bound [p.Bounded] {l : List α} (h : p.anyM cb n = done n' l)
(hn : cb.size < n) : n' = n ∧ l = [] := by
cases l
- · rw [many_eq_done_nil] at h
+ · rw [many_eq_done_nil] at h
exact ⟨h.left.symm, rfl⟩
- · rw [many_eq_done] at h
+ · rw [many_eq_done] at h
obtain ⟨np, hp, -⟩ := h
exact absurd (bounded.of_done hp) hn.not_lt
#align parser.many_eq_nil_of_out_of_bound Parser.many_eq_nil_of_out_of_bound
@@ -2449,14 +2452,14 @@ theorem many1_length_of_done [p.mono] [p.step] [p.Bounded] {l : List α}
· simpa using h
· obtain ⟨k, hk⟩ : ∃ k, n' = n + k + 1 := Nat.exists_eq_add_of_lt (prog.of_done h)
subst hk
- simp only [many1_eq_done] at h
+ simp only [many1_eq_done] at h
obtain ⟨_, hp, h⟩ := h
obtain rfl := step.of_done hp
cases tl
- · simp only [many_eq_done_nil, add_left_inj, exists_and_right, self_eq_add_right] at h
+ · simp only [many_eq_done_nil, add_left_inj, exists_and_right, self_eq_add_right] at h
rcases h with ⟨rfl, -⟩
simp
- rw [← many1_eq_done_iff_many_eq_done] at h
+ rw [← many1_eq_done_iff_many_eq_done] at h
specialize hl h
simp [hl, add_comm, add_assoc, Nat.sub_succ]
#align parser.many1_length_of_done Parser.many1_length_of_done
@@ -2465,13 +2468,13 @@ theorem many1_bounded_of_done [p.step] [p.Bounded] {l : List α} (h : many1 p cb
n' ≤ cb.size := by
induction' l with hd tl hl generalizing n n'
· simpa using h
- · simp only [many1_eq_done] at h
+ · simp only [many1_eq_done] at h
obtain ⟨np, hp, h⟩ := h
obtain rfl := step.of_done hp
cases tl
- · simp only [many_eq_done_nil, exists_and_right] at h
+ · simp only [many_eq_done_nil, exists_and_right] at h
simpa [← h.left] using bounded.of_done hp
- · rw [← many1_eq_done_iff_many_eq_done] at h
+ · rw [← many1_eq_done_iff_many_eq_done] at h
exact hl h
#align parser.many1_bounded_of_done Parser.many1_bounded_of_done
@@ -2533,7 +2536,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- We convert the hypothesis that `parser.nat` has succeeded into an existential that there is
-- some list of digits that it has parsed in, and that those digits, when folded over by the
-- function above, give the value at hand.
- simp only [Nat, pure_eq_done, natm, decorate_error_eq_done, bind_eq_done] at h
+ simp only [Nat, pure_eq_done, natm, decorate_error_eq_done, bind_eq_done] at h
obtain ⟨n', l, hp, rfl, rfl⟩ := h
-- We now want to stop working with the `cb : char_buffer` and parse positions `n` and `n'`,
-- and just deal with the parsed digit list `l : list ℕ`. To do so, we have to show that
@@ -2559,7 +2562,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- character at position `n`, which we now call `chd : char`.
have chdh : chd.to_nat - '0'.toNat = lhd :=
by
- simp only [many1_eq_done] at hp
+ simp only [many1_eq_done] at hp
-- We know that `parser.digit` succeeded, so it has moved to a possibly different position.
-- In fact, we know that this new position is `n + 1`, by the `step` property of
-- `parser.digit`.
@@ -2570,15 +2573,15 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- that the `n`th character of `cb`, let's say `c`, when converted to a `ℕ` via
-- `char.to_nat c - '0'.to_nat`, must be equal to the resulting value, `lhd` in our case.
simp only [digit_eq_done, Buffer.read_eq_nthLe_toList, hx, Buffer.length_toList, true_and_iff,
- add_left_inj, List.length, List.nthLe, eq_self_iff_true, exists_and_left, Fin.val_mk] at hp
+ add_left_inj, List.length, List.nthLe, eq_self_iff_true, exists_and_left, Fin.val_mk] at hp
rcases hp with ⟨_, hn, rfl, _, _⟩
-- But we already know the list corresponding to `cb : char_buffer` from position `n` and on
-- is equal to `(chd :: ctl) : list char`, so our `c` above must satisfy `c = chd`.
have hn' : n < cb.to_list.length := by simpa using hn
- rw [← List.cons_nthLe_drop_succ hn'] at hx
+ rw [← List.cons_nthLe_drop_succ hn'] at hx
-- We can ignore proving any correspondence of `ctl : list char` to the other portions of the
-- `cb : char_buffer`.
- simp only at hx
+ simp only at hx
simp [hx]
-- We know that we parsed in more than one character because of the `prog` property of
-- `parser.digit`, which the `many1` parser combinator retains. In other words, we know that
@@ -2592,7 +2595,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
by
cases ltl
· simp
- · rw [many1_eq_done] at hp
+ · rw [many1_eq_done] at hp
obtain ⟨_, hp, hp'⟩ := hp
simpa [step.of_done hp, many1_eq_done_iff_many_eq_done] using hp'
-- Now we case on the two possibilities, that there was only a single digit parsed in, and
@@ -2605,7 +2608,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- in reverse.
rcases hdm with (rfl | hdm)
· -- Case that `ltl = []`.
- simp only [many1_eq_done, many_eq_done_nil, exists_and_right] at hp
+ simp only [many1_eq_done, many_eq_done_nil, exists_and_right] at hp
-- This means we must have failed parsing with `parser.digit` at some other position,
-- which we prove must be `n + 1` via the `step` property.
obtain ⟨_, hp, rfl, hp'⟩ := hp
@@ -2655,7 +2658,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
-- parsing in at position `n` using a `bounded` parser, so we must have that
-- `n < cb.size`.
have := bounded.of_done hp
- rw [hc] at this
+ rw [hc] at this
-- But then `n < 0`, a contradiction.
exact absurd n.zero_le this.not_le
· simp
@@ -2695,7 +2698,7 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
-- the resulting value given by `parser.nat`, and focus solely on the `list ℕ` generated by
-- `parser.digit.many1`.
simp only [Nat, pure_eq_done, and_left_comm, decorate_error_eq_done, bind_eq_done, exists_eq_left,
- exists_and_left] at h
+ exists_and_left] at h
obtain ⟨xs, h, -⟩ := h
-- We want to avoid having to make statements about the `cb : char_buffer` itself. Instead, we
-- induct on the `xs : list ℕ` that `parser.digit.many1` produced.
@@ -2708,14 +2711,14 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
-- induction hypothesis on the remaining `tl`.
-- We break apart a `many1` success into a success of the underlying `parser.digit` to give `hd`
-- and a `parser.digit.many` which gives `tl`. We first deal with the `hd`.
- rw [many1_eq_done] at h
+ rw [many1_eq_done] at h
-- Right away, we can throw away the information about the "new" position that `parser.digit`
-- ended on because we will soon prove that it must have been `n + 1`.
obtain ⟨_, hp, h⟩ := h
-- The main lemma here is `digit_eq_done`, which already proves the necessary conditions about
-- the character at hand. What is left to do is properly unpack the information.
simp only [digit_eq_done, and_comm, and_left_comm, digit_eq_fail, true_and_iff, exists_eq_left,
- eq_self_iff_true, exists_and_left, exists_and_left] at hp
+ eq_self_iff_true, exists_and_left, exists_and_left] at hp
obtain ⟨rfl, -, hn, ge0, le9, rfl⟩ := hp
-- Let's now consider a position `k` between `n` and `n'`, excluding `n'`.
intro hn k hk hk'
@@ -2731,7 +2734,7 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
-- position `k` was not "numeric" or we are out of bounds. More importantly, when `many`
-- successfully produces a `[]`, it does not progress the parser head, so we have that
-- `n + 1 = n'`. This will lead to a contradiction because now we have `n < k` and `k < n + 1`.
- simp only [many_eq_done_nil, exists_and_right] at h
+ simp only [many_eq_done_nil, exists_and_right] at h
-- Extract out just the `n + 1 = n'`.
obtain ⟨rfl, -⟩ := h
-- Form the contradictory hypothesis, and discharge the goal.
@@ -2740,7 +2743,7 @@ theorem nat_of_done_as_digit {val : ℕ} (h : nat cb n = done n' val) :
· -- Case where `tl ≠ []`. But that means that `many` produced a nonempty list as a result, so
-- `many1` would have successfully parsed at this position too. We use this statement to
-- rewrite our hypothesis into something that works with the induction hypothesis, and apply it.
- rw [← many1_eq_done_iff_many_eq_done] at h
+ rw [← many1_eq_done_iff_many_eq_done] at h
apply hl h
-- All that is left to prove is that our `k` is at least our new "lower bound" `n + 1`, which
-- we have from our original split of the `n ≤ k`, since we are now on the `n < k` case.
@@ -2767,7 +2770,7 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
-- `∀ (hn : n' < cb.size)`. Thus we only have to prove the lemma for the cases where `n'` is still
-- "in-bounds".
simp only [Nat, pure_eq_done, and_left_comm, decorate_error_eq_done, bind_eq_done, exists_eq_left,
- exists_and_left] at h
+ exists_and_left] at h
obtain ⟨xs, h, -⟩ := h
-- We want to avoid having to make statements about the `cb : char_buffer` itself. Instead, we
-- induct on the `xs : list ℕ` that `parser.digit.many1` produced.
@@ -2784,14 +2787,14 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
· -- Case where `tl = []`, so we parsed in only `hd`. That must mean that `parser.digit` failed
-- at `n + 1`.
simp only [many1_eq_done, many_eq_done_nil, and_left_comm, exists_and_right, exists_eq_left] at
- h
+ h
-- We throw away the success information of what happened at position `n`, and we do not need
-- the "error" value that the failure produced.
obtain ⟨-, _, h⟩ := h
-- If `parser.digit` failed at `n + 1`, then either we hit a non-numeric character, or
-- we are out of bounds. `digit_eq_fail` provides us with those two cases.
simp only [digit_eq_done, and_comm, and_left_comm, digit_eq_fail, true_and_iff, exists_eq_left,
- eq_self_iff_true, exists_and_left] at h
+ eq_self_iff_true, exists_and_left] at h
obtain ⟨rfl, h⟩ | ⟨h, -⟩ := h
· -- First case: we are still in bounds, but the character is not numeric. We must prove
-- that we are still in bounds. But we know that from our initial requirement.
@@ -2806,9 +2809,9 @@ theorem nat_of_done_bounded {val : ℕ} (h : nat cb n = done n' val) :
· -- Case where `tl ≠ []`. But that means that `many` produced a nonempty list as a result, so
-- `many1` would have successfully parsed at this position too. We use this statement to
-- rewrite our hypothesis into something that works with the induction hypothesis, and apply it.
- rw [many1_eq_done] at h
+ rw [many1_eq_done] at h
obtain ⟨_, -, h⟩ := h
- rw [← many1_eq_done_iff_many_eq_done] at h
+ rw [← many1_eq_done_iff_many_eq_done] at h
exact hl h
#align parser.nat_of_done_bounded Parser.nat_of_done_bounded
@@ -2854,9 +2857,9 @@ theorem nat_eq_done {val : ℕ} :
-- We clone the success hypothesis `h` so that we can supply it back later.
have H := h
-- We unwrap the `parser.nat` success down to the `many1` success, throwing away other info.
- rw [Nat] at h
+ rw [Nat] at h
simp only [decorate_error_eq_done, bind_eq_done, pure_eq_done, and_left_comm, exists_eq_left,
- exists_and_left] at h
+ exists_and_left] at h
obtain ⟨_, h, -⟩ := h
-- Now we get our existential witness that `n' ≤ cb.size`.
replace h := many1_bounded_of_done h
@@ -2892,7 +2895,7 @@ theorem nat_eq_done {val : ℕ} :
induction' H : cb.to_list.drop n with hd tl IH generalizing n
· -- Base case: there are no characters at position `n` or onwards, which means that
-- `cb.size ≤ n`. But this is a contradiction, since we have `n < n' ≤ cb.size`.
- rw [List.drop_eq_nil_iff_le] at H
+ rw [List.drop_eq_nil_iff_le] at H
refine' absurd ((lt_of_le_of_lt H hn).trans_le hn') _
simp
· -- Inductive case: we prove that if we could have parsed from `n + 1`, we could have also parsed
@@ -2905,7 +2908,7 @@ theorem nat_eq_done {val : ℕ} :
-- list.drop (n + 1), which fits out induction hypothesis conditions better. To use the
-- rearranging lemma, we must prove that we are "dropping" in bounds, which we supply on-the-fly
simp only [←
- List.cons_nthLe_drop_succ (show n < cb.to_list.length by simpa using hn.trans_le hn')] at H
+ List.cons_nthLe_drop_succ (show n < cb.to_list.length by simpa using hn.trans_le hn')] at H
-- We prove that parsing our `n`th character, `hd`, would have resulted in a success from
-- `parser.digit`, with the appropriate `ℕ` success value. We use this later to simplify the
-- unwrapped fold, since `hd` is our head character.
@@ -2952,7 +2955,7 @@ theorem nat_eq_done {val : ℕ} :
simpa using hdl
-- Case `l = lhd :: ltl`. We can rewrite the fold of the function inside `parser.nat` on
-- `lhd :: ltl`, which will be used to rewrite in the goal.
- simp only [natm, List.foldr] at hvl
+ simp only [natm, List.foldr] at hvl
-- We also expand the fold in the goal, using the expanded fold from our hypothesis, powered
-- by `many1_eq_done` to proceed in the parsing. We know exactly what the next `many` will
-- produce from `many1_eq_done_iff_many_eq_done.mp` of our `hdl` hypothesis. Finally,
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -514,12 +514,6 @@ instance mapM : ∀ {l : List α} {f : α → Parser β} [∀ a ∈ l, (f a).mon
exact fun _ ha => h _ (List.mem_cons_of_mem _ ha)
#align parser.mono.mmap Parser.Mono.mapM
-/- warning: parser.mono.mmap' -> Parser.Mono.mapM' is a dubious translation:
-lean 3 declaration is
- forall {α : Type} {β : Type} {l : List.{0} α} {f : α -> (Parser β)} [_inst_1 : forall (a : α), (Membership.Mem.{0, 0} α (List.{0} α) (List.hasMem.{0} α) a l) -> (Parser.Mono β (f a))], Parser.Mono Unit (List.mapM'.{0, 0} Parser Parser.monad α β f l)
-but is expected to have type
- PUnit.{0}
-Case conversion may be inaccurate. Consider using '#align parser.mono.mmap' Parser.Mono.mapM'ₓ'. -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
instance mapM' : ∀ {l : List α} {f : α → Parser β} [∀ a ∈ l, (f a).mono], (l.mapM' f).mono
| [], _, _ => Mono.pure
@@ -1147,12 +1141,6 @@ instance mapM : ∀ {l : List α} {f : α → Parser β} [∀ a, (f a).Static],
· exact fun _ => static.pure
#align parser.static.mmap Parser.Static.mapM
-/- warning: parser.static.mmap' -> Parser.Static.mapM' is a dubious translation:
-lean 3 declaration is
- forall {α : Type} {β : Type} {l : List.{0} α} {f : α -> (Parser β)} [_inst_1 : forall (a : α), Parser.Static β (f a)], Parser.Static Unit (List.mapM'.{0, 0} Parser Parser.monad α β f l)
-but is expected to have type
- PUnit.{0}
-Case conversion may be inaccurate. Consider using '#align parser.static.mmap' Parser.Static.mapM'ₓ'. -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
instance mapM' : ∀ {l : List α} {f : α → Parser β} [∀ a, (f a).Static], (l.mapM' f).Static
| [], _, _ => Static.pure
@@ -1861,12 +1849,6 @@ instance mapM_of_unfailing :
· exact fun _ => unfailing.pure
#align parser.err_static.mmap_of_unfailing Parser.ErrStatic.mapM_of_unfailing
-/- warning: parser.err_static.mmap' -> Parser.ErrStatic.mapM' is a dubious translation:
-lean 3 declaration is
- forall {α : Type} {β : Type} {l : List.{0} α} {f : α -> (Parser β)} [_inst_1 : forall (a : α), Parser.Static β (f a)] [_inst_2 : forall (a : α), Parser.ErrStatic β (f a)], Parser.ErrStatic Unit (List.mapM'.{0, 0} Parser Parser.monad α β f l)
-but is expected to have type
- PUnit.{0}
-Case conversion may be inaccurate. Consider using '#align parser.err_static.mmap' Parser.ErrStatic.mapM'ₓ'. -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
instance mapM' :
∀ {l : List α} {f : α → Parser β} [∀ a, (f a).Static] [∀ a, (f a).ErrStatic],
@@ -1881,12 +1863,6 @@ instance mapM' :
· exact h'
#align parser.err_static.mmap' Parser.ErrStatic.mapM'
-/- warning: parser.err_static.mmap'_of_unfailing -> Parser.ErrStatic.mapM'_of_unfailing is a dubious translation:
-lean 3 declaration is
- forall {α : Type} {β : Type} {l : List.{0} α} {f : α -> (Parser β)} [_inst_1 : forall (a : α), Parser.Unfailing β (f a)] [_inst_2 : forall (a : α), Parser.ErrStatic β (f a)], Parser.ErrStatic Unit (List.mapM'.{0, 0} Parser Parser.monad α β f l)
-but is expected to have type
- PUnit.{0}
-Case conversion may be inaccurate. Consider using '#align parser.err_static.mmap'_of_unfailing Parser.ErrStatic.mapM'_of_unfailingₓ'. -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
instance mapM'_of_unfailing :
∀ {l : List α} {f : α → Parser β} [∀ a, (f a).Unfailing] [∀ a, (f a).ErrStatic],
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -620,9 +620,7 @@ instance foldrCore {f : α → β → β} {b : β} [p.mono] : ∀ {reps : ℕ},
#align parser.mono.foldr_core Parser.Mono.foldrCore
instance foldr {f : α → β → β} [p.mono] : Mono (foldr f p b) :=
- ⟨fun _ _ => by
- convert mono.le (foldr_core f p b _) _ _
- exact mono.foldr_core⟩
+ ⟨fun _ _ => by convert mono.le (foldr_core f p b _) _ _; exact mono.foldr_core⟩
#align parser.mono.foldr Parser.Mono.foldr
instance foldlCore {f : α → β → α} {p : Parser β} [p.mono] :
@@ -637,9 +635,7 @@ instance foldlCore {f : α → β → α} {p : Parser β} [p.mono] :
#align parser.mono.foldl_core Parser.Mono.foldlCore
instance foldl {f : α → β → α} {p : Parser β} [p.mono] : Mono (foldl f a p) :=
- ⟨fun _ _ => by
- convert mono.le (foldl_core f a p _) _ _
- exact mono.foldl_core⟩
+ ⟨fun _ _ => by convert mono.le (foldl_core f a p _) _ _; exact mono.foldl_core⟩
#align parser.mono.foldl Parser.Mono.foldl
instance many [p.mono] : p.anyM.mono :=
@@ -685,9 +681,7 @@ instance nat : nat.mono :=
#align parser.mono.nat Parser.Mono.nat
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.mono → (F p).mono) : Mono (fix F) :=
- ⟨fun _ _ => by
- convert mono.le (Parser.fixCore F _) _ _
- exact fix_core hF _⟩
+ ⟨fun _ _ => by convert mono.le (Parser.fixCore F _) _ _; exact fix_core hF _⟩
#align parser.mono.fix Parser.Mono.fix
end Mono
@@ -727,10 +721,8 @@ theorem sat_eq_done {p : Char → Prop} [DecidablePred p] :
· by_cases hp : p (cb.read ⟨n, hn⟩)
· simp only [sat, hn, hp, dif_pos, if_true, exists_prop_of_true]
constructor
- · rintro ⟨rfl, rfl⟩
- simp [hp]
- · rintro ⟨-, rfl, rfl⟩
- simp
+ · rintro ⟨rfl, rfl⟩; simp [hp]
+ · rintro ⟨-, rfl, rfl⟩; simp
· simp only [sat, hn, hp, dif_pos, false_iff_iff, not_and, exists_prop_of_true, if_false]
rintro H - rfl
exact hp H
@@ -1117,23 +1109,16 @@ namespace Static
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
{cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
-theorem not_of_ne (h : p cb n = done n' a) (hne : n ≠ n') : ¬Static p :=
- by
- intro
+theorem not_of_ne (h : p cb n = done n' a) (hne : n ≠ n') : ¬Static p := by intro ;
exact hne (of_done h)
#align parser.static.not_of_ne Parser.Static.not_of_ne
instance pure : Static (pure a) :=
- ⟨fun _ _ _ _ => by
- simp_rw [pure_eq_done]
- rw [and_comm]
- simp⟩
+ ⟨fun _ _ _ _ => by simp_rw [pure_eq_done]; rw [and_comm]; simp⟩
#align parser.static.pure Parser.Static.pure
instance bind {f : α → Parser β} [p.Static] [∀ a, (f a).Static] : (p >>= f).Static :=
- ⟨fun _ _ _ _ => by
- rw [bind_eq_done]
- rintro ⟨_, _, hp, hf⟩
+ ⟨fun _ _ _ _ => by rw [bind_eq_done]; rintro ⟨_, _, hp, hf⟩;
exact trans (of_done hp) (of_done hf)⟩
#align parser.static.bind Parser.Static.bind
@@ -1142,10 +1127,7 @@ instance andThen {q : Parser β} [p.Static] [q.Static] : (p >> q).Static :=
#align parser.static.and_then Parser.Static.andThen
instance map [p.Static] {f : α → β} : (f <$> p).Static :=
- ⟨fun _ _ _ _ => by
- simp_rw [map_eq_done]
- rintro ⟨_, hp, _⟩
- exact of_done hp⟩
+ ⟨fun _ _ _ _ => by simp_rw [map_eq_done]; rintro ⟨_, hp, _⟩; exact of_done hp⟩
#align parser.static.map Parser.Static.map
instance seq {f : Parser (α → β)} [f.Static] [p.Static] : (f <*> p).Static :=
@@ -1190,15 +1172,11 @@ instance guard {p : Prop} [Decidable p] : Static (guard p) :=
#align parser.static.guard Parser.Static.guard
instance orelse [p.Static] [q.Static] : (p <|> q).Static :=
- ⟨fun _ _ _ _ => by
- simp_rw [orelse_eq_done]
- rintro (h | ⟨h, -⟩) <;> exact of_done h⟩
+ ⟨fun _ _ _ _ => by simp_rw [orelse_eq_done]; rintro (h | ⟨h, -⟩) <;> exact of_done h⟩
#align parser.static.orelse Parser.Static.orelse
instance decorateErrors [p.Static] : (@decorateErrors α msgs p).Static :=
- ⟨fun _ _ _ _ => by
- rw [decorate_errors_eq_done]
- exact of_done⟩
+ ⟨fun _ _ _ _ => by rw [decorate_errors_eq_done]; exact of_done⟩
#align parser.static.decorate_errors Parser.Static.decorateErrors
instance decorateError [p.Static] : (@decorateError α msg p).Static :=
@@ -1227,10 +1205,7 @@ theorem sat_iff {p : Char → Prop} [DecidablePred p] : Static (sat p) ↔ ∀ c
exact ⟨a, hp⟩
#align parser.static.sat_iff Parser.Static.sat_iff
-instance sat : Static (sat fun _ => False) :=
- by
- apply sat_iff.mpr
- simp
+instance sat : Static (sat fun _ => False) := by apply sat_iff.mpr; simp
#align parser.static.sat Parser.Static.sat
instance eps : Static eps :=
@@ -1266,9 +1241,7 @@ theorem oneOf_iff {cs : List Char} : Static (oneOf cs) ↔ cs = [] :=
simpa using not_of_ne this zero_ne_one
#align parser.static.one_of_iff Parser.Static.oneOf_iff
-instance oneOf : Static (oneOf []) := by
- apply one_of_iff.mpr
- rfl
+instance oneOf : Static (oneOf []) := by apply one_of_iff.mpr; rfl
#align parser.static.one_of Parser.Static.oneOf
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
@@ -1281,10 +1254,7 @@ theorem oneOf'_iff {cs : List Char} : Static (oneOf' cs) ↔ cs = [] :=
simpa using not_of_ne this zero_ne_one
#align parser.static.one_of'_iff Parser.Static.oneOf'_iff
-instance one_of' : Static (oneOf []) :=
- by
- apply one_of_iff.mpr
- rfl
+instance one_of' : Static (oneOf []) := by apply one_of_iff.mpr; rfl
#align parser.static.one_of' Parser.Static.one_of'
theorem str_iff {s : String} : Static (str s) ↔ s = "" := by
@@ -1314,9 +1284,7 @@ instance foldrCore {f : α → β → β} [p.Static] : ∀ {b : β} {reps : ℕ}
#align parser.static.foldr_core Parser.Static.foldrCore
instance foldr {f : α → β → β} [p.Static] : Static (foldr f p b) :=
- ⟨fun _ _ _ _ => by
- dsimp [foldr]
- exact of_done⟩
+ ⟨fun _ _ _ _ => by dsimp [foldr]; exact of_done⟩
#align parser.static.foldr Parser.Static.foldr
instance foldlCore {f : α → β → α} {p : Parser β} [p.Static] :
@@ -1331,9 +1299,7 @@ instance foldlCore {f : α → β → α} {p : Parser β} [p.Static] :
#align parser.static.foldl_core Parser.Static.foldlCore
instance foldl {f : α → β → α} {p : Parser β} [p.Static] : Static (foldl f a p) :=
- ⟨fun _ _ _ _ => by
- dsimp [foldl]
- exact of_done⟩
+ ⟨fun _ _ _ _ => by dsimp [foldl]; exact of_done⟩
#align parser.static.foldl Parser.Static.foldl
instance many [p.Static] : p.anyM.Static :=
@@ -1388,9 +1354,7 @@ theorem nat : ¬nat.Static :=
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.Static → (F p).Static) :
Static (fix F) :=
- ⟨fun cb n _ _ h => by
- haveI := fix_core hF (cb.size - n + 1)
- dsimp [fix] at h
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h;
exact static.of_done h⟩
#align parser.static.fix Parser.Static.fix
@@ -1540,14 +1504,9 @@ theorem str_iff {s : String} : (str s).Bounded ↔ s ≠ "" :=
by
rw [str, decorate_error_iff]
cases hs : s.to_list
- · have : s = "" := by
- cases s
- rw [String.toList] at hs
- simpa [hs]
+ · have : s = "" := by cases s; rw [String.toList] at hs; simpa [hs]
simp [pure, this]
- · have : s ≠ "" := by
- intro H
- simpa [H] using hs
+ · have : s ≠ "" := by intro H; simpa [H] using hs
simp only [this, iff_true_iff, Ne.def, not_false_iff]
infer_instance
#align parser.bounded.str_iff Parser.Bounded.str_iff
@@ -1623,17 +1582,13 @@ theorem many : p.anyM.Bounded :=
omit hpb
theorem manyChar {pc : Parser Char} [pc.Bounded]
- (he : ∀ cb n n' err, pc cb n = fail n' err → n ≠ n') : pc.manyChar.Bounded :=
- by
- convert bounded.map
- exact many he
+ (he : ∀ cb n n' err, pc cb n = fail n' err → n ≠ n') : pc.manyChar.Bounded := by
+ convert bounded.map; exact many he
#align parser.bounded.many_char Parser.Bounded.manyChar
include hpb
-theorem many' : p.many'.Bounded := by
- convert bounded.and_then
- exact many he
+theorem many' : p.many'.Bounded := by convert bounded.and_then; exact many he
#align parser.bounded.many' Parser.Bounded.many'
end Fold
@@ -1750,15 +1705,11 @@ theorem guard : ¬Unfailing (guard False) :=
#align parser.unfailing.guard Parser.Unfailing.guard
instance orelse [p.Unfailing] : (p <|> q).Unfailing :=
- ⟨fun cb n => by
- obtain ⟨_, _, h⟩ := p.exists_done cb n
- simp [success_iff, h]⟩
+ ⟨fun cb n => by obtain ⟨_, _, h⟩ := p.exists_done cb n; simp [success_iff, h]⟩
#align parser.unfailing.orelse Parser.Unfailing.orelse
instance decorateErrors [p.Unfailing] : (@decorateErrors α msgs p).Unfailing :=
- ⟨fun cb n => by
- obtain ⟨_, _, h⟩ := p.exists_done cb n
- simp [success_iff, h]⟩
+ ⟨fun cb n => by obtain ⟨_, _, h⟩ := p.exists_done cb n; simp [success_iff, h]⟩
#align parser.unfailing.decorate_errors Parser.Unfailing.decorateErrors
instance decorateError [p.Unfailing] : (@decorateError α msg p).Unfailing :=
@@ -1830,9 +1781,7 @@ namespace ErrStatic
variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Thunk String}
{cb : CharBuffer} {n' n : ℕ} {err : Dlist String} {a : α} {b : β} {sep : Parser Unit}
-theorem not_of_ne (h : p cb n = fail n' err) (hne : n ≠ n') : ¬ErrStatic p :=
- by
- intro
+theorem not_of_ne (h : p cb n = fail n' err) (hne : n ≠ n') : ¬ErrStatic p := by intro ;
exact hne (of_fail h)
#align parser.err_static.not_of_ne Parser.ErrStatic.not_of_ne
@@ -1867,9 +1816,7 @@ instance andThen_of_unfailing {q : Parser β} [p.ErrStatic] [q.Unfailing] : (p >
#align parser.err_static.and_then_of_unfailing Parser.ErrStatic.andThen_of_unfailing
instance map [p.ErrStatic] {f : α → β} : (f <$> p).ErrStatic :=
- ⟨fun _ _ _ _ => by
- rw [map_eq_fail]
- exact of_fail⟩
+ ⟨fun _ _ _ _ => by rw [map_eq_fail]; exact of_fail⟩
#align parser.err_static.map Parser.ErrStatic.map
instance seq {f : Parser (α → β)} [f.Static] [f.ErrStatic] [p.ErrStatic] : (f <*> p).ErrStatic :=
@@ -1978,9 +1925,7 @@ instance decorateError : (@decorateError α msg p).ErrStatic :=
#align parser.err_static.decorate_error Parser.ErrStatic.decorateError
instance anyChar : ErrStatic anyChar :=
- ⟨fun _ _ _ _ => by
- rw [any_char_eq_fail, and_comm]
- simp⟩
+ ⟨fun _ _ _ _ => by rw [any_char_eq_fail, and_comm]; simp⟩
#align parser.err_static.any_char Parser.ErrStatic.anyChar
instance sat_iff {p : Char → Prop} [DecidablePred p] : ErrStatic (sat p) :=
@@ -2036,9 +1981,7 @@ instance nat : nat.ErrStatic :=
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.ErrStatic → (F p).ErrStatic) :
ErrStatic (fix F) :=
- ⟨fun cb n _ _ h => by
- haveI := fix_core hF (cb.size - n + 1)
- dsimp [fix] at h
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h;
exact err_static.of_fail h⟩
#align parser.err_static.fix Parser.ErrStatic.fix
@@ -2065,17 +2008,14 @@ theorem pure (a : α) : ¬Step (pure a) :=
instance bind {f : α → Parser β} [p.step] [∀ a, (f a).Static] : (p >>= f).step :=
⟨fun _ _ _ _ => by
- simp_rw [bind_eq_done]
- rintro ⟨_, _, hp, hf⟩
+ simp_rw [bind_eq_done]; rintro ⟨_, _, hp, hf⟩
exact static.of_done hf ▸ of_done hp⟩
#align parser.step.bind Parser.Step.bind
instance bind' {f : α → Parser β} [p.Static] [∀ a, (f a).step] : (p >>= f).step :=
⟨fun _ _ _ _ => by
- simp_rw [bind_eq_done]
- rintro ⟨_, _, hp, hf⟩
- rw [static.of_done hp]
- exact of_done hf⟩
+ simp_rw [bind_eq_done]; rintro ⟨_, _, hp, hf⟩
+ rw [static.of_done hp]; exact of_done hf⟩
#align parser.step.bind' Parser.Step.bind'
instance andThen {q : Parser β} [p.step] [q.Static] : (p >> q).step :=
@@ -2087,10 +2027,7 @@ instance and_then' {q : Parser β} [p.Static] [q.step] : (p >> q).step :=
#align parser.step.and_then' Parser.Step.and_then'
instance map [p.step] {f : α → β} : (f <$> p).step :=
- ⟨fun _ _ _ _ => by
- simp_rw [map_eq_done]
- rintro ⟨_, hp, _⟩
- exact of_done hp⟩
+ ⟨fun _ _ _ _ => by simp_rw [map_eq_done]; rintro ⟨_, hp, _⟩; exact of_done hp⟩
#align parser.step.map Parser.Step.map
instance seq {f : Parser (α → β)} [f.step] [p.Static] : (f <*> p).step :=
@@ -2131,9 +2068,7 @@ instance guard : Step (guard False) :=
#align parser.step.guard Parser.Step.guard
instance orelse [p.step] [q.step] : (p <|> q).step :=
- ⟨fun _ _ _ _ => by
- simp_rw [orelse_eq_done]
- rintro (h | ⟨h, -⟩) <;> exact of_done h⟩
+ ⟨fun _ _ _ _ => by simp_rw [orelse_eq_done]; rintro (h | ⟨h, -⟩) <;> exact of_done h⟩
#align parser.step.orelse Parser.Step.orelse
theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).step ↔ p.step :=
@@ -2152,9 +2087,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).step ↔ p.step
#align parser.step.decorate_errors_iff Parser.Step.decorateErrors_iff
instance decorateErrors [p.step] : (@decorateErrors α msgs p).step :=
- ⟨fun _ _ _ _ => by
- rw [decorate_errors_eq_done]
- exact of_done⟩
+ ⟨fun _ _ _ _ => by rw [decorate_errors_eq_done]; exact of_done⟩
#align parser.step.decorate_errors Parser.Step.decorateErrors
theorem decorateError_iff : (@Parser.decorateError α msg p).step ↔ p.step :=
@@ -2241,10 +2174,7 @@ instance digit : digit.step :=
#align parser.step.digit Parser.Step.digit
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.step → (F p).step) : Step (fix F) :=
- ⟨fun cb n _ _ h => by
- haveI := fix_core hF (cb.size - n + 1)
- dsimp [fix] at h
- exact of_done h⟩
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h; exact of_done h⟩
#align parser.step.fix Parser.Step.fix
end Step
@@ -2276,9 +2206,7 @@ theorem many1_eq_done_iff_many_eq_done [p.step] [p.Bounded] {x : α} {xs : List
simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
cases' tl with hd' tl'
· simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
- · rw [← @IH hd' tl'] at hm
- swap
- rfl
+ · rw [← @IH hd' tl'] at hm; swap; rfl
simp only [many1_eq_done, many, foldr] at hm
obtain ⟨np, hp', hf⟩ := hm
obtain rfl : np = n + 1 + 1 := step.of_done hp'
@@ -2297,9 +2225,7 @@ theorem many1_eq_done_iff_many_eq_done [p.step] [p.Bounded] {x : α} {xs : List
cases' tl with hd' tl'
· simpa [many_eq_done_nil, Nat.sub_succ, hk, many_eq_done, hp, foldr_core_eq_done] using hm
· simp [hp]
- rw [← @IH hd' tl' (n + 1) n']
- swap
- rfl
+ rw [← @IH hd' tl' (n + 1) n']; swap; rfl
rw [hk, foldr_core_eq_done, or_comm] at hm
obtain hm | ⟨np, hd', tl', hp', hf, hm⟩ := hm
· simpa using hm
@@ -2318,9 +2244,7 @@ variable {α β : Type} {p q : Parser α} {msgs : Thunk (List String)} {msg : Th
-- see Note [lower instance priority]
instance (priority := 100) of_step [Step p] : Prog p :=
- ⟨fun _ _ _ _ h => by
- rw [step.of_done h]
- exact Nat.lt_succ_self _⟩
+ ⟨fun _ _ _ _ h => by rw [step.of_done h]; exact Nat.lt_succ_self _⟩
#align parser.prog.of_step Parser.Prog.of_step
theorem pure (a : α) : ¬Prog (pure a) := by
@@ -2332,8 +2256,7 @@ theorem pure (a : α) : ¬Prog (pure a) := by
instance bind {f : α → Parser β} [p.Prog] [∀ a, (f a).mono] : (p >>= f).Prog :=
⟨fun _ _ _ _ => by
- simp_rw [bind_eq_done]
- rintro ⟨_, _, hp, hf⟩
+ simp_rw [bind_eq_done]; rintro ⟨_, _, hp, hf⟩
exact lt_of_lt_of_le (of_done hp) (mono.of_done hf)⟩
#align parser.prog.bind Parser.Prog.bind
@@ -2342,10 +2265,7 @@ instance andThen {q : Parser β} [p.Prog] [q.mono] : (p >> q).Prog :=
#align parser.prog.and_then Parser.Prog.andThen
instance map [p.Prog] {f : α → β} : (f <$> p).Prog :=
- ⟨fun _ _ _ _ => by
- simp_rw [map_eq_done]
- rintro ⟨_, hp, _⟩
- exact of_done hp⟩
+ ⟨fun _ _ _ _ => by simp_rw [map_eq_done]; rintro ⟨_, hp, _⟩; exact of_done hp⟩
#align parser.prog.map Parser.Prog.map
instance seq {f : Parser (α → β)} [f.Prog] [p.mono] : (f <*> p).Prog :=
@@ -2383,9 +2303,7 @@ instance guard : Prog (guard False) :=
#align parser.prog.guard Parser.Prog.guard
instance orelse [p.Prog] [q.Prog] : (p <|> q).Prog :=
- ⟨fun _ _ _ _ => by
- simp_rw [orelse_eq_done]
- rintro (h | ⟨h, -⟩) <;> exact of_done h⟩
+ ⟨fun _ _ _ _ => by simp_rw [orelse_eq_done]; rintro (h | ⟨h, -⟩) <;> exact of_done h⟩
#align parser.prog.orelse Parser.Prog.orelse
theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).Prog ↔ p.Prog :=
@@ -2404,9 +2322,7 @@ theorem decorateErrors_iff : (@Parser.decorateErrors α msgs p).Prog ↔ p.Prog
#align parser.prog.decorate_errors_iff Parser.Prog.decorateErrors_iff
instance decorateErrors [p.Prog] : (@decorateErrors α msgs p).Prog :=
- ⟨fun _ _ _ _ => by
- rw [decorate_errors_eq_done]
- exact of_done⟩
+ ⟨fun _ _ _ _ => by rw [decorate_errors_eq_done]; exact of_done⟩
#align parser.prog.decorate_errors Parser.Prog.decorateErrors
theorem decorateError_iff : (@Parser.decorateError α msg p).Prog ↔ p.Prog :=
@@ -2496,10 +2412,7 @@ instance nat : nat.Prog :=
#align parser.prog.nat Parser.Prog.nat
theorem fix {F : Parser α → Parser α} (hF : ∀ p : Parser α, p.Prog → (F p).Prog) : Prog (fix F) :=
- ⟨fun cb n _ _ h => by
- haveI := fix_core hF (cb.size - n + 1)
- dsimp [fix] at h
- exact of_done h⟩
+ ⟨fun cb n _ _ h => by haveI := fix_core hF (cb.size - n + 1); dsimp [fix] at h; exact of_done h⟩
#align parser.prog.fix Parser.Prog.fix
end Prog
@@ -2628,11 +2541,7 @@ theorem nat_of_done {val : ℕ} (h : nat cb n = done n' val) :
when rewriting the definition of `parser.nat` away. Since we know exactly what the function is,
we have a `rfl`-like lemma here to rewrite it back into a readable form.
-/
- have natm : nat._match_1 = fun (d : ℕ) p => ⟨p.1 + d * p.2, p.2 * 10⟩ :=
- by
- ext1
- ext1 ⟨⟩
- rfl
+ have natm : nat._match_1 = fun (d : ℕ) p => ⟨p.1 + d * p.2, p.2 * 10⟩ := by ext1; ext1 ⟨⟩; rfl
-- We also have to prove what is the `prod.snd` of the result of the fold of a `list (ℕ × ℕ)` with
-- the function above. We use this lemma later when we finish our inductive case.
have hpow :
@@ -3000,11 +2909,7 @@ theorem nat_eq_done {val : ℕ} :
when rewriting the definition of `parser.nat` away. Since we know exactly what the function is,
we have a `rfl`-like lemma here to rewrite it back into a readable form.
-/
- have natm : nat._match_1 = fun (d : ℕ) p => ⟨p.1 + d * p.2, p.2 * 10⟩ :=
- by
- ext1
- ext1 ⟨⟩
- rfl
+ have natm : nat._match_1 = fun (d : ℕ) p => ⟨p.1 + d * p.2, p.2 * 10⟩ := by ext1; ext1 ⟨⟩; rfl
-- We induct over the characters available at position `n` and onwards. Because `cb` is used
-- in other expressions, we utilize the `induction H : ...` tactic to induct separately from
-- destructing `cb` itself.
mathlib commit https://github.com/leanprover-community/mathlib/commit/f8c79b0a623404854a2902b836eac32156fd7712
@@ -990,7 +990,7 @@ theorem manyChar_eq_done_not_empty {p : Parser Char} {s : String} (h : s ≠ "")
manyChar p cb n = done n' s ↔
∃ np : ℕ,
p cb n = done np s.headI ∧
- foldrCore List.cons p List.nil (Buffer.size cb - n) cb np = done n' (s.popn 1).toList :=
+ foldrCore List.cons p List.nil (Buffer.size cb - n) cb np = done n' (s.drop 1).toList :=
by simp [many_char, List.asString_eq, String.toList_nonempty h, many_eq_done]
#align parser.many_char_eq_done_not_empty Parser.manyChar_eq_done_not_empty
@@ -1046,7 +1046,7 @@ theorem manyChar1_ne_empty {p : Parser Char} : manyChar1 p cb n ≠ done n' "" :
theorem manyChar1_eq_done {p : Parser Char} {s : String} (h : s ≠ "") :
manyChar1 p cb n = done n' s ↔
- ∃ np : ℕ, p cb n = done np s.headI ∧ manyChar p cb np = done n' (s.popn 1) :=
+ ∃ np : ℕ, p cb n = done np s.headI ∧ manyChar p cb np = done n' (s.drop 1) :=
by
simp [many_char1, List.asString_eq, String.toList_nonempty h, many1_eq_done,
many_char_eq_many_of_to_list]
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -3,12 +3,9 @@ Copyright (c) 2020 Yakov Pechersky. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
-! This file was ported from Lean 3 source module data.buffer.parser.basic
-! leanprover-community/mathlib commit 2220b0cbab795e73674b8191170b0cc68c6b54a8
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-
Porting note:
+
+#align_import data.buffer.parser.basic from "leanprover-community/mathlib"@"2220b0cbab795e73674b8191170b0cc68c6b54a8"
As the parsing framework has completely changed in Lean 4
there is no point porting these files directly.
They can be rewritten from scratch as needed, just as for tactics.
The unported dependencies are