MamounFilali
laliirit.fr
IRITCNRS
UniversitéPaulSabatier
118RoutedeNarnonne
F-31062Toulouse Frane
Abstrat. We study the mehanization of phylogeneti trees inhigher order logi.
After haraterizing trees within suh a logi, we state how to reason and to om-
puteaboutthem.Weintroduethesoalledgenerativepartitionsandrelationswhose
purposeis toallowthereonstrution ofatreefromitsleaves. Afterintroduingtree
transformations, we dene the graft operation. and onsider suient onditions for
thepreservationofthegenerativepartitionsorrelationsafteragraft.Itfollowsthatwe
anreonstrutatreegivenitssetofleavesanditsgenerativerelationwhihhasbeen
preservedalongthegrowthofthetree.Weapplythis resulttothereonstrutionofa
distributedomputation.
keywords:HOL,treestruture,veriation,ISAR.
1 Introdution
This paper gives a denitional formalization, in higher order logi (HOL), of
phylogenetitrees. Wealsoformalizehowtoreasonand ompute onsuhtrees.
We dene the notion of a generative relation, that aims at haraterizing in-
formation whihenables to rebuild atree. Finally,we propose a reonstrution
algorithm based on the set of leaves and a generative relation. The orretness
ofthealgorithmisestablished.Weintrodueanoperation,the graft,thatallows
to represent the growth of atree. a graftare stated.Weillustrate suh areon-
strution throughtheso-alledleafvetorsandaonretegenerativerelation.It
should bestressed that our study isnot onlyonerned withthe proposalof an
original algorithmbut alsoby theformal denitionsand proofs withina logial
framework.
The rest of this paper is organized as follows: Setion 2 gives the repre-
sentationand thebasi operations.Setion3introduesthegraftoperationand
studiesitsreonstrutionproperties.Setion4presentsaonreteexamplewhere
we apply the reonstrution algorithm. Setion 5 ontains the onlusions and
related works.
2 A phylogeneti tree representation and basi operations
In this setion, we introdue the formal representation of phylogeneti trees;
For suh a representation, we onsider how toreason about itand how toom-
with set theory only, we use type theoreti reasoning also. We have done the
mehanizationwithintheIsabellelogialframework[13℄. Atually,wehaveused
the Isabelle/Isar 1
[19℄ environment whih goal is to assist in the development
of human-readable proof douments omposed by the user and heked by the
mahine.
2.1 Notations and basi denitions
In this setion, we reall the basi set theory and order notions, wewill use.We
hope that the name of the denitions and their formal expression are self ex-
planatory.We have used thedenitions given in [6℄.Moreover, we expressthem
in the Isabellesyntax [13℄. For eah denition, rst, we give its signature, then
its formalexpression. For instane, we haveused the following denitions:
"Maximal
, λ
S. {m∈
S.∀
m'∈
S. m⊆
m'⇒
m = m'}""Down
, λ
(S,e). {s∈
S. s⊆
e}"" PDown
, λ
(S,e). {s∈
S. s⊂
e}"−−
{∗
proper partition∗
}"PPartition
, λ
(n,S).Partition(n,S)∧
(∀
e∈
S. e⊂
n)""A//r
, S
x
∈
A. {r``{x}}"−−
{∗
set of equiv lasses∗
}In Isabelle, the reexive transitive losure of relation r, denoted r
ˆ⋆
, is in-troduedas anindutivedata type[2℄. Itsintrodutionrules are rtranl_refl
whih speies that every ouple (a,a) belongs to the transitive losure, and
rtranl_into_rtranl whihspeiesthat if (a,b) belongstor
ˆ⋆
and(b,)belongsto r, then (a,) belongs alsotor
ˆ⋆
.indutive "r^
∗
"intros
rtranl_refl : "(a, a)
∈
r^∗
"rtranl_into_rtranl :
"(a, b)
∈
r^∗ = ⇒
(b, )∈
r= ⇒
(a, )∈
r^∗
"Withrespet tothe proofs,wehave usedthe Isabelle/Isarformat.Aproof is
established by asequene of intermediate results whih has to beproved reur-
sively or already established. Eventually, results are justied either as axioms
of the logi or by rules of the logi. With respet to proofs, Isar promotes the
1
so alled delarative style [18℄ whih is loser to the usual mathematial rea-
soningthan theproeduralformat.Letusmention that,basially,Isarsupports
natural dedution but alsosupports alulationalreasoning [7℄.
Asanexample,thefollowingstatementwhihonsistsinassumptions 2
(assumes),
a onlusion (shows) and a proof sript (proof) establishes that the union of
two hierarhies (see setion 2.2) is also a hierarhy. A basi statement of the
proof has the format:
from h
fatsi have
label′ : ′ h
propositioni by h
methodi
whih aimisto establishproposition fromfats by applying method.
t h e o r e m Hierarhy_union:
assumes h1:"H1
∈
Hierarhy"assumes h2:"H2
∈
Hierarhy"assumes s: "
∀
n1∈
H1.∀
n2∈
H2. SDS(n1,n2)"s h o w s "(H1
∪
H2)∈
Hierarhy"proof
−
f r o m h1 h2 h a v e e: "
∅ 6∈
H1∪
H2" by (unfoldHierarhy_def , blast)
f r o m s h a v e "
∀
n1∈
H1.∀
n2∈
H2. SDS(n2,n1)"by (auto simp only: SDS_def)
f r o m this h a v e "
∀
n1∈
H2.∀
n2∈
H1. SDS(n1,n2)" byauto
f r o m s this h1 h2 h a v e sds: "
∀
n1∈
H1∪
H2.∀
n2∈
H1∪
H2. SDS(n1,n2)"
by (unfold Hierarhy_def , blast)
f r o m h1 h2 h a v e f : "finite (H1
∪
H2)" by (unfoldHierarhy_def , auto)
f r o m h1 h2 h a v e "
∀
n∈
H1∪
H2. finite n" by(unfoldHierarhy_def , auto)
f r o m e sds f this show ?thesis by (unfold Hierarhy_def ,
blast)
q e d
2.2 Hierarhies and trees
Our mehanization is based on the introdution of phylogeneti trees starting
from the basi notionsof set theory. Forsuh a purpose, we rst onsider hier-
arhies [3℄ and then introdue trees as restrited hierarhies. Along with these
hierarhies, wegivesome general denitions that willbe used later.
2
The basi idea of the following representations is to infer a struture from
the relationsbetween itselements;the strutureis not enoded diretly.Suh a
ontent based enoding is motivated by the fat that our basi onern is the
reonstrution startingfromsome oftheelements,namelytheleaves,ofthetree
struture.
Hierarhies. We rst introdue ageneri graphas aset ofnodes. Anode is a
set of generielements.
types
'e graph = "('e set) set"
−−
{∗
generi graph∗
}'e node = "('e set)"
−−
{∗
generi node∗
}Hierarhies are nite graphs whih elements are nite and non empty and
obey to the SDS: Subset Disjoint Subset relation:
"SDS
, λ
(s1 ,s2). s1⊆
s2∨
s1∩
s2 =∅ ∨
s2⊆
s1""Hierarhy
,
{H. finite(H)∧
(∀
n∈
H. finite(n))∧ ∅ 6∈
H∧
(∀
n1∈
H.∀
n2∈
H. SDS (n1,n2))}"
In the following, we give the formaldenitions that willbe used.
"Leaves
, λ
h. {l∈
h. PDown(h,l) =∅
}""ROOT
, λ
h.S
h"
"Subtrees
, λ
t. image (λ
e. Down(t,e)) (Maximal(t))"−−
{∗
proper subtrees∗
}"PSubtrees
, λ
t. Subtrees (t−
Maximal(t))"−−
{∗
roots of proper subtrees , hild nodes∗
}"R1
, λ
t. image ROOT (PSubtrees(t))""Sigma
, λ
S. {S
(
S
S)}
∪
(S
S)"
Dueto the lak of spae,we donot state allthe establishedresults. Wewill
givethem on the y whenneeded.
Trees and phylogeneti trees. Starting from hierarhies, we rst dene a
"Tree
,
{h∈
Hierarhy. Maximal(h) = {ROOT(h)}}"Then,we introduephylogeneti treesas treeswhihnodes are either leaves
or the union of allits subnodes:
"Phylo
,
{t
∈
Tree.∀
n∈
t. n∈
Leaves(t)∨
n =S
PDown(t,n)}"
With respet to phylogeneti trees, we just mention the following equality
that willallowus to say that the reonstrution an proeed starting from the
leaves, whilethestatementofthe reonstrutiontheorem isoverthe root.Atu-
ally, for a phylogeneti tree
t
, we have: ROOT(t) = S
Leaves
(t)
. Moreover, wewill relyon the following result about the union of phylogenetitrees:
lemma phylo_union:
assumes t1: "t1
∈
Phylo"assumes t2: "t2
∈
Phylo"assumes u: "ROOT(t2)
∈
Leaves(t1)"s h o w s "t1
∪
t2∈
Phylo"proof ... q e d
Examples. Thegure1illustratestherepresentationof phylogenetitrees.For
instane, with respet tothe previous denitions and the tree lett2, we have:
t0 {x}
{a,e,b}
{a} {e} {b}
t1
{x,y,a,e,b,u,v,w}
{x,y} {a,e,b} {u,v,w}
{x} {y} {a} {e} {b} {u} {v} {w}
t2
t2 = {{x, y, a, e, b, u, v, w}, {x, y}, {x}, {y}
, {a, e, b}, {a}, {e}, {b}, {u, v, w}, {u}, {v}, {w}}
Leaves
(t2) = {{x}, {y}, {a}, {e}, {b}, {u}, {v}, {w}}
ROOT
(t2) = {x, y, a, e, b, u, v, w}
R1
( t 2) = {{x, y }, {a, e, b}, {u, v, w}}
The deomposition and indution theorems. In order to reason about
phylogeneti trees, we rst introdue a deomposition theorem: a tree is either
a singletonontainingits ROOT, orthe sum (Sigma) of its proper subtrees.
t h e o r e m phylo_ases:
assumes t: "t
∈
Phylo"s h o w s "t = {ROOT(t)}
∨
t = Sigma (PSubtrees(t))"proof ... q e d
We state the indution theorem about phylogeneti trees as follows:
t h e o r e m phylo_indut:
assumes b: "
∀
e. P({e})"assumes r: "
∀
T∈
domSigma. (∀
t∈
T. t∈
Phylo∧
P(t))⇒
P(Sigma(T))"s h o w s "
∀
t∈
Phylo. P(t)"proof ... q e d
where domSigma speies the set of trees whih an be joined to form a phy-
logenetitree:
"domSigma
,
{S. S
6= ∅ ∧
finite(S)∧
S⊆
Tree∧
(∀
t1∈
S.∀
t2∈
S. t16=
t2⇒ S
t1
∩ S
t2 =
∅
)∧
PPartition(S S
S, image ROOT S)
}"
2.3 Transformations
The basi property of the studiedtransformations istopreserve the underlying
struture while transforming the nodes.
Hierarhy transformations and preservation theorem. First, we intro-
due generaltransformationswhihbasi property istopreserve theardinality
of a set of nodes.
"G _ t r
, λ
g. {tr.∀
n1∈
g.∀
n2∈
g.(tr(n1) = tr(n2)) = (n1 = n2)}"
A hierarhy transformation is a generaltransformation whih preserves the
relations between the nodes of a hierarhy:
{
∗
hierarhy transformations set∗
}"H_tr
, λ
h.{tr
∈
G _ t r(h). (∀
n∈
h. finite(n)⇒
finite(tr(n)))∧
(∀
n∈
h. n6= ∅ ⇒
tr(n)6= ∅
)∧
(∀
n1∈
h.∀
n2∈
h. n1⊆
n2⇒
tr(n1)⊆
tr(n2))∧
(∀
n1∈
h.∀
n2∈
h. n1∩
n2 =∅ ⇒
tr(n1)∩
tr(n2) =∅
)}"
A hierarhy is preserved by a hierarhy transformation:
t h e o r e m hierarhy_trans:
assumes t: "t
∈
Hierarhy"assumes tr: "tr
∈
H_tr(t)"s h o w s "image tr t
∈
Hierarhy"proof ... q e d
A tree isalso preserved by a hierarhy transformation.
Phylogeneti transformations and preservation theorem. Intuitively,
when aphylogenetitransformationisappliedtoanon-leafnode, the deompo-
sition into its desendant nodes is preserved. The haraterizing property of a
phylogeneti transformationis expressed asfollows:
"P_tr
, λ
h. { tr∈
H_tr(h).∀
n∈
h.n
∈
Leaves(h)∨
tr(n) =S
(image tr (R1(Down(h,n))))}"
Then,we state the preservation theorem:
t h e o r e m phylo_trans:
assumes t: "t
∈
Phylo"assumes tr: "tr
∈
P_tr(t)"s h o w s "image tr t
∈
Phylo"proof ... q e d
Example. AMutation isa transformationthatonerns the nodesup a graph
node: gp, suh up nodes ontain gp, and a mutation isexpressed as follows:
"Mutation
, λ
(gp,R).λ
n. if gp⊆
n then (n−
gp)∪
R else n"WeshowthattheMutation transformationisaphylogenetitransformation:
theorem Mutation_P_tr:
a s s u m e s h: "h
∈
Phylo"a s s u m e s g: "g
∈
Phylo"a s s u m e s pre: "PreGraft(h,gp,g)"
shows "Mutation(gp,ROOT(g))
∈
P_tr(h)"proof ... qed
where PreGraft (We will use this prediate as the preondition of the Graft
operation.) isdened asfollows:
"PreGraft
, λ
(h,gp,g). h∈
Hierarhy∧
(((ROOT h)∩
(ROOT g)) =∅
)∧
gp
∈
Leaves(h)∧
g∈
Hierarhy∧
g6 = ∅
"2.4 Generative partitions and relations
One of our onerns is the reonstrution of a phylogeneti tree starting from
the set of its leaves. The basi idea of suh a reonstrution is to partition
the leaves aording to its diret proper subtrees and to apply reursively the
reonstrution to eah of the sets of the partition. These suessive partitions
dene the sets whih are generated by a generative partition.
Generative partitions. Given aphylogenetitree h,GP isalled agenerative
partition of h, if eah node is either a leaf or partitioned aording the diret
sub-rootsof n (Down(h,n) is the subtree of h whih root isn).
"GenerativePartition
, λ
(h,GP).∀
n∈
h.GP(n) = (if n
∈
Leaves(h) then {n} else R1(Down(h,n)))"Generative relations. Semantially, the generative relation is a symmetri
relationof whihthe transitivelosureis agenerativepartition.The motivation
for introduinggenerativerelations is to make loalthe reasoning about the of
growth the tree and onsequently easier than a globalone. First, we dene R2P
whih onverts a relation to the partition funtion given by its reexive and
transitive losure: a node n is partitioned by the lasses of the orresponding
equivalene relation.
"R2P(r)
, λ
n. (n // ((r(n))^∗
))""GenerativeRelation
, λ
(h,GR).(
∀
n∈
h. GR(n)⊆
n×
n∧
s y m(GR(n)))∧
GenerativePartition(h, R2P(GR))"2.5 The reonstrution funtion and theorem
We introdue the auxiliary funtion Reonstrut. Its denition is set up in
order tobeaeptedasawelldened funtionby Isabelle: sineitisareursive
at eah all. The ondition of the if expression ensures it. The reonstrut
funtion is aurryed version of Reonstrut.
redef Reonstrut "m e a s u r e (
λ
(GP,s). ard s)""Reonstrut(GP,s) =
(if (finite s)
∧
(∀
s'∈
GP(s). s'⊂
s) thenSigma (image (
λ
e. Reonstrut(GP,e)) (GP s))else {s})"
(hints simp add: psubset_ard_mono)
"reonstrut(GP)
, λ
s. Reonstrut(GP,s)"The theorem haraterizing the reonstrution is statedas follows:
t h e o r e m generative_partition_reonstrution :
s h o w s
"
∀
GP.∀
t∈
Phylo. GenerativePartition(t ,GP)⇒
(reonstrut(GP )(ROOT(t)) = t)"proof ... q e d
This theorem is established thanks to the indution theorem over phyloge-
neti trees (2.2).
2.6 Disussion
In this setion, we disuss the denition of phylogeneti trees that has been
elaborated.Withrespettothestrutural pointofview:aphylogenetitreean
be dened as either a singleton node or as the Sigma of its subtrees. Suh a
set basedonstrution isnot admitted by most of the type theory based logial
frameworks [9,1,4,13℄. In fat, in suh frameworks a tree is usually reursively
dened through the list of its subtrees, orthrough a map of itssubtrees from a
givenindextype.Wehavetriedtoworkwitheahoftheserepresentations.Their
maindrawbakistobreak theunderlyingnaturalonuene.Forinstane,with
suhrepresentations,insertingasubtreeafteratuallyremovingit,doesnotyield
the originaltree.Suhaonueneisfundamentalforestablishingnaturallyour
reonstrution result. Otherwise, we would have to introdue modulo relations
inorder tonotdistinguish between trees ofwhihsubtrees are identialbut not
in the same order.
3 The graft operation
In our setting, the graft operation models the growth of a tree. As its name
suggests, the graft operation onsists ingrafting a tree ata given node. In this
3.1 Graft deomposition
Lethbeagraph,gpanode of hwherethe graftshouldourandgthegraphto
graft.Weexpress the graftthrough twobasi operations:rst, h istransformed
through aMutation, seond,g isgraftedthrough theunion(
∪
)operation.Suha deomposition isillustrated by gure2. The Graft is expressed as follows:
"Graft
, λ
(h,gp,g).(image (Mutation (gp,ROOT(g))) h)∪
g"{x,y,a,e,b,u,v,w}
{x,y} {a,e,b} {u,v,w}
{x} {y} {a} {e} {b} {u} {v} {w}
Graft
{x,y,a,n1,n2,b,u,v,w}
{x,y} {a,n1,n2,b} {u,v,w}
{x} {y} {a} {n1,n2} {b} {u} {v} {w}
{n1} {n2}
{x,y,a,e,b,u,v,w}
{x,y} {a,e,b} {u,v,w}
{x} {y} {a} {e} {b} {u} {v} {w}
{x,y,a,n1,n2,b,u,v,w}
{x,y} {a,n1,n2,b} {u,v,w}
{x} {y} {a} {n1,n2} {b} {u} {v} {w}
{n1,n2}
{n1} {n2}
transformation
union
Fig.2. Deompositionofagraft
Weshowthatthe graftedtree isalsoaphylogenetitree.Theproofisestab-
lishedthanks tothedeompositionofthe graftoperation;werst establishthat
Mutation is a phylogeneti transformation, then thanks to the union theorem,
g being phylogeneti,it follows that the graftedtree isphylogeneti.
t h e o r e m graft_phylo:
assumes h: "h
∈
Phylo"assumes g: "g
∈
Phylo"assumes pre: "PreGraft(h,gp,g)"
s h o w s "Graft(gp,g)(h)
∈
Phylo"proof ... q e d
3.2 Reonstruting a graft through a generative partition
This setion states a general result about the preservation of a generative par-
tition GP. Infat, wehavea preonditionabout the partitioningofthe mutated
nodes.
t h e o r e m generative_partition_graft_phylo:
assumes h: "h
∈
Phylo"assumes g: "g
∈
Phylo"assumes pre: "PreGraft(h,gp,g)"
assumes gp_h: "GenerativePartition(h,GP)"
assumes g p _ g: "GenerativePartition(g,GP)"
assumes gp_tr:
"
∀
n∈
h. GP(Mutation(gp,ROOT(g))(n)) =(if n
∈
Leaves(h) then {Mutation(gp,ROOT(g))(n)}else image (Mutation(gp,ROOT(g))) ( GP(n)))"
s h o w s "GenerativePartition(Graft(h,gp,g),GP)"
proof ... q e d
3.3 Reonstruting a graft through a generative relation
In the same way, a generative relationan be preserved while extending a tree
through a graft.Thanks tothis preservation: a tree, growing through graft op-
erations,willalways bereonstrutiblefromitsleavesthrough itsinvariantgen-
erative relation.
A simplied mutation: the basi update upd. For the purpose of our
appliation, we onsider the following node transformation:
"upd
, λ
(l ,N).λ
S. if l∈
S then S−
{l}∪
N else S"Sine we have: upd
(l, N ) =
Mutation({l}, N )
, upd inherits the property ofMutation; then itis a phylogenetitransformation.
Moreover, in order to simplify the proof obligations for establishing that
a generative relation is preserved after a graft, we have elaborated suient
onditions that should be established by the update funtion. Due to the lak
of spae, we donot detailthem.
We haveestablished the preservation of the generativerelation for the graft
of a so alledanonial tree whih onsistsof a rootand aset of leaves:
"Canoni
, λ
N. {N}
∪
(S
e
∈
N. {{e}})"We have the following invariant theorem establishing the preservation of a
lemma generative_relation_graft_phylo:
assumes t: "t
∈
Phylo"assumes up: "{l}
∈
t"assumes gp1: "GenerativeRelation(t,GR)"
assumes gr_m: "
∀
n. GR(n)⊆
n×
n∧
s y m(GR(n))"assumes terminal: "Terminal(t)"
assumes N: "
∀
n∈
t. N∩
n =∅
"assumes N_e: "N
6= ∅ ∧
finite(N)"assumes gp2: "GenerativeRelation(Canoni(N),GR)"
assumes gr_tr:
"
∀
n∈
t. l∈
n⇒
r_upd(l ,N)(n)(GR(n) ,GR(upd(l ,N)(n)))"s h o w s "GenerativeRelation(Graft({l},Canoni(N))(t) ,GR)"
proof ... q e d
4 Appliation
As an appliation of phylogeneti trees, we onsider distributed diusing om-
putations. In the initial state, one site (or proess) multi-asts a message to a
subsetof othernodes.Then,allnodes sharethesame behavior:whenamessage
is reeived, the reeiver performs a omputation step and, possibly, multi-asts
a messageto asubset of other nodes.
We are interested in the following problem: how to reonstrut the global
history ofsuhaomputation,afteritstermination 3
,frominformationgathered
during the omputation.For suh adiusing omputation, the ontrolow is a
treeinwhihthenodesaretheomputationstepsandtheedgesare themessage
ommuniations.Ouralgorithmonsistsinolletinganenoded representation
oftheseleaves.Fromthisleavesset,weapplythereonstrutionalgorithmbased
upon agenerative relation dened onthe omputationas aphylogeneti tree.
4.1 Control tree enoding
We dene an enoding for the ontrol tree. The nodes generated during the
omputation (temporary leaves) are enoded as vetors. At eah site, a loal
ounter is inremented by
p − 1
eah time a omputation step multi-astsp
messages. Thus, one 4
plus the sum of the loalounters represents the number
of the ontrol tree leaves. Moreover, the value of the ounter of site
s
is themaximum of the vetors omponent atthe index
s
.3
Suhareonstrutionisusuallyusedfordebuggingpurposes.
4
Wehavetotakeintoaounttheinitialstateswheretheountersareallnullandthetreeonsists
collected visit tag (0,[0,0,0,0])
(1,[1,0,0,0]) S0
S1
S2
S3
(2,[1,1,0,0])
(3,[1,1,2,0])
(site,[x,y,z,t]) internal node tag (site,[x,y,z,t]) (2,[2,1,0,0])
(2,[1,1,2,2]) (1,[2,1,0,0])
(1,[1,1,2,2]) (0,[1,1,2,0]) (0,[1,1,2,2])
(0,[1,1,0,0])
(1,[1,1,2,0])
(2,[1,0,0,0])
Fig.3.Visittagsenoding
We assoiate a "visit tag" to eah node. This tag is omposed of the site of
thenodeandanaturalintegersvetor.Thisvetor
V
hasasizeN
,orresponding to the number of sites, and is assigned the loal ounter values of the sites ithas visited. Figure3 shows the taggingof the nodes of a diusing omputation
with this enoding.
The state spae of all the appliation is modeled by a global type State.
It ontains the elds related to the network, the loal omputations and the
olletor. The omputation is onernedby the followingelds:
The eld lounter implements the loalounter of eah site;
The eld olleted reordsthe visittags of the omputationleaves.
Twotransitionsareonsideredand eahofthemislaunhedwhenamessage
is reeived:
ReeiveAndEnd desribes a omputing step without further message multi-
ast. In this ase, the visit tag ontained in the reeived message is sent to
the olletor;
ReeiveAndSplitdesribesaomputing stepterminatedby amessagemul-
tiast.Inthis ase, anew tagisreated: itholds the destinationsite (
d
)andavetor whih isidential tothe tag vetor of the splittingnode (
m.V
),ex-eptforthesplittingsite(self)omponent,whihgetsthenewloalounter
value
lcounter[self]
assigned by this omputation step. No message is sentWith respet to phylogeneti trees, the diusing omputation is seen as a
tree. A ReeiveAndEnd assigns to a node the denitive leaf status. While a
ReeiveAndSplit extends a tree with new leaves. We interpret it as a Graft
operation.Then,forvalidationpurposes,wehaveanauxiliaryvariableauxTree
for reording the growth of suha superposed tree: we prove that attermina-
tion, this auxiliary tree and the reonstruted tree are the same.
4.2 Termination detetion and reonstrution
We introdue a olletor proess to gather vetors: a vetor is sent to the ol-
letorwhen aproess performsaomputationstep withoutmulti-astinganew
message. In suh a ase, this step generates a leaf with respet to the ontrol
ow ofthe omputation.Then, withrespet tophylogeneti trees,the olleted
tagged messages are in fat leaves of the phylogeneti tree superposed to the
diusing omputation (and reorded in the auxiliaryvariableauxTree).
The reonstrution of the ontrol tree an only start when the global om-
putationisterminated.Several distributedalgorithmsansolvethe termination
problem,espeially, thanks toaolletor proess[12℄. However, the enoding it-
self provides a simple riterion for termination detetion [8℄: a omputation is
terminated when the number of olleted leavesis equalto one plus the sum of
the elementsin the maximum of the olleted visit vetors 5
:
|
olleted|= 1 + X
s ∈
Sitev ∈ max collected v.V [s]
The generative relationfor the diusing omputationas a phylogeneti tree
is dened asfollows:
"gr
, λ
n. {(v1,v2). v1∈
n∧
v2∈
n∧
(if V(v1) = m i n _ o n(n)
∨
V(v2) = m i n _ o n(n) then (v1 = v2)else (
∃
s. V(v1)(s) = V(v2)(s)∧
s6=
w(v1)∧
s
6=
w(v2)∧
V(v1)(s)6=
m i n _ o n(n)(s))) }"Wederivethe orretness ofthe reonstrutionthrough the followinginvari-
ant:
"ReonstrutionInvariant
, λ
st. auxTree(st) =reonstrut(R2P(gr))(olleted(st)
∪
network(st))"Then, when termination is reahed, the network is empty, and the reon-
strution appliedtothe olleted messages givesthe omputationtree.
5
|
_|
denotestheardinalityof_.5 Conlusion
In this paper, wehave proposeda mehanization ofphylogenetitrees. Starting
frombasiset theory,wehaveintroduedphylogenetitreesthrough hierarhies
and trees. Then, we have dened generi transformations. We note that sets
based representations, although already suggested in the literature[10℄,are not
widely used inomputer siene. To the best of our knowledge, the representa-
tion of a tree through the set of its leaves together with a generative partition
or relation, as well as the study of dediated transformations, are original. We
have given a onrete example, where suh notions have been applied to tree
reonstrution and shown how suh a reonstrution ould be validated. It is
interesting to remark that thanks to theorem proving tehniques, suh a vali-
dation was possible; atually we have onsidered an unknown number of nodes
and unboundednaturalvetors.Usualmodelhekingtehniquesannothandle
suh problems.
Most of our results have been proved formally within Isabelle. In fat, our
treesareunordered trees.Suhadatatypeouldbeonsideredasanindutive
data type where Sigma would play the role of a onstrutor; however, due to
the negativeourrene 6
most ofthe logialframeworks(HOL[9℄,Isabelle[13℄,
PVS[4℄,Coq[1℄) donotsupportsuhadenitionshema.VosandSwiestra[17℄
havestudiedrestritionsforaeptingindutivedatatypeswithnegativeour-
renes; sine our trees are nite, we ould have reused their work. This work
is not known tobe availablewithin the Isabelleframework. An alternative way
would have been to introdue unordered trees through an equivalene rela-
tion [14℄ over ordered trees where subtrees are onstrutedwith a list.It would
be interesting to ompare the subsequent developments of phylogeneti trees,
generativerelations and partitions.
Withrespet totheformalizationoftreesandbiologyrelatedresults,numer-
ous works have been published. Among the more reent, we an ite [16℄ who
onsider the problem of tree inlusionin a ategorial setting. [11℄ reviews ba-
si network models for reasoning about biology; he noties that appliations to
biologyofexistingtoolsfromalgebraisjustbeginning.Tothebestofourknowl-
edge, the mehanization of these works has not been onsidered yet. We think
that our work ould be reused as a starting point for establishing algorithms
orretness but also forthe orretness of their proposed proofs 7
.
6
ThenegativeourreneisduetothefatthattheparameterofSigma,onsideredasaonstrutor,
isasetoftrees.
7
It is interesting to remarkthat the analysis of the algorithm of [5℄ is reportedto be inorret
Referenes
1. B. Barras, S.Boutin, C. Cornes, J. Courant, J. Filliatre, E. Giménez, H. Herbelin, G. Huet,
C. Muñoz, C. Murthy, C. Parent, C. Paulin, A. Saïbi, and B. Werner. The Coq Proof
Assistant Referene Manual Version V6.1. Tehnial Report 0203, INRIA, August 1997.
http://oq.inria.fr.
2. S.BerghoferandM. Wenzel. IndutivedatatypesinHOL-lessonslearnedinformal-logiengi-
neering.InSpringer-Verlag,editor,TheoremProvinginHigherOrderLogis,volume1690,pages
1936,1999.
3. S.BokerandA.W.Dress.Anoteonmaximalhierarhies.AdvanesinMathematis,(151):270
282,2000.
4. S. Crow, S. Owre, J. Rushby, N. Shankar, and S. Mandayam. A Tutorial Introdution
to PVS. In Workshop on Industrial-Strength Formal Speiation Tehniques, Boa Raton,
http://www.sl.sri.om/pvs,April1995.
5. J.Culbersonand P.Rudniki. A fastalgorithm for onstrutingtrees from distane matries.
InformationProessingLetters,30(4):215220,may1989.
6. B.DaveyandH.Priestley. Introdution toLattiesandOrder. CambridgeMathematialText-
books.CambridgeUniversityPress,1990.
7. E.W.DijkstraandC.S.Sholten. PrediateCalulusandProgramSemantis. Springer-Verlag,
1989.
8. M. Filali, P. Mauran, G.Padiou, P. Quéinne, and X. Thirioux. Renement based validation
ofadistributedterminationdetetionalgorithm . InFMPPTA'2000,Canun,volume 1800of
Leture NotesinComputerSiene,pages10271036.Springer-Verlag,may2000.
9. M.GordonandT.Melham. IntrodutiontoHOL. CambridgeUniversityPress, 1994.
10. D. E.Knuth. The art of omputer programming Fundamentalalgorithms, volume 1. Addison-
Wesley,1969.
11. R.Laubenbaher. Algebrai modelsinSystemsbiology. InH. AnaiandK.Horimoto, editors,
Algebrai Biology 2005 -Computer Algebrain Biology,pages3340. UniversalAademipress,
Tokyo,Japan,2005.
12. F.Mattern. Globalquiesenedetetionbasedonreditdistributionandreovery.Information
ProessingLetters,30(4):195200,Feb.1989.
13. T.Nipkow,L.Paulson,andM.Wenzel.Isabelle/HOL.AProofAssistantforHigher-OrderLogi.
Number2283inLetureNotesinComputerSiene.Springer-Verlag,2002.
14. L.C.Paulson. Deningfuntionsonequivalenelasses. ACMTransations onComputational
Logi,7(4):658675, 2006.
15. L.ReyzinandN.Srivastava.Onthelongestpathalgorithmforreonstrutingtreesfromdistane
matries. InformationProessingLetters,101(1):98100,january2007.
16. F.RoselloandG.Valiente. Analgebrai viewofthe relationbetweenlargestommonsubtrees
andsmallestommonsupertrees. TheoretialComputer Siene,(362):3353,2006.
17. T. E. Vos and S. D. Swierstra. Indutive data typeswith negative ourrenes in HOL. In
WorkshoponThirtyFiveyearsofAutomath,Edinburgh,UK,2002.
18. M.WenzelandF.Wiedijk. Aomparison ofthemathematialprooflanguages MizarandIsar.
JournalofAutomatedReasoning, 29:389411,2002.
19. M. M. Wenzel. Isar a generi interpretative approah toreadable proof douments. Number
1690inLetureNotesinComputerSiene.Springer-Verlag,1999.