vc_fichiers.miaou
← Le code · src/outil/miaou/vc_fichiers.miaou · 24 lignes
(node vc_fichiers
(params (fs (Liste (tuple (Liste Octet) (Liste Octet)))) (h Hache))
(returns Hache)
(intent "les fichiers fs (nom, contenu) ajoutés un à un à l'empreinte h, dans leur ordre")
(origin "phase H1c : la vérification incrémentale")
(effects)
(uses vc_ajouter)
(requires
(and (lt (get h a) 2147483647)
(and (lt (get h b) 2147483647) (and (lt (get h c) 2147483647) (lt (get h d) 2147483647)))))
(ensures
(and (lt (get r a) 2147483647)
(and (lt (get r b) 2147483647) (and (lt (get r c) 2147483647) (lt (get r d) 2147483647)))))
(decreases fs)
(examples
(ex ((list (tuple "a" "")) (record Hache (a 0) (b 0) (c 0) (d 0)))
(record Hache (a 923759552) (b 430137680) (c 419082318) (d 1207489275)))
(ex ((list) (record Hache (a 5) (b 6) (c 7) (d 8))) (record Hache (a 5) (b 6) (c 7) (d 8))))
(equivalence exact)
(body.high
(match fs
(case empty () h)
(case cons (f reste) (vc_fichiers reste (vc_ajouter h (get f 0) (get f 1))))))
(end node vc_fichiers))