package frama-c
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Platform dedicated to the analysis of source code written in C
Install
dune-project
Dependency
Authors
-
MMichele Alberti
-
TThibaud Antignac
-
GGergö Barany
-
PPatrick Baudin
-
NNicolas Bellec
-
TThibaut Benjamin
-
AAllan Blanchard
-
LLionel Blatter
-
FFrançois Bobot
-
RRichard Bonichon
-
VVincent Botbol
-
QQuentin Bouillaguet
-
DDavid Bühler
-
ZZakaria Chihani
-
SSylvain Chiron
-
LLoïc Correnson
-
JJulien Crétin
-
PPascal Cuoq
-
ZZaynah Dargaye
-
BBasile Desloges
-
JJean-Christophe Filliâtre
-
PPhilippe Herrmann
-
MMaxime Jacquemin
-
BBenjamin Jorge
-
FFlorent Kirchner
-
AAlexander Kogtenkov
-
RRemi Lazarini
-
TTristan Le Gall
-
KKilyan Le Gallic
-
JJean-Christophe Léchenet
-
MMatthieu Lemerre
-
DDara Ly
-
DDavid Maison
-
CClaude Marché
-
AAndré Maroneze
-
TThibault Martin
-
FFonenantsoa Maurica
-
MMelody Méaulle
-
BBenjamin Monate
-
YYannick Moy
-
PPierre Nigron
-
AAnne Pacalet
-
VValentin Perrelle
-
GGuillaume Petiot
-
DDario Pinto
-
VVirgile Prevosto
-
AArmand Puccetti
-
FFélix Ridoux
-
VVirgile Robles
-
JJan Rochel
-
MMuriel Roger
-
CCécile Ruet-Cros
-
JJulien Signoles
-
FFabien Siron
-
NNicolas Stouls
-
HHugo Thievenaz
-
KKostyantyn Vorobyov
-
BBoris Yakobowski
Maintainers
Sources
frama-c-32.0-beta-Germanium.tar.gz
sha256=868d57ef8007fe6c0836cd151d8c294003af34aa678285eff9547662cad36aa3
doc/src/frama-c-wp.core/ProofSession.ml.html
Source file ProofSession.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210(**************************************************************************) (* *) (* SPDX-License-Identifier LGPL-2.1 *) (* Copyright (C) *) (* CEA (Commissariat à l'énergie atomique et aux énergies alternatives) *) (* *) (**************************************************************************) open Wpo type script = | NoScript | Script of Filepath.t | Deprecated of Filepath.t type mode = | Batch | Update | Dry | Init let parse_mode ~origin ~fallback = function | "batch" -> Batch | "update" -> Update | "dry" -> Dry | "init" -> Init | "" -> raise Not_found | m -> Wp_parameters.warning ~current:false "Unknown %s mode %S (use %s instead)" origin m fallback ; raise Not_found module MODE = WpContext.StaticGenerator(Datatype.Unit) (struct type key = unit type data = mode let name = "Wp.Script.mode" let compile () = try if not (Wp_parameters.CacheEnv.get()) then raise Not_found ; let origin = "FRAMAC_WP_SCRIPT" in parse_mode ~origin ~fallback:"-wp-script" (Sys.getenv origin) with Not_found -> try let mode = Wp_parameters.ScriptMode.get() in parse_mode ~origin:"-wp-script" ~fallback:"batch" mode with Not_found -> let provers = Wp_parameters.Provers.get () in if List.mem "tip" provers then Update else if List.mem "script" provers then Batch else Dry end) let get_mode = MODE.get let set_mode m = MODE.set () m let scratch_mode () = match MODE.get () with | Batch | Update -> false | Dry | Init -> true let saving_mode () = match MODE.get () with | Update | Init -> true | Batch | Dry -> false let files : (Filepath.t,script) Hashtbl.t = Hashtbl.create 32 let jsonfile (dir:Filepath.t) filename = Filepath.(dir / (filename ^ ".json")) let get_script_dir ~force = Wp_parameters.get_session_dir ~force "script" let filename ~force wpo = let dscript = get_script_dir ~force in jsonfile dscript wpo.po_sid (* no model in name *) let legacies wpo = let mid = WpContext.MODEL.id wpo.po_model in let dscript = Wp_parameters.get_session_dir ~force:false "script" in let dmodel = Wp_parameters.get_session_dir ~force:false mid in [ jsonfile dscript wpo.po_gid ; jsonfile dmodel wpo.po_gid ; ] let get wpo = let f = filename ~force:false wpo in try Hashtbl.find files f with Not_found -> let script = if Filesystem.exists f then Script f else try let f' = List.find Filesystem.exists (legacies wpo) in Wp_parameters.warning ~current:false "Deprecated script for '%s'" wpo.po_sid ; Deprecated f' with Not_found -> NoScript in Hashtbl.add files f script ; script let pp_file fmt s = Filepath.pretty fmt s let pp_script_for fmt wpo = match get wpo with | Script f -> Format.fprintf fmt "script '%a'" pp_file f | Deprecated f -> Format.fprintf fmt "(deprecated) script '%a'" pp_file f | _ -> Format.fprintf fmt "script '%a'" pp_file @@ filename ~force:false wpo let exists wpo = match get wpo with NoScript -> false | Script _ | Deprecated _ -> true let load wpo = match get wpo with | NoScript -> `Null | Script f | Deprecated f -> if Filesystem.exists f then Json.load_file f else `Null let remove wpo = match get wpo with | NoScript -> () | Script f -> begin Filesystem.remove_file f ; Hashtbl.replace files f NoScript ; end | Deprecated f0 -> begin Wp_parameters.feedback "Removed deprecated script for '%s'" wpo.po_sid ; Filesystem.remove_file f0 ; let f = filename ~force:false wpo in Hashtbl.replace files f NoScript ; end let save ~stdout wpo js = let empty = match js with | `Null | `List [] | `Assoc [] -> true | _ -> false in if stdout then Wp_parameters.result "Proof script for %s:@.%a" wpo.po_gid (Json.save_formatter ~pretty:true) js else if empty then remove wpo else match get wpo with | Script f -> Json.save_file f js | NoScript -> begin let f = filename ~force:true wpo in Json.save_file f js ; Hashtbl.replace files f (Script f) ; end | Deprecated f0 -> begin Wp_parameters.feedback "Upgraded script for '%s'" wpo.po_sid ; Filesystem.remove_file f0 ; let f = filename ~force:true wpo in Json.save_file f js ; Hashtbl.replace files f (Script f) ; end let get_marks_dir ~force = let scripts = Wp_parameters.get_session_dir ~force "script" in let path = Filepath.(scripts / ".marks") in if force then Wp_parameters.make_output_dir path ; path let remove_marks ~dry = let marks = get_marks_dir ~force:false in if Filesystem.dir_exists marks then if dry then Wp_parameters.feedback "[dry] remove marks" else Filesystem.remove_dir marks let reset_marks () = remove_marks ~dry:false ; ignore @@ get_marks_dir ~force:true let mark goal = let marks = get_marks_dir ~force:false in if Filesystem.dir_exists marks then let mark = Filepath.(marks / (goal.po_sid ^ ".json")) in if Filesystem.exists mark then () else close_out @@ open_out (Filepath.to_string_abs mark) module StringSet = Datatype.String.Set let remove_unmarked_files ~dry = let dir = get_script_dir ~force:false in if Filesystem.dir_exists dir then let marks = get_marks_dir ~force:false in if Filesystem.dir_exists marks then begin let files = Filesystem.fold_dir StringSet.add dir StringSet.empty in let marks = Filesystem.fold_dir StringSet.add marks StringSet.empty in let orphans = StringSet.diff files marks in let orphans = StringSet.remove ".marks" orphans in let remove file = let path = Filepath.(dir / file) in if dry then Wp_parameters.feedback "[dry] rm %a" Filepath.pretty path else Filesystem.remove_file path in StringSet.iter remove orphans ; remove_marks ~dry end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>