Design of the next 7OO Proof Assistants
Gérard
Huet
Pro_let Coq
INRIA Rocquencourt
ffirN*I.a
E6 [ FLoc - Rutgers - July 28th 1ee6 - 1]PLAN
.
General Design Issueso
Zipperso
Bôhm Treeso
Mathematics modellingffitN.*"I.a
E6 [ FLoc - Rutgers - Juty 28th tss6 - 2lGeneral Design Issues
o Why yet
anotherproof
assistant?o
Overall
arch itectu reffitN.xI.a
U I FLoc - Rutgers - Jury 28th 19e6 - 3 ]A few popular proof assistants
o
ACL2I
o
LCF-HOLO NUPRL
o
PVSo rMPS / ff iz &R
o
Isa belleo
Coq-Atf-Legoi oB
o Elf
o
LP,etc
etcffirN*"I.a
E6 [ FLoc - Rutgers - Juty 28th 1ee6 - 4lYAPA?
o Who will
use it?For
what
concrete Purpose?What
isthe
comPetition?o
How could we sharethe
efFort?ffirN.xI.a
E6 [ FLoc - Rutgers - Jury 28th 1ee6 - 5 ]Example 1 : proof trees
o
Should one keep proof trees around?+
Program extraction+ Self-certified
mobile code+ Auditing
proofsin natural
languageSize vs Speed
Decision procedures, rewriting
ffitN.&I.a
E6 [ FLoc - Rutgers - July 28th 1ee6 - 6 ]Example 2: libraries
o What
shouldthe
librarystructure
be?o Modularity,
Namingo
Searchfor
relevant lemmaso
Phase distinctiono
Dependency analysiso
Sharingwith other
siteso
Version ma nagemento
Sharingwith other
provers(qf
D!)ffitN.*"I.a Eô
I FLoC - Rutgers - July 28th 1996 - 7 ]Overa
II
architectu
reo Logical
Frameworko
Algorith mso
Programmabilityo
User interfaceo
User-defined notation?o
Shareddata
baseof
proven factso
User assistanceo
Software eng ineering , toolso Will it
scale up?W /N RIA
E6 [ FLoc - Rutgers - Jury 28th 1ee6 - 8 ]I got this in the mail today
The
following articles are submittedto the
Mizar Mathemat-ical
Library:1. Piotr
Rudnicki and Andrzej Trybulecsubmitted
an articleentitled: "on the
compositionsof
macro instructions"2.
Yatsuka
N a ka m ura
a nd And rzej Trybu lec su bmitted
arti- clesentitled:
"SomeTopological
Propertiesof
Cellsin
p2and "The First Part of
Jordan's Theoremfor
Special poly- gons"3. Noriko Asamoto, Yatsuka Nakamura, piotr
Rudnickiand And
rzej Trybulec submitted
articlesentitled:
"On
the compositionsof macro instructions, Part II" and
"on
the compositionsof
macroinstructions,
PartIII"
The
preprintsof the
above articles are available at:http : / /mat}r-. uw.
bialystok
.pL/ -Form. Math/Preprints Czeslaw BylinskiLibrary
committee of the
Associationof Mizar
Usersft(r N.xI"a
'Ëô [ FLoC - Rutgers - Juty 28th 1ee6 - e ]Abstract Syntax
Any
implementerof a proof
assistant,a
programming envi- ronment,or
aformal computation
system, is faced early onwith the
problemof
designing an abstract syntax framework.Typical
concerns are:o
well-formednesswrt
aritiesof
operatorso list
structureso
binding
operators, loca I defin itionso
recu rsionUsual solutions are:
o
LISPo free
algebras+
listso
pure À-calculus.. À-n lAutomath lElf
ffitN.xI"a
E6 [ FLoC - Rutgers - Jury 28th 1ee6 - 10 ]Managing the state
o
Version ma nagemento
Dumps, Saves, Updateso
Global contexto
Undoo
Pragmas and flagso
Clicking,structure
editingo
Notationo
Applicative structu resvs
Destructive ed itingft{
rN.*"1.a
E6 [ FLoc - Rutgers - July 28th leeo - 11 ]The zipper data structure
o
Mentor,o Applicative
arrays.
Emacso
hierarchical localTuring
machineffitN.*"I"a
E6 [ FLoc - Rutgers - Jury 28th 1ee6 - 12 ]The zipper type
type tree
=Item of int
I
Sectionof tree list;
;type path
= ToPI
Nodeof path * tree list * tree list;
;type location =
Locof tree * path;;
Node(p,I,r)
containsthe father
pathp, its left I
andright r
brother
trees- Note: a path
has brothertrees,
uncle trees, great-uncle trees,etc But its father
is apath, not
atree
likein
Mentor'stree
processor.ffitN.*I"a
E6 [ FLoC - Rutsers - July 28th 1ee6 - 13 ]Updating and Inserting in a zipper
let
change(Loc(-,p)) t = Loc(t,p);;
l-et insert-left (Loc(t,p)) t'
= matchp with ToP
>I lrlode(up,left,right) -> Loc(t',Node(up,left,t
::right))
; ;ffitN.*"I"a
E6 [ FLoc - Rutgers - July 28th 1ee6 - 14 ],d
t\j
l I I ,
aa'
Navigating in a zipper
let left
(Loc(t,p))
= matchp with ToP
>I
Node(up,I::left,right)
>I_
>let
down(Loc(t,p))
= matcht with
Item(_)
>I
Section(t1 : :trees)
>|_
>let up
(Loc(t
, p))
= matchp with ToP
>I
Noae (up,left
,right)
->Loc(Section(concat
(t: :right) tett)
,up) ; ;ft(
rN.*,1"a E6
[ FLoc - Rutgers - Jury 28th rsso - rs ]
Scoping and
parameterization
(À-ca lcu lus issues)
o
namingof
variableso
non-localityof
B-rule.
def in itions.
recu rsion.
a pproximationso proof
searchffitN.*"I"a
E6 [ FLoC - Rutgers - July 28th leeo - 16 ]Bi nd i n g
/ Scopi ng/
N a mi ngA
perplexingstate of
afFairs..
a-conversiono de
BruUn indexeso
com binatorso
Miller
patternso
Pfenning HOASo
Talcott
binding
structu res.
Pollack's meta-theoryof
LEGOo Explicit
su bstitutionsW /N RIA
E6 [ FLoc - Rutgers - July 28th 1ee6 - 17 ]Explicit
substitutions
o Abadi
Cardelli Curien Lévyo
Hardin Lévyo
Lescanne; Rios; Kamareddine.
Mufrozo
Dowek Hardin Kirchnero
etcffitN.*"I.a
E6 [ FLoc - Rurgers - Jury 28th 1e96 - 18 ]Sharing
.
Dags(UNIX
links,TRS,
etc)o
À-ca lcu lus+
Wadsworth+
LévY+
Lamping+ Gonthier l
o
Sharing modulo computing+
symbolic link+
URL
book .ps.gz+
BDDs+
Sharing substitutionsffitN.*"I"a
E6 [ FLoc - Rutgers - July 28th ].ee6 - 1e lAn notations
Annotations
are essential.They
represent pointsof view. It
should be possible
to
add new annotationswithout
changingthe type of the
core structure,
a ndwithout
d istu rba ncefor
processes unconcerned by
this point of
view.OO solution? Methods for copying, moving, etc.
Chet's OO-enginef9r
adding judgementsto
Coq's engine.There
are''à 'number of
featu resto be
addedto
our
theoryin
orderto
meet longterm goals.
These include:(1)
annotations;(2)
generictools for structure walking,
matching and unifi-cation;
a nd(3)
representationof
binding structures in termsof
mutable structu res.(C. Talcott)
ffirN.xI"a
EÉ [ FLoc - Rutgers - July 28th 1ee6 - 20 ]Constraints, unification
Constraints are essential
for
delayingthe
searchfor
existen-cia ls.
o Constr{in}O
resolution\)
o
Prologo Type
reconstructiono Floating
universeso
Linear arithfneticffitN.*"IA
E6 [ FLoC - Rutgers - July 28th 1ee6 - 21 ]À-terms vs Bôhm trees
.\ \ut'\uz'(("r uz) \ug'us)
I
\ ut
u2 'ut(uz, \
u3 ' ue)Èêad normal forms
vs
unsolvablesÀ,r
u2...'t-Ln' u;(Ttr ...rTp)Separability:
Bôhm's theorem.W INRIA
EÉ [ FLoc - Rutgers - July 28th 1,ss6 - 22]Curry-Howard for Sequent Calculus
Proof checking is usually explained on natural deduction for-
mulations, for which (typed)
À-calculusis relevant,
by the Curry-Howardisomorphism.
However,proof
search usually correspondsto
a sequent calculusstructure. This
introduces cumbersome translations betweenthe
proof trees associatedto tactics computations,
andthe proof terms stored
as À-terms j ustif ications.
However,
it
is possibleto
constrain
seq uent ca lcu lus deriva-tions
as Bôhmtrees. This
isactually implicit from
Howard,and was
exactly identified in H.
Herbetin's À-calculusin
histhesis
"Séquentsqu'on calcule"
(Paris7, jan. 95). It
usesa "stoup-ed" notion of
sequent, likein
Girard's LU.ffitN.*I"a
I FLoC - Rutgers - July 28th 1996 - 23 ]Cut-free LJT
+ right , =':oi.'"=
f-; FA+
B À. r,A;Al
BContr ,
ffi Headf
--+ left
:l-;FA f;BlC f;A+BlC Axiom :
r.,A"A nil
Thus the
term U Mt... Mn)
is coded as(
.(U Mr)
M27...M*)
in À-calculus, andf lMti M2,... Mnl in
À-calculus,the
type- freestructure
underlyingLJT.
Notethat the
stoup containsthe
head variable.Intros;
Applyf
.ffitN.xI.a
Et I FLoc - Rutgers - July 28th Lss6 - 241Typing Bôhm trees
When we use Bôhm trees
to
represent proofs in some logical framework, these trees have types correspondingto
formulas(or
more generallyjudgements) of this framework. But
wewant not to
be forcedat
constructionof the
abstract syntaxtrees
representingpartial proof attempts to be obliged to
enforce
the
possibly complextype
maintenance.On
the
other sideof
the spectrum, w€ may consider a Bôhmtree
asjust an untyped À-term, i.e. an element of
somedomain
D verifying
some isomorphismD t!' ID
->D].
Con-sistency in
the
senseof
equational logic isjust
requiringthat D
be non-trivial.ft(r N.xl"a
E6 [ FLoc - Rutsers - July 28th 1ee6 - 2s ]More on typing Bôhm trees
Somewhere
in
betweenwe
maytype
solvableBôhm
trees,of the
form:\ ut
u2...'tLn'u(Tt,
...rTp)by their
shape(-,n - p), consisting of the pair head (-)
and difFerential
arity
(n- p).
For a closedtree,
rn:'u,ftt
andthen
the
head indicatesthe
indexof
sequentialityk,
whereasthe
difFerentialarity
isa
kindof
coercionspecification.
The shape maybe
read asa type
Dn+ D klpl, specifying:
thisterm is a functional value in Dn + D,
wheneverits
mainargument
æpis
coercedto a functional value in Dp +
D.Note
that
thistype
is invariant by th€ 4 rule, andthus
makes sense asa partition of the
extensionalmodel
Dca.ft( t N.*"1"a
'86 [ FLoC - Rutgers - Jury 28th rss6 - 26]Systems of
guarded com binators
Definitions. We
assume giventwo
disjoint.denumerable al- phabetsof
symbols:X: {Xr,X2,...}
isthe
setof
combina'forsymbols,l,{ -- {ut,u2,...}
is the setof
parameter symbols.Intuitively,
combinators name Bôhm trees, whereas parame-ters
name bound À-variables.We call Bôhm tree presentation
with
respectto
thesetwo
al- phabets any denumerable system of equations:t : {Et,82,
...},with
E6 . X6 u1 u2...r1ni
'-
11,ki(Mt,..., Mpt) where 1<
k61n;,
O4 p;, X;
eX,
andfor
Yj 1 p; Mj : Xq'(rt,
...,ut6,i)with
L< kt,j
Snt
and{rt,...,uli,j}
Ç{"r,,...,uni} çU.
We
assumefurthermore the
systemto be deterministic,
inthe
sensethat
everyX € N
possessesat most
one definingequation in t. We
saythat it is total when
everyX € X
possesses exactly one defining equation
in t.
ffitN.x!"a
EÉ [ FLoc - Rutgers - July 28th 7ss6 - 27 ]Exa m
ples
We remark
that
Bôhmtree
presentations are general enoughto
representarbitrary families of finitely generated
Bôhmtrees, which is
enoughfor
instanceto
representthe
Bôhm treesof
anyÀ-terms. But they permit to do more, in that
we may represent dags and looping
structures.
For instance,the
À-termin
normalform \ut uz.(ut ),u.(u u) ),u-u)
maybe presented as
X in the
systemX ut u2 l-
u1(D,I) D u '- u(I(u)) I ru :-
rt)with
sharingof
combinator/.
Whereas
the
singleequation Z u .- u(Z)
defines asZ
theinfinite tree
Àut . u1(),u2 . u2( ..))ffirN.xI.a
I FLoC - Rutgers - July 28th 1996 - 28 ]Other
exa mples
Another
example isthe fixpoint
combinatorY,
withY f :: fVU))
Still
another example, also denoting aninfinite
Bôhmtree,
isJ
presented bythe system: J * a:: *(l(A)). It
isthe
Bôhmtree of À-term (Y
^j
),r,),y
(æ(j s))), for Y any fixpoint
combinator such as Curry's.Remark
that
recursionis natural and more canonical,
andthat computation is
morelocal than B-reduction. Also
de- finedness is atomic.ft(
rN.*"1.a
E6[ FLoc - Rutgers - July 28th leeo - 2e ]
Regular Bôhm trees
Definition. We call
regular anyfinite Bôhm tree
presenta-tion.
S uc.h presentations define Bôh m trees wh ich are reg u-lar in
the
senseof admitting
only afinite
numberof distinct
subtrees, upto
variable renaming.Theorem. It
is decidable whethert I M - l'r for
any regulart
and simple expressionsM
and^f
.
( For a ppropriate notions
F
a nd sim ple) .ffirN.xI"a
I FLoC - Rutgers - July 28th 1996 - 30 ]Other issues
From À-calculus
to
Bôhm treesto Automath to
Coq...Constants. Let or A-T
pairsor A-T couples. Other
judge-ments.
Structure of the context. Sections,
Parag ra phs,Mlodules. Meta-variables.
Unification.
Constraints.Control of totality.
Control of
u nfold ing,
opacity, a bstraction.Tactics'
W /NRIA
E6 [FLoc - Rutgers - Juty 2eth 1ee6 - 31]Ind uction
Should induction be primitive (Martin-Lôf) or
axiomatised(Isa b el le) ?
Four
propertiesof
inductive types.o
Closed: nojunk
o Free:
no confusiono
Ind uction:
f initely
generated ..
Dependance:elimination
by pattern-matching.Guarded general recursion vs
primitive
recursion.ffitN.xI.a
E6 [ FLoc - Rutgers - July 28th leeo - 32 ]How powerful should the framework be?
In other words, how much mathematical
knowledge should be internalizedin the proof assistant? E.g.
equality, induc-tion,
SUbstitution, sharing, decision procedures.The
more we add,the
less we may share developments.Extreme
view: PRA
asthe
framework.Ref lexion.
Bootstra pping .
E6 [ FLoc - Rutgers - Juty 28th leeo - 33 ]
W lNRIA
Mathematics modelling
Mathematics
is
rigorous knowledge representation.It
com-bines com
putation in
concrete structu reswith
abstract
rea-son
ing in
log ica I systems.There
are historically4
generationsof
computerized math- ematics:1
com puters2
programming languages3
symboliccomputation
systems4
proof-checked formaI
mathematicsProof
assistantspotentially open the
wayto the 4tn
gen-eration of
computerized mathematicsmodelling. BUT
theywill not
replacewell understood more eflicient
paradigmsof the
lower levels:floating point computation,
imperativeprog ra m m ing
,
verification of
f inite-state
systemsby
B D Dtechniques. The smooth integration of the full range of
puterized mathematics tools is the
great
cha llengeof
com