Package parser-stream: Parse streams
Information
name | parser-stream |
version | 1.36 |
description | Parse streams |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
requires | bool function pair natural relation option list |
show | Data.Bool Data.List Data.Option Data.Pair Function Number.Natural Parser.Stream Relation |
Files
- Package tarball parser-stream-1.36.tgz
- Theory file parser-stream.thy (included in the package tarball)
Defined Type Operator
- Parser
- Stream
- stream
- Stream
Defined Constants
- Parser
- Stream
- append
- case
- eof
- error
- fromList
- isProperSuffix
- isSuffix
- length
- stream
- toList
- Stream
Theorems
⊦ wellFounded isProperSuffix
⊦ ¬(error = eof)
⊦ length eof = 0
⊦ length error = 0
⊦ toList error = none
⊦ ∀x. isSuffix x x
⊦ toList eof = some []
⊦ ∀s. ¬isProperSuffix s eof
⊦ ∀s. ¬isProperSuffix s error
⊦ ∀x. ¬isProperSuffix x x
⊦ ∀s. append [] s = s
⊦ ∀l. fromList l = append l eof
⊦ ∀l. length (fromList l) = length l
⊦ ∀l. toList (fromList l) = some l
⊦ ∀a0' a1'. ¬(eof = stream a0' a1')
⊦ ∀a0' a1'. ¬(error = stream a0' a1')
⊦ ∀x y. isProperSuffix x y ⇒ isSuffix x y
⊦ ∀a s. length (stream a s) = suc (length s)
⊦ ∀s. case toList s of none → T | some l → length l = length s
⊦ ∀e b f. case e b f eof = b
⊦ ∀e b f. case e b f error = e
⊦ ∀x y. isProperSuffix x y ⇒ length x < length y
⊦ ∀x y. isSuffix x y ⇒ length x ≤ length y
⊦ ∀l s. length (append l s) = length l + length s
⊦ ∀s s'. isSuffix s s' ⇔ s = s' ∨ isProperSuffix s s'
⊦ ∀h t s. append (h :: t) s = stream h (append t s)
⊦ ∀x y z. append (x @ y) z = append x (append y z)
⊦ ∀x y z. isProperSuffix x y ∧ isProperSuffix y z ⇒ isProperSuffix x z
⊦ ∀x y z. isSuffix x y ∧ isSuffix y z ⇒ isSuffix x z
⊦ ∀a s.
toList (stream a s) =
case toList s of none → none | some l → some (a :: l)
⊦ ∀l s.
toList (append l s) =
case toList s of none → none | some ls → some (l @ ls)
⊦ ∀s a s'. isProperSuffix s (stream a s') ⇔ s = s' ∨ isProperSuffix s s'
⊦ ∀x. x = error ∨ x = eof ∨ ∃a0 a1. x = stream a0 a1
⊦ ∀p. (∀x. (∀y. isProperSuffix y x ⇒ p y) ⇒ p x) ⇒ ∀x. p x
⊦ ∀e b f a s. case e b f (stream a s) = f a s
⊦ ∀a0 a1 a0' a1'. stream a0 a1 = stream a0' a1' ⇔ a0 = a0' ∧ a1 = a1'
⊦ ∀P. P error ∧ P eof ∧ (∀a0 a1. P a1 ⇒ P (stream a0 a1)) ⇒ ∀x. P x
⊦ ∀f0 f1 f2.
∃fn.
fn error = f0 ∧ fn eof = f1 ∧
∀a0 a1. fn (stream a0 a1) = f2 a0 a1 (fn a1)
⊦ ∀h.
(∀f g s. (∀s'. isProperSuffix s' s ⇒ f s' = g s') ⇒ h f s = h g s) ⇒
∃f. ∀s. f s = h f s
Input Type Operators
- →
- bool
- Data
- List
- list
- Option
- option
- Pair
- ×
- List
- Number
- Natural
- natural
- Natural
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∃!
- ∨
- ¬
- cond
- F
- T
- List
- ::
- @
- []
- length
- Option
- case
- none
- some
- Pair
- ,
- Bool
- Function
- id
- Number
- Natural
- *
- +
- <
- ≤
- bit0
- bit1
- even
- exp
- suc
- zero
- Natural
- Relation
- irreflexive
- measure
- subrelation
- wellFounded
Assumptions
⊦ T
⊦ ¬F ⇔ T
⊦ ¬T ⇔ F
⊦ length [] = 0
⊦ bit0 0 = 0
⊦ ∀t. t ⇒ t
⊦ ∀n. 0 ≤ n
⊦ ∀n. n ≤ n
⊦ ∀m. wellFounded (measure m)
⊦ F ⇔ ∀p. p
⊦ ∀x. id x = x
⊦ (¬) = λp. p ⇒ F
⊦ (∃) = λP. P ((select) P)
⊦ ∀a. ∃!x. x = a
⊦ ∀t. (∀x. t) ⇔ t
⊦ ∀t. (∃x. t) ⇔ t
⊦ ∀t. (λx. t x) = t
⊦ (∀) = λp. p = λx. T
⊦ ∀t. ¬¬t ⇔ t
⊦ ∀t. (T ⇔ t) ⇔ t
⊦ ∀t. (t ⇔ T) ⇔ t
⊦ ∀t. F ∧ t ⇔ F
⊦ ∀t. T ∧ t ⇔ t
⊦ ∀t. t ∧ F ⇔ F
⊦ ∀t. t ∧ T ⇔ t
⊦ ∀t. F ⇒ t ⇔ T
⊦ ∀t. T ⇒ t ⇔ t
⊦ ∀t. t ⇒ T ⇔ T
⊦ ∀t. F ∨ t ⇔ t
⊦ ∀t. T ∨ t ⇔ T
⊦ ∀t. t ∨ F ⇔ t
⊦ ∀t. t ∨ T ⇔ T
⊦ ∀n. ¬(suc n = 0)
⊦ ∀n. 0 + n = n
⊦ ∀m. m + 0 = m
⊦ ∀l. [] @ l = l
⊦ ∀r. wellFounded r ⇒ irreflexive r
⊦ ∀t. (F ⇔ t) ⇔ ¬t
⊦ ∀t. (t ⇔ F) ⇔ ¬t
⊦ ∀t. t ⇒ F ⇔ ¬t
⊦ ∀n. even (2 * n)
⊦ ∀n. bit1 n = suc (bit0 n)
⊦ ∀m. exp m 0 = 1
⊦ ∀x. case none some x = x
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t. (t ⇔ T) ∨ (t ⇔ F)
⊦ ∀n. even (suc n) ⇔ ¬even n
⊦ ∀m. m ≤ 0 ⇔ m = 0
⊦ ∀t1 t2. (if F then t1 else t2) = t2
⊦ ∀t1 t2. (if T then t1 else t2) = t1
⊦ ∀b f. case b f none = b
⊦ ∀n. bit0 (suc n) = suc (suc (bit0 n))
⊦ ∀f y. (let x ← y in f x) = f y
⊦ ∀x y. x = y ⇔ y = x
⊦ ∀t1 t2. t1 ∨ t2 ⇔ t2 ∨ t1
⊦ ∀m n. m < n ⇒ m ≤ n
⊦ ∀r x. irreflexive r ⇒ ¬r x x
⊦ ∀n. 2 * n = n + n
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ ∀m n. ¬(m < n ∧ n ≤ m)
⊦ ∀m n. ¬(m ≤ n ∧ n < m)
⊦ ∀m n. m < suc n ⇔ m ≤ n
⊦ ∀m n. suc m ≤ n ⇔ m < n
⊦ ∀x. x = none ∨ ∃a. x = some a
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ ∀P. ¬(∀x. P x) ⇔ ∃x. ¬P x
⊦ ∀P. ¬(∃x. P x) ⇔ ∀x. ¬P x
⊦ (∃) = λP. ∀q. (∀x. P x ⇒ q) ⇒ q
⊦ ∀t1 t2. ¬(t1 ⇒ t2) ⇔ t1 ∧ ¬t2
⊦ ∀m n. m + suc n = suc (m + n)
⊦ ∀m n. suc m + n = suc (m + n)
⊦ ∀m n. suc m = suc n ⇔ m = n
⊦ ∀r s. subrelation r s ∧ wellFounded s ⇒ wellFounded r
⊦ ∀b f a. case b f (some a) = f a
⊦ ∀t1 t2. ¬(t1 ∧ t2) ⇔ ¬t1 ∨ ¬t2
⊦ ∀m n. even (m * n) ⇔ even m ∨ even n
⊦ ∀m n. even (m + n) ⇔ even m ⇔ even n
⊦ ∀m n. exp m (suc n) = m * exp m n
⊦ ∀f g. (∀x. f x = g x) ⇔ f = g
⊦ ∀P a. (∃x. a = x ∧ P x) ⇔ P a
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀m n. m ≤ n ⇔ m < n ∨ m = n
⊦ ∀m n. m ≤ n ∧ n ≤ m ⇔ m = n
⊦ ∀m x y. measure m x y ⇔ m x < m y
⊦ ∀P Q. (∀x. P ∨ Q x) ⇔ P ∨ ∀x. Q x
⊦ ∀P Q. (∃x. P ∧ Q x) ⇔ P ∧ ∃x. Q x
⊦ ∀P Q. P ∧ (∀x. Q x) ⇔ ∀x. P ∧ Q x
⊦ ∀P Q. P ∧ (∃x. Q x) ⇔ ∃x. P ∧ Q x
⊦ ∀P Q. P ∨ (∀x. Q x) ⇔ ∀x. P ∨ Q x
⊦ ∀P Q. P ∨ (∃x. Q x) ⇔ ∃x. P ∨ Q x
⊦ ∀P Q. (∃x. P x) ∧ Q ⇔ ∃x. P x ∧ Q
⊦ ∀P Q. (∃x. P x) ∨ Q ⇔ ∃x. P x ∨ Q
⊦ ∀t1 t2 t3. (t1 ∧ t2) ∧ t3 ⇔ t1 ∧ t2 ∧ t3
⊦ ∀t1 t2 t3. (t1 ∨ t2) ∨ t3 ⇔ t1 ∨ t2 ∨ t3
⊦ ∀m n p. m * (n * p) = m * n * p
⊦ ∀m n p. m + p = n + p ⇔ m = n
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀P x. (∀y. P y ⇔ y = x) ⇒ (select) P = x
⊦ ∀P. (∀x. ∃y. P x y) ⇔ ∃y. ∀x. P x (y x)
⊦ ∀m n. m ≤ suc n ⇔ m = suc n ∨ m ≤ n
⊦ ∀m n. m * n = 0 ⇔ m = 0 ∨ n = 0
⊦ ∀P. P 0 ∧ (∀n. P n ⇒ P (suc n)) ⇒ ∀n. P n
⊦ ∀m n. exp m n = 0 ⇔ m = 0 ∧ ¬(n = 0)
⊦ ∀r s. subrelation r s ⇔ ∀x y. r x y ⇒ s x y
⊦ (∃!) = λP. (∃) P ∧ ∀x y. P x ∧ P y ⇒ x = y
⊦ ∀P Q. (∀x. P x ∧ Q x) ⇔ (∀x. P x) ∧ ∀x. Q x
⊦ ∀P Q. (∀x. P x ⇒ Q x) ⇒ (∀x. P x) ⇒ ∀x. Q x
⊦ ∀P Q. (∀x. P x ⇒ Q x) ⇒ (∃x. P x) ⇒ ∃x. Q x
⊦ ∀P Q. (∀x. P x) ∧ (∀x. Q x) ⇔ ∀x. P x ∧ Q x
⊦ ∀e f. ∃!fn. fn 0 = e ∧ ∀n. fn (suc n) = f (fn n) n
⊦ ∀P. P [] ∧ (∀a0 a1. P a1 ⇒ P (a0 :: a1)) ⇒ ∀x. P x
⊦ ∀m n p. m * n = m * p ⇔ m = 0 ∨ n = p
⊦ ∀m n p. m * n ≤ m * p ⇔ m = 0 ∨ n ≤ p
⊦ ∀m n p. m * n < m * p ⇔ ¬(m = 0) ∧ n < p
⊦ ∀x y a b. (x, y) = (a, b) ⇔ x = a ∧ y = b
⊦ ∀A B C D. (A ⇒ B) ∧ (C ⇒ D) ⇒ A ∧ C ⇒ B ∧ D
⊦ ∀A B C D. (A ⇒ B) ∧ (C ⇒ D) ⇒ A ∨ C ⇒ B ∨ D
⊦ ∀A B C D. (B ⇒ A) ∧ (C ⇒ D) ⇒ (A ⇒ C) ⇒ B ⇒ D
⊦ ∀P. (∀x. ∃!y. P x y) ⇔ ∃f. ∀x y. P x y ⇔ f x = y
⊦ ∀P c x y. P (if c then x else y) ⇔ (c ⇒ P x) ∧ (¬c ⇒ P y)
⊦ ∀NIL' CONS'.
∃fn. fn [] = NIL' ∧ ∀a0 a1. fn (a0 :: a1) = CONS' a0 a1 (fn a1)
⊦ ∀P. (∃!x. P x) ⇔ (∃x. P x) ∧ ∀x x'. P x ∧ P x' ⇒ x = x'
⊦ ∀r. wellFounded r ⇔ ∀p. (∀x. (∀y. r y x ⇒ p y) ⇒ p x) ⇒ ∀x. p x