07.11.2013 Views

Une Boite `a Outils Pour la Preuve Formelle de Syst`emes Séquentiels

Une Boite `a Outils Pour la Preuve Formelle de Syst`emes Séquentiels

Une Boite `a Outils Pour la Preuve Formelle de Syst`emes Séquentiels

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.3. EVALUATION DE PRE( ⃗ F,CNS,χ) 115<br />

var SetFun : list of TDG;<br />

function <strong>de</strong>compose-composition(g,l) : list of TDG;<br />

set-nbpath-and-path(g);<br />

SetFun = ();<br />

produce-functions(g,l,1);<br />

return SetFun;<br />

function produce-functions(g,l,path) : void;<br />

if g = 0 then return;<br />

if g = 1 then {<br />

SetFun = append-to-list(SetFun, path);<br />

return;<br />

}<br />

let ((y 1 ,f 1 )...(y n ,f n )) = l and<br />

x = g.root in {<br />

if x > y 1 then {<br />

produce-functions(g,((y 2 ,f 2 )...(y n ,f n )),path);<br />

return;<br />

}<br />

if x = y 1 then {<br />

g.nbpath = g.nbpath−1;<br />

g.path = g.path∨path;<br />

if g.nbpath = 0 then {<br />

produce-functions(g[x ← 0],((y 2 ,f 2 )...(y n ,f n )),¬f 1 ∧g.path);<br />

produce-functions(g[x ← 1],((y 2 ,f 2 )...(y n ,f n )),f 1 ∧g.path);<br />

}<br />

}<br />

}<br />

Figure 36. Fonction “<strong>de</strong>compose-composition”.<br />

Dans l’algorithme, le champ path d’un noeud est <strong>de</strong>stiné à recevoir le terme (S ◦ ⃗ f).<br />

Il est initialisé à 0 par le fonction “set-nbpath-and-path”, et mis à jour chaque fois qu’on<br />

atteint un noeud par un nouveau chemin. Afin <strong>de</strong> savoir si tous les chemins permettant<br />

d’accé<strong>de</strong>r à un noeud ont bien été considérés, le nombre <strong>de</strong>s chemins restant à traverser<br />

est rangé dans le champ nbpath associé au noeud. Sa valeur initiale est le nombre <strong>de</strong> tous<br />

les chemins atteignant le noeud, et est calculé par <strong>la</strong> fonction “set-nbpath-and-path”. La<br />

fonction “set-nbpath-and-path” qui initialise les <strong>de</strong>ux champs path et nbpath <strong>de</strong>s noeuds<br />

du graphe g consiste en un simple parcours du graphe, elle est donc en O(g). Le champ<br />

nbpath d’un noeud est décrémenté lorsque <strong>la</strong> fonction “compose” y accè<strong>de</strong>.<br />

Lorsque le champ nbpath d’un noeud <strong>de</strong>vient nul, le champ path associé à ce noeud<br />

contient le terme (S◦ ⃗ f). On récurse alors en propageant le terme partiel (S◦ ⃗ f) (argument

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!