Package char-def: Definition of Unicode characters

Information

namechar-def
version1.93
descriptionDefinition of Unicode characters
authorJoe Leslie-Hurd <joe@gilith.com>
licenseMIT
provenanceHOL Light theory extracted on 2012-12-10
requiresbool
byte
natural
pair
word16
showData.Bool
Data.Byte
Data.Char
Data.Pair
Data.Word16
Number.Natural
Probability.Random

Files

Defined Type Operators

Defined Constants

Theorems

p. isPosition p

a. mkChar (destChar a) = a

a. mkPlane (destPlane a) = a

a. mkPosition (destPosition a) = a

r. destPosition (mkPosition r) = r

r. isPlane r destPlane (mkPlane r) = r

r. isChar r destChar (mkChar r) = r

p. isPlane p p < 17

r.
    positionFromRandom r = let (w, r') fromRandom r in (mkPosition w, r')

r.
    planeFromRandom r =
    let (n, r') Uniform.fromRandom 17 r in (mkPlane (fromNatural n), r')

pl pos.
    isChar (pl, pos)
    let pli destPlane pl in
    let posi destPosition pos in
    ¬(pli = 0) posi < 55296 57343 < posi posi < 65534

r.
    fromRandom r =
    let (pl, r') planeFromRandom r in
    let pli destPlane pl in
    let (pos, r'')
        if ¬(pli = 0) then positionFromRandom r'
        else
          let (n, r''') Uniform.fromRandom 63486 r' in
          let n' if n < 55296 then n else n + 2048 in
          (mkPosition (fromNatural n'), r''') in
    (mkChar (pl, pos), r'')

External Type Operators

External Constants

Assumptions

¬

¬

bit0 0 = 0

t. t t

n. 0 n

p. p

t. t ¬t

(¬) = λp. p

() = λp. p ((select) p)

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 t

t. t t

t. t t t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

n. ¬(suc n = 0)

n. 0 * n = 0

m. m * 0 = 0

n. 0 + n = n

m. m + 0 = m

modulus = 2 width

width = 8

t. ( t) ¬t

t. (t ) ¬t

t. t ¬t

n. bit1 n = suc (bit0 n)

m. m 0 = 1

m. m * 1 = m

m. 1 * m = m

() = λp q. p q p

t. (t ) (t )

n. even (suc n) ¬even n

m. m 0 m = 0

n. toNatural (fromNatural n) = n mod modulus

a b. fst (a, b) = a

a b. snd (a, b) = b

n. bit0 (suc n) = suc (suc (bit0 n))

t1 t2. t1 t2 t2 t1

m n. m + n = n + m

n. 2 * n = n + n

m n. ¬(m n) n < m

m n. suc m n m < n

() = λp q. (λf. f p q) = λf. f

p. ¬(x. p x) x. ¬p x

() = λp. q. (x. p x q) q

x y. x < y toNatural x < toNatural y

m n. m + suc n = suc (m + n)

m n. suc m + n = suc (m + n)

m n. suc m = suc n m = n

m n. even (m * n) even m even n

m n. even (m + n) even m even n

m n. m * suc n = m + m * n

m n. m suc n = m * m n

m n. suc m * n = m * n + n

() = λp q. r. (p r) (q r) r

m n. m n m < n m = n

m n. m n n m m = n

p q. p (x. q x) x. p q x

t1 t2 t3. (t1 t2) t3 t1 t2 t3

m n p. m + (n + p) = m + n + p

m n. m suc n m = suc n m n

x y. fromNatural x = fromNatural y x mod modulus = y mod modulus

m n. m * n = 0 m = 0 n = 0

p. p 0 (n. p n p (suc n)) n. p n

m n p. m * (n + p) = m * n + m * p

m n p. m (n + p) = m n * m p

m n p. (m + n) * p = m * p + n * p

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

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

m n q r. m = q * n + r r < n m div n = q

m n q r. m = q * n + r r < n m mod n = r