Coercive subtyping: PAL and beyond - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Coercive subtyping: PAL and beyond

Description:

Martin-L f's TT (predicative) CID and ECC/UTT (impredicative) October 28, 2005. 3 ... 'Mathematical pluralism' (e.g. Weyl's predicative math) October 28, 2005. 13 ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 14
Provided by: Irit7
Category:

less

Transcript and Presenter's Notes

Title: Coercive subtyping: PAL and beyond


1
Coercive subtyping PAL and beyond
  • Zhaohui Luo
  • Dept of Computer Science
  • Royal Holloway, Univ of London
  • (In collaboration with Sergei Soloviev)

2
I. Dependent type theories
  • Type theory
  • Curry-Howard principle and canonical objects
  • Dependent TTs
  • Dependent types
  • Inductive types (nats, lists, trees, ordinals,
    )
  • (e.g., universes for reflection)
  • Existing (intensional) TTs
  • Martin-Löfs TT (predicative)
  • CID and ECC/UTT (impredicative)

3
A simple example
  • Type of natural numbers
  • N Type
  • Introduction rules (canonical objects)
  • 0 N
  • n1 N n N
  • Elimination operator
  • for all C Nat?Type, c C(0) and f
    (nNat)C(n)?C(n1),
  • rec(C,c,f,n) C(n)
  • plus the computation rules
  • rec(C,c,f,0) c C(0)
  • rec(C,c,f,n1) f(n,rec(C,c,f,n)) C(n1)

4
Technology and applications
  • Proof technology based on type theories
  • Proof assistants ALF/Agda, Coq, Lego, NuPRL,
    Plastic,
  • Applications
  • Formalisation of mathematics
  • Fundamental Theorem of Algebra, Four-colour
    Theorem,
  • Program verification
  • E.g., security protocols
  • Dependently-typed programming
  • Cayenne, DML, Epigram

5
  • Subtyping in dependent TTs?

6
II. Typing/subtyping two different views
  • View of type assignment
  • Type assignment
  • Objects exist first types are then assigned to
    objects.
  • Overloading ?-terms, which reside in different
    types.
  • Subtyping subsumption
  • a A A?? B
  • ------------------
  • a B

7
  • View of canonical objects
  • Canonical objects
  • Types consist of canonical objects, which do not
    exist without their types.
  • Introduction and elimination rules determine
    canonical objects.
  • Unique typing
  • Subtyping coercive subtyping subtyping as
    abbreviations
  • f A?B a0 A0 A0 ?c A
  • ---------------------------------
  • f(a0) f(c(a0)) B

8
  • Equivalence between subsumption and coercion
  • Only for simple systems (eg, for simply typed
    lambda calculus Mitchell)
  • Difficulty of subsumption with canonical objects
  • a A ? B ? a B (Q Is object a
    canonical in B?)
  • If so, we would in general require bounded
    quantification
  • ?A?B ?CB?Type ?xB instead of ?CB?Type
    ?yB
  • c.f., constructor subtyping Coquand, Barthe
    not well-behaved for canonical inhabitants
  • Two traditional approaches to subtyping
  • Subset/injection (e.g., Even ? N)
  • Inheritance/projection (e.g., record subtyping)
  • Coercive subtyping
  • Solves the above problem with subsumption
  • Subsumes the approaches of injection and
    projection

9
III. Coercive subtyping
  • Framework of coercive subtyping
  • Formulated in (meta-level) logical framework LF
  • A ltc B Type and K ltc K
  • Coherence ? conservativity Soloviev Luo
  • Transitivity elimination Y Luo, Z Luo
    Soloviev
  • Strong/weak transitivity
  • Implementations in proof systems
  • Coq Saibi, Lego Bailey, Plastic Callaghan
  • Applications
  • Proof development (e.g., Bailey)
  • Overloading via coercive subtyping
  • Dependently-typed programming

10
Examples
  • Simple coercions
  • Even ltc N with c e0 ? 0 and e1(x) ? c(x)2
  • where Even has canonical objects e0 and e1(x)
  • ?(A,B) lt?1 A with ?1 (a,b) ? a
  • Coercions between parameterised inductive types
  • List(A) ltmap(c) List(B) for A ltc B
  • Parameterised coercions
  • Vect(n) ltc(n) List with c(n) lta1,, angt ? a1,
    , an
  • Dependent coercions Luo Soloviev
  • x List(A) ltc Vect(x) with c a1, , an ?
    lta1,, angt
  • x ?(A,B) lt?2 B(?1(x)) with ?2 (a,b) ? b

11
III. Coercive subtyping in PAL
  • PAL
  • Lambda-free logical framework
  • Basic concepts in type theory types/objects,
    families of types/objects
  • (not families of families of )
  • Exactly captured in PAL
  • Formally, (?)T where ? ? x1K1, , xnKn and T ?
    Type/El(A)
  • rather than arbitrarily nested (x1K1)(x2K2)
    as in other LFs
  • Parameterisation and definitions
  • as basic notions (instead of ?)
  • universal tools in everyday mathematical work
  • Adequate for specification of type theories
  • E.g., Martin-Löfs type theory, UTT,
  • Related work TF a typed framework Aczel,
    Adams

12
  • Implementations of PAL in UK EPSRC project
    Pythagoras
  • Y Luos system
  • R Pollacks implementation
  • Use of PAL in study of formalisation/foundations
    of math
  • Logic-enriched type theories in PAL
  • Mathematical pluralism (e.g. Weyls predicative
    math)

13
  • Coercive subtyping in PAL
  • A ?c B Type with c A?B
  • (?)T ?c (?)T with c (f(?)T, ?)T
  • ? ?? ?
  • as abbreviation of a sequence of judgements
  • ? being a sequence of coercions
  • Extension to dependent coercions is
    straightforward.
  • Meta-theory
  • Conservativity (detailed checking in progress)
  • Remarks
  • Implementation
  • Using the relationship between coercive subtyping
    and type casting
  • Useful in proof development etc.
Write a Comment
User Comments (0)
About PowerShow.com