diff --git a/headers/header_spec.txt b/headers/header_spec.txt index be54e37a3dc0c73d4d706c57e79d045741616754..25b81ff83abfcef7c40a2e6de049149cb7fdbc53 100644 --- a/headers/header_spec.txt +++ b/headers/header_spec.txt @@ -1121,10 +1121,6 @@ src/plugins/qed/collection.mli: CEA_WP src/plugins/qed/engine.mli: CEA_WP src/plugins/qed/export.ml: CEA_WP src/plugins/qed/export.mli: CEA_WP -src/plugins/qed/export_altergo.ml: CEA_WP -src/plugins/qed/export_altergo.mli: CEA_WP -src/plugins/qed/export_coq.ml: CEA_WP -src/plugins/qed/export_coq.mli: CEA_WP src/plugins/qed/export_why3.ml: CEA_WP src/plugins/qed/export_why3.mli: CEA_WP src/plugins/qed/export_whycore.ml: CEA_WP @@ -1696,10 +1692,6 @@ src/plugins/wp/ProofSession.ml: CEA_WP src/plugins/wp/ProofSession.mli: CEA_WP src/plugins/wp/ProofScript.ml: CEA_WP src/plugins/wp/ProofScript.mli: CEA_WP -src/plugins/wp/ProverCoq.ml: CEA_WP -src/plugins/wp/ProverCoq.mli: CEA_WP -src/plugins/wp/ProverErgo.ml: CEA_WP -src/plugins/wp/ProverErgo.mli: CEA_WP src/plugins/wp/ProverScript.ml: CEA_WP src/plugins/wp/ProverScript.mli: CEA_WP src/plugins/wp/ProverSearch.ml: CEA_WP @@ -1857,8 +1849,6 @@ src/plugins/wp/intro_wp.txt: CEA_WP src/plugins/wp/mcfg.mli: CEA_WP src/plugins/wp/normAtLabels.ml: CEA_WP src/plugins/wp/normAtLabels.mli: CEA_WP -src/plugins/wp/proof.ml: CEA_WP -src/plugins/wp/proof.mli: CEA_WP src/plugins/wp/prover.ml: CEA_WP src/plugins/wp/prover.mli: CEA_WP src/plugins/wp/register.ml: CEA_WP @@ -1868,7 +1858,6 @@ src/plugins/wp/rformat.mll: CEA_WP src/plugins/wp/script.mli: CEA_WP src/plugins/wp/script.mll: CEA_WP src/plugins/wp/share/.gitignore: .ignore -src/plugins/wp/share/Makefile.coqwp: CEA_WP src/plugins/wp/share/Makefile.resources: CEA_WP src/plugins/wp/share/coqwp/ArcTrigo.v: CEA_WP src/plugins/wp/share/coqwp/Bits.v: CEA_WP @@ -1906,37 +1895,6 @@ src/plugins/wp/share/coqwp/real/Real.v: UNMODIFIED_WHY3 src/plugins/wp/share/coqwp/real/RealInfix.v: UNMODIFIED_WHY3 src/plugins/wp/share/coqwp/real/Square.v: UNMODIFIED_WHY3 src/plugins/wp/share/coqwp/real/Trigonometry.v: UNMODIFIED_WHY3 -src/plugins/wp/share/ergo/ArcTrigo.mlw: CEA_WP -src/plugins/wp/share/ergo/Cbits.mlw: CEA_WP -src/plugins/wp/share/ergo/Cfloat.mlw: CEA_WP -src/plugins/wp/share/ergo/Cint.mlw: CEA_WP -src/plugins/wp/share/ergo/Cmath.mlw: CEA_WP -src/plugins/wp/share/ergo/ExpLog.mlw: CEA_WP -src/plugins/wp/share/ergo/Memory.mlw: CEA_WP -src/plugins/wp/share/ergo/Qed.mlw: CEA_WP -src/plugins/wp/share/ergo/Square.mlw: CEA_WP -src/plugins/wp/share/ergo/Vlist.mlw: CEA_WP -src/plugins/wp/share/ergo/Vset.mlw: CEA_WP -src/plugins/wp/share/ergo/bool.Bool.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/int.Abs.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/int.ComputerDivision.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/int.ComputerOfEuclideanDivision.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/int.Int.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/int.MinMax.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/map.Map.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/map.Const.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.Abs.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.ExpLog.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.Hyperbolic.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.FromInt.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.MinMax.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.Polar.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.PowerReal.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.Real.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.RealInfix.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.Square.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.Trigonometry.mlw: MODIFIED_WHY3 -src/plugins/wp/share/ergo/real.Truncate.mlw: MODIFIED_WHY3 src/plugins/wp/share/install.ml: CEA_WP src/plugins/wp/share/why3/frama_c_wp/cbits.mlw: CEA_WP src/plugins/wp/share/why3/frama_c_wp/cfloat.mlw: CEA_WP diff --git a/opam/opam b/opam/opam index 8c4fd47361cd5bea9784716776d3495df456df11..b7c3f147d041645e31f22f9a08626b5a440b6ff6 100644 --- a/opam/opam +++ b/opam/opam @@ -137,13 +137,6 @@ depopts: [ "zmq" ] -messages: [ - "The Frama-C/Wp now uses Why-3 for all provers (Cf. deprecated -wp-prover native:alt-ergo)" - {alt-ergo:installed} - "The Frama-C/Wp native support for Coq is deprecated and only activated with Coq.8.13.x (use TIP or Why-3 instead)." - {coq:installed} -] - post-messages: [ "Why3 provers setup: rm -f ~/.why3.conf ; why3 config detect" ] diff --git a/share/autocomplete_frama-c b/share/autocomplete_frama-c index 0637900a8bc57ac7f9d94af7d12540bbb93ca1b9..5b1d86283067ec54e0d2aa043579fa320c96999a 100644 --- a/share/autocomplete_frama-c +++ b/share/autocomplete_frama-c @@ -94,7 +94,7 @@ _frama-c () then local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," advance_options="$(frama-c -wp-detect | grep -E -o " \[.*" | grep -E -o "[^][|]*")" - advance_options+=" none script tip native:alt-ergo native:coq native:coqide" + advance_options+=" none script tip" local ambigous="$(bind -v | grep show-all-if-ambiguous)" ambigous="${ambigous##* }" if [[ "$ambigous" == "on" ]] diff --git a/src/plugins/qed/Makefile b/src/plugins/qed/Makefile index fb2350efe6e9561f0bcbe3c3803c7b266b8bda09..fd4255b62dc97a0a5e7f454b222fe3feb96377f6 100644 --- a/src/plugins/qed/Makefile +++ b/src/plugins/qed/Makefile @@ -54,9 +54,8 @@ PLUGIN_CMO:= \ pool kind term \ plib pretty export \ export_whycore \ - export_altergo \ export_why3 \ - export_coq \ + PLUGIN_CMI:= logic engine @@ -67,7 +66,7 @@ PLUGIN_OFLAGS:= PLUGIN_GENERATED:= $(PLUGIN_DIR)/Qed.mli PLUGIN_DISTRIBUTED:=$(PLUGIN_ENABLED) -PLUGIN_DISTRIB_EXTERNAL:= Makefile +PLUGIN_DISTRIB_EXTERNAL:= Makefile include $(FRAMAC_SHARE)/Makefile.dynamic @@ -87,9 +86,7 @@ QED_API= \ pool.mli kind.mli term.mli \ plib.mli pretty.mli engine.mli export.mli \ export_whycore.mli \ - export_altergo.mli \ export_why3.mli \ - export_coq.mli \ QED_MLI=$(addprefix $(Qed_DIR)/, $(QED_API)) diff --git a/src/plugins/qed/engine.mli b/src/plugins/qed/engine.mli index 65dbd5cad466935c7e185b7d2445dda48014b449..7d91ca390d6f83dfe8a41cf3198a45d7db785aec 100644 --- a/src/plugins/qed/engine.mli +++ b/src/plugins/qed/engine.mli @@ -36,7 +36,9 @@ type op = type link = | F_call of string (** n-ary function *) - | F_subst of string (** n-ary function with substitution "foo(%1,%2)" *) + | F_subst of string * string (** n-ary function with substitution + first value is the link name, second is the + substitution (e.g. "foo(%1,%2)") *) | F_left of string (** 2-ary function left-to-right + *) | F_right of string (** 2-ary function right-to-left + *) | F_list of string * string (** n-ary function with (cons,nil) constructors *) diff --git a/src/plugins/qed/export.ml b/src/plugins/qed/export.ml index c1d37be39205f67ce351c45b0c892c3b08db3656..452b8b472cf64977202d7572ddd5fb92bec34420 100644 --- a/src/plugins/qed/export.ml +++ b/src/plugins/qed/export.ml @@ -65,7 +65,7 @@ let link_name = function let debug = function | F_call f | F_left f | F_right f | F_bool_prop(_,f) - | F_list(f,_) | F_subst f | F_assoc f -> f + | F_list(f,_) | F_subst (f, _) | F_assoc f -> f (* -------------------------------------------------------------------------- *) (* --- Identifiers --- *) @@ -451,7 +451,7 @@ struct fc self#pp_atom x (plist w) xs in plist (self#callstyle,fc,fn) fmt xs end - | F_subst s, _ -> + | F_subst (_, s), _ -> let print = match self#callstyle with | CallVar | CallVoid -> self#pp_flow | CallApply -> self#pp_atom in diff --git a/src/plugins/qed/export_altergo.ml b/src/plugins/qed/export_altergo.ml deleted file mode 100644 index d779b1f827c4600c0f33f77f5009e2a226aa9cc3..0000000000000000000000000000000000000000 --- a/src/plugins/qed/export_altergo.ml +++ /dev/null @@ -1,374 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* -------------------------------------------------------------------------- *) -(* --- Exportation Engine for Alt-Ergo --- *) -(* -------------------------------------------------------------------------- *) - -open Logic -open Format -open Plib -open Engine -open Export - -module Make(T : Term) = -struct - - open T - module E = Export_whycore.Make(T) - module Env = E.Env - module ADT = T.ADT - module Field = T.Field - module Fun = T.Fun - - type trigger = (T.var,Fun.t) ftrigger - type typedef = (tau,Field.t,Fun.t) Engine.ftypedef - - class virtual engine = - object(self) - - inherit E.engine - - (* -------------------------------------------------------------------------- *) - (* --- Types --- *) - (* -------------------------------------------------------------------------- *) - - method t_atomic (_:tau) = true - - method pp_array fmt data = - fprintf fmt "%a farray" self#pp_tau data - - method pp_farray fmt key data = - fprintf fmt "(%a,%a) farray" self#pp_tau key self#pp_tau data - - method virtual get_typedef : ADT.t -> tau option - method virtual set_typedef : ADT.t -> tau -> unit - - method pp_datatype adt fmt ts = - match self#get_typedef adt with - | Some def -> - let t = Kind.tmap (Array.of_list ts) def in - self#pp_tau fmt t - | None -> - match ts with - | [] -> pp_print_string fmt (self#datatype adt) - | [t] -> fprintf fmt "%a@ %s" self#pp_tau t (self#datatype adt) - | t::ts -> - fprintf fmt "@[<hov 2>(%a" self#pp_tau t ; - List.iter (fun t -> fprintf fmt ",@,%a" self#pp_tau t) ts ; - fprintf fmt ")@ %s@]" (self#datatype adt) - - (* -------------------------------------------------------------------------- *) - (* --- Primitives --- *) - (* -------------------------------------------------------------------------- *) - - method callstyle = CallVar - - method pp_array_cst fmt (key : tau) v = - try - let elt = T.typeof v in - let tau = Array(key,elt) in - fprintf fmt "@[<hov 2>(const(%a)@ : %a)@]" - self#pp_flow v self#pp_tau tau - with Not_found -> - fprintf fmt "const(%a)" self#pp_flow v - - (* -------------------------------------------------------------------------- *) - (* --- Arithmetics --- *) - (* -------------------------------------------------------------------------- *) - - method pp_int amode fmt z = match amode with - | Aint -> pp_print_string fmt (Z.to_string z) - | Areal -> fprintf fmt "%s.0" (Z.to_string z) - - method pp_real fmt r = - if Z.equal r.Q.den Z.one then - self#pp_int Areal fmt r.Q.num - else - fprintf fmt "(%a@ / %a)" - (self#pp_int Areal) r.Q.num - (self#pp_int Areal) r.Q.den - - method op_real_of_int = Call "real_of_int" - - method op_minus (_:amode) = Op "-" - method op_add (_:amode) = Assoc "+" - method op_sub (_:amode) = Assoc "-" - method op_mul (_:amode) = Assoc "*" - method op_div = function Aint -> Call "div" | Areal -> Op "/" - method op_mod = function Aint -> Call "mod" | Areal -> Call "rmod" - - method op_eq cmode _amode = - match cmode with - | Cprop -> Op "=" - | Cterm -> Call "eqb" - - method op_neq cmode _amode = - match cmode with - | Cprop -> Op "<>" - | Cterm -> Call "neqb" - - method op_lt cmode amode = - match cmode , amode with - | Cprop , _ -> Op "<" - | Cterm , Aint -> Call "zlt" - | Cterm , Areal -> Call "rlt" - - method op_leq cmode amode = - match cmode , amode with - | Cprop , _ -> Op "<=" - | Cterm , Aint -> Call "zleq" - | Cterm , Areal -> Call "rleq" - - (* -------------------------------------------------------------------------- *) - (* --- Logical Connectives --- *) - (* -------------------------------------------------------------------------- *) - - method e_true _ = "true" - method e_false _ = "false" - - method op_not = function Cprop -> Op "not" | Cterm -> Call "notb" - method op_and = function Cprop -> Assoc "and" | Cterm -> Call "andb" - method op_or = function Cprop -> Assoc "or" | Cterm -> Call "orb" - method op_imply = function Cprop -> Assoc "->" | Cterm -> Call "implb" - method op_equiv = function Cprop -> Op "<->" | Cterm -> Call "eqb" - - method op_equal = function Cprop -> Op "=" | Cterm -> Call "eqb" - method op_noteq = function Cprop -> Op "<>" | Cterm -> Call "neqb" - - (* -------------------------------------------------------------------------- *) - (* --- Conditional --- *) - (* -------------------------------------------------------------------------- *) - - method pp_conditional fmt a b c = - match Export.pmode self#mode with - | Negative -> - let cond = T.e_and [T.e_imply [a] b ; T.e_imply [T.e_not a] c] in - self#pp_flow fmt cond - | Positive -> - let cond = T.e_or [T.e_and [a;b] ; T.e_and [T.e_not a;c]] in - self#pp_flow fmt cond - | Boolean -> - begin - fprintf fmt "@[<hov 2>match_bool(" ; - self#with_mode Mterm (fun _ -> self#pp_atom fmt a) ; - fprintf fmt ",@ %a" self#pp_atom b ; - fprintf fmt ",@ %a" self#pp_atom c ; - fprintf fmt ")@]" ; - end - - (* -------------------------------------------------------------------------- *) - (* --- Records --- *) - (* -------------------------------------------------------------------------- *) - - method op_record = "{" , "}" - - (* -------------------------------------------------------------------------- *) - (* --- Atomicity --- *) - (* -------------------------------------------------------------------------- *) - - method op_spaced = is_identifier - method is_atomic e = - match T.repr e with - | Kint z -> Z.leq Z.zero z - | Kreal _ -> true - | Apply _ -> true - | Acst _ | Aset _ | Aget _ | Fun _ -> true - | _ -> T.is_simple e - - (* -------------------------------------------------------------------------- *) - (* --- Lets --- *) - (* -------------------------------------------------------------------------- *) - - method typeof e = T.typeof e - - val mutable quantify_let = false - method set_quantify_let e = quantify_let <- e - - method pp_let fmt pmode x e = - try - let tau = self#typeof e in - match pmode with - | Positive when quantify_let -> - fprintf fmt "@[<hov 4>forall %s : %a. %s = %a ->@]@ " - x self#pp_tau tau x self#pp_flow e - | Negative when quantify_let -> - fprintf fmt "@[<hov 4>exists %s : %a. %s = %a and@]@ " - x self#pp_tau tau x self#pp_flow e - | _ -> - fprintf fmt "@[<hov 4>let %s = %a : %a in@]@ " - x self#pp_atom e self#pp_tau tau - with Not_found -> - fprintf fmt "@[<hov 4>let %s = %a in@]@ " - x self#pp_flow e - - (* -------------------------------------------------------------------------- *) - (* --- Binders --- *) - (* -------------------------------------------------------------------------- *) - - method pp_forall tau fmt = function - | [] -> () - | x::xs -> - fprintf fmt "@[<hov 2>forall %a" self#pp_var x ; - List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; - fprintf fmt "@ : %a.@]" self#pp_tau tau ; - - method pp_intros tau fmt = function - | [] -> () - | x::xs -> - fprintf fmt "@[<hov 2>forall %a" self#pp_var x ; - List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; - fprintf fmt "@ : %a@]" self#pp_tau tau ; - - method pp_exists tau fmt = function - | [] -> () - | x::xs -> - fprintf fmt "@[<hov 2>exists %a" self#pp_var x ; - List.iter (fun x -> fprintf fmt ",@,%a" self#pp_var x) xs ; - fprintf fmt "@ : %a.@]" self#pp_tau tau ; - - method pp_trigger fmt t = - let rec pretty fmt = function - | TgAny -> assert false - | TgVar x -> self#pp_var fmt (self#find x) - | TgGet(t,k) -> fprintf fmt "@[<hov 2>%a[%a]@]" pretty t pretty k - | TgSet(t,k,v) -> fprintf fmt "@[<hov 2>%a[%a@ <- %a]@]" pretty t pretty k pretty v - | TgFun(f,ts) -> call Cterm f fmt ts - | TgProp(f,ts) -> call Cprop f fmt ts - and call mode f fmt ts = - match self#link f, mode with - | F_call f, _ - | F_bool_prop (f,_), Cterm - | F_bool_prop (_,f), Cprop -> - Plib.pp_call_var ~f pretty fmt ts - | F_left f, _ -> Plib.pp_fold_call ~f pretty fmt ts - | F_right f, _ -> Plib.pp_fold_call_rev ~f pretty fmt (List.rev ts) - | F_assoc op, _ -> Plib.pp_assoc ~e:"?" ~op pretty fmt ts - | F_subst s, _ -> Plib.substitute_list pretty s fmt ts - | F_list(fc,fn) , _ -> - let rec plist fc fn fmt = function - | [] -> pp_print_string fmt fn - | x::xs -> - fprintf fmt "[<hov 2>%s(@,%a,@,%a)@]" fc - pretty x (plist fc fn) xs - in plist fc fn fmt ts - in fprintf fmt "@[<hov 2>%a@]" pretty t - - method pp_goal fmt p = self#pp_prop fmt p - - (* -------------------------------------------------------------------------- *) - (* --- Declarations --- *) - (* -------------------------------------------------------------------------- *) - - method pp_declare_adt fmt adt = function - | 0 -> fprintf fmt "type %s" (self#datatype adt) - | 1 -> fprintf fmt "type %a %s" self#pp_tvar 1 (self#datatype adt) - | n -> - begin - fprintf fmt "type (%a" self#pp_tvar 1 ; - for i=2 to n do fprintf fmt ",%a" self#pp_tvar i done ; - fprintf fmt ") %s" (self#datatype adt) ; - end - - method pp_declare_def fmt adt n def = - begin - fprintf fmt "(* @[<hov 4>inlined type " ; - self#pp_declare_adt fmt adt n ; - fprintf fmt "@ = %a@] *)" self#pp_tau def ; - self#set_typedef adt def ; - end - - method pp_declare_sum fmt adt n cases = - let is_enum = function (_,[]) -> true | _ -> false in - if List.for_all is_enum cases then - begin - fprintf fmt "@[<hov 4>" ; - self#pp_declare_adt fmt adt n ; - Plib.iteri - (fun index (c,_) -> match index with - | Ifirst | Isingle -> - fprintf fmt " = %s" (link_name (self#link c)) - | Imiddle | Ilast -> - fprintf fmt "@ | %s" (link_name (self#link c)) - ) cases ; - fprintf fmt "@]" - end - else - begin - self#pp_declare_adt fmt adt n ; - pp_print_newline fmt () ; - let result = Data(adt,Kind.type_params n) in - List.iter - (fun (c,ts) -> - self#declare_signature fmt c ts result - ) cases ; - let rank = "rank_" ^ self#datatype adt in - fprintf fmt "logic %s : %a -> int@\n" rank self#pp_tau result ; - Plib.iterk - (fun k (c,ts) -> - fprintf fmt "@[<hov 2>axiom %s_%d:@ " rank k ; - let xs = Plib.mapk - (fun k t -> - fprintf fmt "forall x%d:%a.@ " k self#pp_tau t ; - Printf.sprintf "x%d" k) ts - in - let f = link_name (self#link c) in - fprintf fmt "%s(%a)=%d@]@\n" rank - (Plib.pp_call_var ~f pp_print_string) - xs k - ) cases ; - end - - method declare_signature fmt f ts t = - begin - fprintf fmt "@[<hv 4>logic %s :@ " (link_name (self#link f)) ; - if ts <> [] then - begin - Plib.pp_listcompact ~sep:"," self#pp_tau fmt ts ; - fprintf fmt "@ -> " ; - end ; - fprintf fmt "%a@]@\n" self#pp_tau t - end - - method declare_definition fmt f xs t e = - self#global - begin fun () -> - let cmode = Export.ctau t in - fprintf fmt "@[<hv 4>%a@,(" (self#pp_declare_symbol cmode) f ; - Plib.pp_listsep ~sep:"," - (fun fmt x -> - let a = self#bind x in - let t = T.tau_of_var x in - fprintf fmt "%a:%a" self#pp_var a self#pp_tau t - ) fmt xs ; - match cmode with - | Cprop -> - fprintf fmt ") =@ @[<hov 0>%a@]@]@\n" - self#pp_prop e - | Cterm -> - fprintf fmt ") :@ %a =@ @[<hov 0>%a@]@]@\n" - self#pp_tau t (self#pp_expr t) e - end - - end - -end diff --git a/src/plugins/qed/export_altergo.mli b/src/plugins/qed/export_altergo.mli deleted file mode 100644 index ec036440e67261ec32333fa965bd1efd08584978..0000000000000000000000000000000000000000 --- a/src/plugins/qed/export_altergo.mli +++ /dev/null @@ -1,74 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -open Logic -open Format -open Plib -open Engine - -(** Exportation Engine for Alt-Ergo. - - Provides a full {{:Export.S.engine-c.html}engine} - from a {{:Export.S.linker-c.html}linker}. *) - -module Make(T : Term) : -sig - - open T - module Env : Engine.Env with type term := term - - type trigger = (T.var,Fun.t) Engine.ftrigger - type typedef = (tau,Field.t,Fun.t) Engine.ftypedef - - class virtual engine : - object - method set_quantify_let : bool -> unit - - method virtual get_typedef : ADT.t -> tau option - method virtual set_typedef : ADT.t -> tau -> unit - - method typeof : term -> tau (** Defaults to T.typeof *) - - inherit [Z.t,ADT.t,Field.t,Fun.t,tau,var,term,Env.t] Engine.engine - method marks : Env.t * T.marks - method op_spaced : string -> bool - method op_record : string * string - method pp_forall : tau -> string list printer - method pp_intros : tau -> string list printer - method pp_exists : tau -> string list printer - method pp_param : (string * tau) printer - method pp_trigger : (var,Fun.t) ftrigger printer - method pp_declare_symbol : cmode -> Fun.t printer - method pp_declare_adt : formatter -> ADT.t -> int -> unit - method pp_declare_def : formatter -> ADT.t -> int -> tau -> unit - method pp_declare_sum : formatter -> ADT.t -> int -> (Fun.t * tau list) list -> unit - method pp_goal : formatter -> term -> unit - - method declare_type : formatter -> ADT.t -> int -> typedef -> unit - method declare_prop : kind:string -> formatter -> string -> T.var list -> trigger list list -> term -> unit - method declare_axiom : formatter -> string -> var list -> trigger list list -> term -> unit - method declare_signature : formatter -> Fun.t -> tau list -> tau -> unit - method declare_definition : formatter -> Fun.t -> var list -> tau -> term -> unit - - end - -end diff --git a/src/plugins/qed/export_coq.ml b/src/plugins/qed/export_coq.ml deleted file mode 100644 index aa39074635d604c21455ec6561e9b7675bf43797..0000000000000000000000000000000000000000 --- a/src/plugins/qed/export_coq.ml +++ /dev/null @@ -1,378 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* -------------------------------------------------------------------------- *) -(* --- Exportation Engine for Coq --- *) -(* -------------------------------------------------------------------------- *) - -open Logic -open Format -open Plib -open Engine -open Export - -module Make(T : Term) = -struct - - module T = T - module E = Export.Make(T) - module Env = E.Env - - open T - - type tau = (Field.t,ADT.t) datatype - type trigger = (var,Fun.t) ftrigger - type typedef = (tau,Field.t,Fun.t) ftypedef - - class virtual engine = - object(self) - - inherit E.engine - - (* -------------------------------------------------------------------------- *) - (* --- Types --- *) - (* -------------------------------------------------------------------------- *) - - method t_int = "Z" - method t_real = "R" - method t_bool = "bool" - method t_prop = "Prop" - method t_atomic = function - | Int | Real | Bool | Prop | Tvar _ -> true - | Array _ -> false - | Data(_,[]) -> true - | Data _ -> false - | Record _ -> true - - method pp_array fmt t = - fprintf fmt "array %a" self#pp_subtau t - - method pp_farray fmt a b = - fprintf fmt "farray %a %a" self#pp_subtau a self#pp_subtau b - - method pp_tvar fmt k = - if 1 <= k && k <= 26 then - let c = int_of_char 'A' + (k-1) in - pp_print_char fmt (char_of_int c) - else - fprintf fmt "A%d" k - - method virtual datatype : T.ADT.t -> string - - method pp_datatype adt fmt = function - | [] -> pp_print_string fmt (self#datatype adt) - | ts -> Plib.pp_call_apply ~f:(self#datatype adt) self#pp_subtau fmt ts - - (* -------------------------------------------------------------------------- *) - (* --- Primitives --- *) - (* -------------------------------------------------------------------------- *) - - method callstyle = CallApply - method op_scope = function Aint -> Some "%Z" | Areal -> Some "%R" - - method pp_int _amode fmt z = pp_print_string fmt (Z.to_string z) - method pp_real fmt q = - fprintf fmt "( %s / %s )%%R" - (Z.to_string q.Q.num) - (Z.to_string q.Q.den) - - method e_true = function Cterm -> "true" | Cprop -> "True" - method e_false = function Cterm -> "false" | Cprop -> "False" - - (* -------------------------------------------------------------------------- *) - (* --- Arithmetics --- *) - (* -------------------------------------------------------------------------- *) - - method op_add (_:amode) = Assoc "+" - method op_sub (_:amode) = Assoc "-" - method op_mul (_:amode) = Assoc "*" - method op_div = function Aint -> Call "Cdiv" | Areal -> Call "Rdiv" - method op_mod = function Aint -> Call "Cmod" | Areal -> Call "Rmod" - method op_minus (_:amode) = Op "-" - method op_real_of_int = Call "IZR" - - method op_eq (c:cmode) (a:amode) = - match c , a with - | Cprop , _ -> Op "=" - | Cterm , Aint -> Call "Zeq_bool" - | Cterm , Areal -> Call "Req_bool" - - method op_neq (c:cmode) (a:amode) = - match c , a with - | Cprop , _ -> Op "<>" - | Cterm , Aint -> Call "Zneq_bool" - | Cterm , Areal -> Call "Rneq_bool" - - method op_lt (c:cmode) (a:amode) = - match c , a with - | Cprop , _ -> Op "<" - | Cterm , Aint -> Call "Zlt_bool" - | Cterm , Areal -> Call "Rlt_bool" - - method op_leq (c:cmode) (a:amode) = - match c , a with - | Cprop , _ -> Op "<=" - | Cterm , Aint -> Call "Zle_bool" - | Cterm , Areal -> Call "Rle_bool" - - (* -------------------------------------------------------------------------- *) - (* --- Connectives --- *) - (* -------------------------------------------------------------------------- *) - - method op_not = function Cterm -> Call "negb" | Cprop -> Op "~" - method op_or = function Cterm -> Call "orb" | Cprop -> Assoc "\\/" - method op_and = function Cterm -> Call "andb" | Cprop -> Assoc "/\\" - method op_imply = function Cterm -> Call "implb" | Cprop -> Assoc "->" - method op_equiv = function Cterm -> Call "eqb" | Cprop -> Op "<->" - method op_equal = function Cterm -> Call "Aeq_bool" | Cprop -> Op "=" - method op_noteq = function Cterm -> Call "Aneq_bool" | Cprop -> Op "<>" - - (* -------------------------------------------------------------------------- *) - (* --- Conditional --- *) - (* -------------------------------------------------------------------------- *) - - method pp_conditional fmt a b c = - match Export.pmode self#mode with - | Negative -> - begin - fprintf fmt "branch@ %a@ %a@ %a" - self#pp_atom a self#pp_atom b self#pp_atom c ; - end - | Positive -> - begin - fprintf fmt "itep@ %a@ %a@ %a" - self#pp_atom a self#pp_atom b self#pp_atom c ; - end - | Boolean -> - begin - fprintf fmt "@[<hov 0>if " ; - self#with_mode Mterm (fun _ -> self#pp_atom fmt a) ; - fprintf fmt "@ then %a" self#pp_atom b ; - fprintf fmt "@ else %a" self#pp_atom c ; - fprintf fmt "@]" ; - end - - (* -------------------------------------------------------------------------- *) - (* --- Arrays --- *) - (* -------------------------------------------------------------------------- *) - - method pp_array_cst fmt k v = - let pp_domain fmt v = - try self#pp_tau fmt (T.typeof v) - with Not_found -> pp_print_string fmt "_" - in - fprintf fmt "@[<hov 2>(const@ %a :@ farray@ %a@ %a)@]" - self#pp_atom v self#pp_tau k pp_domain v - - method pp_array_get fmt m k = - fprintf fmt "%a.[ %a ]" self#pp_atom m self#pp_flow k - - method pp_array_set fmt m k v = - fprintf fmt "%a.[ %a <- %a ]" self#pp_atom m self#pp_flow k self#pp_flow v - - (* -------------------------------------------------------------------------- *) - (* --- Records --- *) - (* -------------------------------------------------------------------------- *) - - method virtual field : T.Field.t -> string - - method pp_get_field fmt r f = - fprintf fmt "%s@ %a" (self#field f) self#pp_atom r - - method pp_def_fields fmt fvs = - begin - fprintf fmt "@[<hov 2>{|" ; - Plib.iteri - (fun i (f,v) -> match i with - | Ifirst | Imiddle -> - fprintf fmt "@ @[<hov 2>%s := %a ;@]" (self#field f) self#pp_flow v - | Isingle | Ilast -> - fprintf fmt "@[<hov 2>%s := %a@]" (self#field f) self#pp_flow v - ) fvs ; - fprintf fmt "@ |}@]" ; - end - - (* -------------------------------------------------------------------------- *) - (* --- Atomicity --- *) - (* -------------------------------------------------------------------------- *) - - method op_spaced = is_identifier - - method is_atomic e = - match T.repr e with - | Kint z -> Z.leq Z.zero z - | Kreal _ -> true - | Apply(_,[]) | Rdef _ -> true - | Apply _ | Acst _ | Aset _ | Aget _ | Rget _ -> false - | Eq _ | Neq _ | Lt _ | Leq _ - | And _ | Or _ | Imply _ | Bind _ | Fun _ | If _ -> false - | _ -> T.is_simple e - - method pp_let fmt (_:pmode) x e = - fprintf fmt "@[<hov 4>let %s := %a in@]@ " x self#pp_flow e - - (* -------------------------------------------------------------------------- *) - (* --- Higher Order --- *) - (* -------------------------------------------------------------------------- *) - - method pp_apply _cmode e fmt es = - begin - fprintf fmt "@[<hov 3>(%a" self#pp_atom e ; - List.iter (fun a -> fprintf fmt "@ %a" self#pp_atom a) es ; - fprintf fmt ")@]" - end - - method private pp_param fmt (x,t) = - fprintf fmt "(%a : %a)" self#pp_var x self#pp_tau t - - method pp_forall tau fmt = function - | [] -> () - | x::xs -> - fprintf fmt "@[<hov 2>forall (%a" self#pp_var x ; - List.iter (fun y -> fprintf fmt "@ %a" self#pp_var y) xs ; - fprintf fmt "@ : %a),@]" self#pp_tau tau - - method pp_exists tau fmt = function - | [] -> () - | x::xs -> - fprintf fmt "@[<hov 2>exists %a : %a@]," - self#pp_var x self#pp_tau tau ; - List.iter - (fun x -> - fprintf fmt "@ @[<hov 2>exists %a : %a@]," - self#pp_var x self#pp_tau tau) xs - - method pp_lambda fmt xs = - Plib.iteri - (fun i x -> match i with - | Isingle -> fprintf fmt "@[<hov 2>fun %a =>@]@ " self#pp_param x - | Ifirst -> fprintf fmt "@[<hov 2>fun %a" self#pp_param x - | Imiddle -> fprintf fmt "@ %a" self#pp_param x - | Ilast -> fprintf fmt "@ %a =>@]@ " self#pp_param x - ) xs - - (* -------------------------------------------------------------------------- *) - (* --- Declarations --- *) - (* -------------------------------------------------------------------------- *) - - method private pp_declare_poly fmt n = - if n > 0 then - begin - fprintf fmt " (" ; - for i=1 to n do fprintf fmt "%a " self#pp_tvar i done ; - fprintf fmt " : Type)" ; - end ; - - method declare_type fmt adt n = function - | Tabs -> - begin - fprintf fmt "Parameter %s" (self#datatype adt) ; - self#pp_declare_poly fmt n ; - fprintf fmt " : Type.@\n" - end - | Tdef def -> - begin - fprintf fmt "@[<hov 2>Definition %s" (self#datatype adt) ; - self#pp_declare_poly fmt n ; - fprintf fmt " : Type :=@ %a@].@\n" self#pp_tau def ; - end - | Trec fts -> - begin - fprintf fmt "@[<hv 0>Record %s" (self#datatype adt) ; - self#pp_declare_poly fmt n ; - fprintf fmt " : Type := {@[<hv 2>" ; - Plib.iteri - (fun idx (f,t) -> - match idx with - | Ifirst | Imiddle -> - fprintf fmt "@ %s : %a ;" (self#field f) self#pp_tau t - | Isingle | Ilast -> - fprintf fmt "@ %s : %a" (self#field f) self#pp_tau t - ) fts ; - fprintf fmt "@]@ }@].@\n" ; - end - | Tsum cases -> - begin - fprintf fmt "@[<hv 0>Inductive %s" (self#datatype adt) ; - self#pp_declare_poly fmt n ; - fprintf fmt " : Type :=" ; - let result = Data(adt,Kind.type_params n) in - List.iter - (fun (c,ts) -> - fprintf fmt "@ | @[<hov 2>%s : " (link_name (self#link c)) ; - List.iter (fun t -> fprintf fmt "@ %a ->" self#pp_tau t) ts ; - fprintf fmt "@ %a@]" self#pp_tau result ; - ) cases ; - fprintf fmt ".@]@\n" ; - end - - method declare_signature fmt f ts t = - begin - fprintf fmt "@[<hov 4>Parameter %s :" (link_name (self#link f)) ; - List.iter (fun t -> fprintf fmt "@ %a ->" self#pp_tau t) ts ; - fprintf fmt "@ %a.@]@\n" self#pp_tau t ; - end - - method declare_inductive fmt f ts t l = - begin - fprintf fmt "@[<hov 4>Inductive %s :" (link_name (self#link f)) ; - List.iter (fun t -> fprintf fmt "@ %a ->" self#pp_tau t) ts ; - fprintf fmt "@ %a :=" self#pp_tau t ; - List.iter - (fun (lemma,xs,(_:trigger list list),p) -> - fprintf fmt "@ | @[<hov 2>%s: %a@]" lemma self#pp_prop (T.e_forall xs p) - ) l ; - fprintf fmt ".@]@\n" - end - - method declare_definition fmt f xs t e = - self#global - begin fun () -> - fprintf fmt "@[<hov 4>Definition %s" (link_name (self#link f)) ; - List.iter - (fun x -> - let a = self#bind x in - let t = T.tau_of_var x in - fprintf fmt "@ (%a : %a)" self#pp_var a self#pp_tau t - ) xs ; - fprintf fmt "@ : %a :=@ " self#pp_tau t ; - fprintf fmt "@[<hov 2>%a@]@].@\n" (self#pp_expr t) e ; - end - - method declare_fixpoint ~prefix fmt f xs t e = - begin - self#declare_signature fmt f (List.map tau_of_var xs) t ; - let fix = prefix ^ (link_name (self#link f)) in - self#declare_axiom fmt fix xs [] - (e_eq (e_fun ~result:t f (List.map e_var xs)) e) ; - end - - method declare_axiom fmt lemma xs (_:trigger list list) p = - self#global - begin fun () -> - fprintf fmt "@[<hov 2>Hypothesis %s: %a@].@\n" - lemma self#pp_prop (T.e_forall xs p) - end - - end - -end diff --git a/src/plugins/qed/export_coq.mli b/src/plugins/qed/export_coq.mli deleted file mode 100644 index 1ae4f8c41367b7497c744aadf9e0c22c99c804f4..0000000000000000000000000000000000000000 --- a/src/plugins/qed/export_coq.mli +++ /dev/null @@ -1,52 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -open Logic -open Format - -(** Exportation Engine for Coq. - - Provides a full {{:Export.S.engine-c.html}engine} - from a {{:Export.S.linker-c.html}linker}. *) - -module Make(T : Term) : -sig - - open T - module Env : Engine.Env with type term := term - type trigger = (var,Fun.t) Engine.ftrigger - type typedef = (tau,Field.t,Fun.t) Engine.ftypedef - - class virtual engine : - object - inherit [Z.t,ADT.t,Field.t,Fun.t,tau,var,term,Env.t] Engine.engine - method marks : Env.t * T.marks - method op_spaced : string -> bool - method declare_type : formatter -> ADT.t -> int -> typedef -> unit - method declare_axiom : formatter -> string -> var list -> trigger list list -> term -> unit - method declare_fixpoint : prefix:string -> formatter -> Fun.t -> var list -> tau -> term -> unit - method declare_signature : formatter -> Fun.t -> tau list -> tau -> unit - method declare_inductive : formatter -> Fun.t -> tau list -> tau -> (string * var list * trigger list list * term) list -> unit - method declare_definition : formatter -> Fun.t -> var list -> tau -> term -> unit - end - -end diff --git a/src/plugins/qed/export_why3.ml b/src/plugins/qed/export_why3.ml index 6ed4f1b2e7b448e78d4efabac0a73d73d8626404..2d7b39ce7c3d5412c4ee2cd93ffe2cf283f1e155 100644 --- a/src/plugins/qed/export_why3.ml +++ b/src/plugins/qed/export_why3.ml @@ -231,7 +231,7 @@ struct | F_left f, _ -> Plib.pp_fold_apply ~f pretty fmt ts | F_right f, _ -> Plib.pp_fold_apply_rev ~f pretty fmt (List.rev ts) | F_assoc op, _ -> Plib.pp_assoc ~op pretty fmt ts - | F_subst s, _ -> Plib.substitute_list pretty s fmt ts + | F_subst (_, s), _ -> Plib.substitute_list pretty s fmt ts | F_list(fc,fn) , _ -> let rec plist fc fn fmt = function | [] -> pp_print_string fmt fn diff --git a/src/plugins/wp/Cfloat.ml b/src/plugins/wp/Cfloat.ml index 5f5c5ad8df01dd8e53c3756ee62c26eae3b72846..7dd70297684fa32b6293c1f90e365419fa3a98d4 100644 --- a/src/plugins/wp/Cfloat.ml +++ b/src/plugins/wp/Cfloat.ml @@ -48,7 +48,7 @@ let ftau = function let ft_suffix = function Float32 -> "f32" | Float64 -> "f64" let pp_suffix fmt ft = Format.pp_print_string fmt (ft_suffix ft) -let link phi = Lang.infoprover (Qed.Engine.F_call phi) +let link phi = Qed.Engine.F_call phi (* Qed exact representations, linked to f32/f64 *) let fq32 = extern_f ~library ~result:t32 ~link:(link "to_f32") "q32" diff --git a/src/plugins/wp/Cmath.ml b/src/plugins/wp/Cmath.ml index bb51d8d1d63c55ec236320720d4bad3babdc0ad9..d286e62658799691ff7b7ecdb7613a051807a7d6 100644 --- a/src/plugins/wp/Cmath.ml +++ b/src/plugins/wp/Cmath.ml @@ -30,7 +30,7 @@ let f_builtin ~library ?(injective=false) ?(result=Real) ?(params=[Real]) ?ext n let call = match ext with Some call -> call | None -> String.sub name 1 (String.length name - 1) in - let link = Lang.infoprover (Engine.F_call call) in + let link = Engine.F_call call in let category = let open Qed.Logic in if injective then Injection else Function @@ -180,21 +180,12 @@ let builtin_strict_leq lfun ~domain ~zero ~monotonic a b = (* -------------------------------------------------------------------------- *) let f_iabs = - extern_f ~library:"cmath" - ~link:{ - altergo = Qed.Engine.F_call "abs_int"; - why3 = Qed.Engine.F_call "IAbs.abs"; - coq = Qed.Engine.F_call "Z.abs"; - } "\\iabs" + extern_f ~library:"cmath" ~link:(Qed.Engine.F_call "IAbs.abs") "\\iabs" let f_rabs = extern_f ~library:"cmath" ~result:Real ~params:[Sreal] - ~link:{ - altergo = Qed.Engine.F_call "abs_real"; - why3 = Qed.Engine.F_call "RAbs.abs"; - coq = Qed.Engine.F_call "R.abs"; - } "\\rabs" + ~link:(Qed.Engine.F_call "RAbs.abs") "\\rabs" let () = begin diff --git a/src/plugins/wp/GuiGoal.ml b/src/plugins/wp/GuiGoal.ml index c1a83ee641dcd71777e066c6881750463dc89171..c04201773562b945cbee00f0a703ec94995afe62 100644 --- a/src/plugins/wp/GuiGoal.ml +++ b/src/plugins/wp/GuiGoal.ml @@ -118,7 +118,6 @@ class pane (gprovers : GuiConfig.provers) = let iformat = new iformat in let rformat = new rformat in let strategies = new GuiTactic.strategies () in - let native = List.mem "native:alt-ergo" (Wp_parameters.Provers.get ()) in object(self) val mutable state : state = Empty @@ -140,15 +139,11 @@ class pane (gprovers : GuiConfig.provers) = Config.config_float ~key:"GuiGoal.palette" ~default:0.8 content ); layout#populate (Wbox.panel ~top:toolbar content#widget) ; - let native_ergo = - if native then [ - new GuiProver.prover ~console:text ~prover:VCS.NativeAltErgo - ] else [] in let why3_provers = List.map (fun dp -> new GuiProver.prover ~console:text ~prover:(VCS.Why3 dp)) (Why3.Whyconf.Sprover.elements gprovers#get) in - provers <- native_ergo @ why3_provers ; + provers <- why3_provers ; List.iter (fun p -> palette#add_tool p#tool) provers ; palette#add_tool strategies#tool ; Strategy.iter strategies#register ; @@ -275,7 +270,6 @@ class pane (gprovers : GuiConfig.provers) = autofocus#set mode ; self#update method private provers = - (if native then [ VCS.NativeAltErgo ] else []) @ (List.map (fun dp -> VCS.Why3 dp) (Why3.Whyconf.Sprover.elements gprovers#get)) diff --git a/src/plugins/wp/GuiList.ml b/src/plugins/wp/GuiList.ml index 5bd26da272aae9c91b796182fc56c58b73e91fb9..5db3d2b3246d8776a21304559f7179cd4032057b 100644 --- a/src/plugins/wp/GuiList.ml +++ b/src/plugins/wp/GuiList.ml @@ -151,11 +151,6 @@ class pane (gprovers:GuiConfig.provers) = List.iter self#create_prover [ VCS.Qed ; VCS.Tactical ] ; - let prv = Wp_parameters.Provers.get () in - if List.mem "native:alt-ergo" prv then - self#create_prover VCS.NativeAltErgo ; - if List.mem "native:coq" prv then - self#create_prover VCS.NativeCoq ; ignore (list#add_column_empty) ; list#set_selection_mode `MULTIPLE ; gprovers#connect self#configure ; diff --git a/src/plugins/wp/GuiNavigator.ml b/src/plugins/wp/GuiNavigator.ml index 49b85d6d68588a439e1069d0f4259f649f18e274..d92911dc44128a9145abc4e61097cc1aa67aeb5e 100644 --- a/src/plugins/wp/GuiNavigator.ml +++ b/src/plugins/wp/GuiNavigator.ml @@ -261,8 +261,6 @@ class behavior | _ -> let mode = match mode , prover with | Some m , _ -> m - | None , VCS.NativeCoq -> VCS.Edit - | None , VCS.NativeAltErgo -> VCS.Fix | _ -> if VCS.is_auto prover then VCS.Batch else VCS.Fix in schedule (Prover.prove w ~mode ~result prover) ; refresh w @@ -289,8 +287,6 @@ class behavior val popup_qed = new Widget.popup () val popup_tip = new Widget.popup () - val popup_ergo = new Widget.popup () - val popup_coq = new Widget.popup () val popup_why3_auto = new Widget.popup () val popup_why3_inter = new Widget.popup () val mutable popup_target = None @@ -332,10 +328,6 @@ class behavior popup_why3_inter#add_item ~label:"Check Script" ~callback:(self#popup_run VCS.Batch) ; popup_why3_inter#add_item ~label:"Edit Script" ~callback:(self#popup_run VCS.Edit) ; popup_why3_inter#add_item ~label:"Fixup Script" ~callback:(self#popup_run VCS.FixUpdate) ; - self#add_popup_proofmodes popup_ergo - [ "Run",Batch ; "Open Altgr-Ergo on Fail",Edit ; "Open Altgr-Ergo",Edit ] ; - self#add_popup_proofmodes popup_coq - [ "Check Proof",Batch ; "Edit on Fail",Edit ; "Edit Proof",Edit ] ; end method private popup w p = @@ -345,8 +337,6 @@ class behavior match p with | None | Some Tactical -> popup_tip#run () | Some Qed -> popup_qed#run () - | Some NativeCoq -> popup_coq#run () - | Some NativeAltErgo -> popup_ergo#run () | Some (Why3 _ as p) -> if VCS.is_auto p then popup_why3_auto#run () diff --git a/src/plugins/wp/GuiProver.ml b/src/plugins/wp/GuiProver.ml index 2105cb52f7956f16fab36c63e30a3c9c88599b01..2ff42a0eb2c54072ddc1ad675415a0d51e147003 100644 --- a/src/plugins/wp/GuiProver.ml +++ b/src/plugins/wp/GuiProver.ml @@ -27,15 +27,15 @@ let wg_status = `Share "theme/default/surely_invalid.png" let smoke_status = `Share "theme/default/valid_under_hyp.png" let filter = function - | VCS.Qed | VCS.Tactical | VCS.NativeCoq -> false - | VCS.Why3 _ | VCS.NativeAltErgo -> true + | VCS.Qed | VCS.Tactical -> false + | VCS.Why3 _ -> true (* -------------------------------------------------------------------------- *) (* --- Palette Tool --- *) (* -------------------------------------------------------------------------- *) let timeout_for = function - | VCS.NativeAltErgo | VCS.Why3 _ -> + | VCS.Why3 _ -> let value = Wp_parameters.Timeout.get () in let spin = new Widget.spinner ~tooltip:"Prover Timeout (0 for none)" @@ -44,7 +44,7 @@ let timeout_for = function | _ -> None let stepout_for = function - | VCS.NativeAltErgo -> + | VCS.Why3 _ -> let value = Wp_parameters.Steps.get () in let spin = new Widget.spinner ~tooltip:"Prover Step Limit (0 for none)" diff --git a/src/plugins/wp/Lang.ml b/src/plugins/wp/Lang.ml index a75ac05e65cba2e5466a73ce9eebcdeeddaaa5ac..a2f02f254515b8036e078a1966612b9bb8cc827b 100644 --- a/src/plugins/wp/Lang.ml +++ b/src/plugins/wp/Lang.ml @@ -104,27 +104,6 @@ let lemma_id l = Printf.sprintf "Q_%s" (avoid_leading_backlash l) (* -------------------------------------------------------------------------- *) -type 'a infoprover = - { - altergo: 'a; - why3 : 'a; - coq : 'a; - } - -(* generic way to have different informations for the provers *) - -let infoprover x = { - altergo = x; - why3 = x; - coq = x; -} - -let map_infoprover f i = { - altergo = f i.altergo; - why3 = f i.why3; - coq = f i.coq; -} - type library = string type datakind = KValue | KInit @@ -137,7 +116,7 @@ type adt = and mdt = string extern (** name to print to the provers *) and 'a extern = { ext_id : int; - ext_link : 'a infoprover; + ext_link : 'a ; ext_library : library; (** a library which it depends on *) ext_debug : string; (** just for printing during debugging *) } @@ -259,8 +238,8 @@ struct type t = adt let basename = function - | Mtype a -> basename "M" a.ext_link.altergo - | Mrecord(r,_) -> basename "R" r.ext_link.altergo + | Mtype a -> basename "M" a.ext_link + | Mrecord(r,_) -> basename "R" r.ext_link | Comp (c,KValue) -> basename (if c.cstruct then "S" else "U") c.corig_name | Comp (c,KInit) -> basename (if c.cstruct then "IS" else "IU") c.corig_name | Atype lt -> basename "A" lt.lt_name @@ -327,11 +306,11 @@ let is_builtin_type ~name = function | _ -> false let datatype ~library name = - let m = new_extern ~link:(infoprover name) ~library ~debug:name in + let m = new_extern ~link:name ~library ~debug:name in Mtype m let record ~link ~library fts = - let m = new_extern ~link ~library ~debug:link.altergo in + let m = new_extern ~link ~library ~debug:link in let r = { fields = [] } in let fs = List.map (fun (f,t) -> Mfield(m,r,f,t)) fts in r.fields <- fs ; Mrecord(m,r) @@ -491,7 +470,7 @@ let symbolf | Right -> Engine.F_right n in let link = match link with - | None -> infoprover (conv name balance) + | None -> conv name balance | Some info -> info in Extern (new_extern ~library:th ~link ~debug:name) in @@ -523,11 +502,11 @@ let extern_f let extern_p ~library ?bool ?prop ?link ?(params=[]) ?(coloring=false) () = let link = match bool,prop,link with - | Some b , Some p , None -> infoprover (Engine.F_bool_prop(b,p)) + | Some b , Some p , None -> Engine.F_bool_prop(b,p) | _ , _ , Some info -> info | _ , _ , _ -> assert false in - let debug = Export.debug link.altergo in + let debug = Export.debug link in Model { m_category = Logic.Function; m_params = params ; @@ -539,8 +518,8 @@ let extern_p ~library ?bool ?prop ?link ?(params=[]) ?(coloring=false) () = let extern_fp ~library ?(params=[]) ?link ?(coloring=false) phi = let link = match link with - | None -> infoprover (Engine.F_call phi) - | Some link -> map_infoprover (fun phi -> Engine.F_call(phi)) link in + | None -> Engine.F_call phi + | Some link -> Engine.F_call link in Model { m_category = Logic.Function ; m_params = params ; @@ -642,7 +621,6 @@ let parameters phi = Fun.parameters := phi class virtual idprinting = object(self) - method virtual infoprover: 'a. 'a infoprover -> 'a method virtual sanitize : string -> string method sanitize_type = self#sanitize @@ -650,8 +628,8 @@ class virtual idprinting = method sanitize_fun = self#sanitize method datatype = function - | Mtype a -> self#infoprover a.ext_link - | Mrecord(a,_) -> self#infoprover a.ext_link + | Mtype a -> a.ext_link + | Mrecord(a,_) -> a.ext_link | Comp(c, KValue) -> self#sanitize_type (comp_id c) | Comp(c, KInit) -> self#sanitize_type (comp_init_id c) | Atype lt -> self#sanitize_type (type_id lt) @@ -663,7 +641,7 @@ class virtual idprinting = | ACSL f -> Engine.F_call (self#sanitize_fun (logic_id f)) | CTOR c -> Engine.F_call (self#sanitize_fun (ctor_id c)) | Model({m_source=Generated(_,n)}) -> Engine.F_call (self#sanitize_fun n) - | Model({m_source=Extern e}) -> self#infoprover e.ext_link + | Model({m_source=Extern e}) -> e.ext_link end let name_of_lfun = function diff --git a/src/plugins/wp/Lang.mli b/src/plugins/wp/Lang.mli index c685aeaaca38508b78ff5c42a2cb33fd615b9936..514110749b1f0336eb4f14377b20cd5e78ea32ec 100644 --- a/src/plugins/wp/Lang.mli +++ b/src/plugins/wp/Lang.mli @@ -31,19 +31,6 @@ open Qed.Logic type library = string -(** Name for external prover. - - In case a Qed.Engine.link is used, [F_subst] patterns - are not supported for Why-3. *) -type 'a infoprover = { - altergo: 'a; - why3 : 'a; - coq : 'a; -} -(** generic way to have different informations for the provers *) - -val infoprover: 'a -> 'a infoprover -(** same information for all the provers *) (** {2 Naming} Unique identifiers. *) val comp_id : compinfo -> string @@ -67,7 +54,7 @@ type adt = private (** A type is never registered in a Definition.t *) and mdt = string extern (** name to print to the provers *) and 'a extern = { ext_id : int; - ext_link : 'a infoprover; + ext_link : 'a ; ext_library : library; (** a library which it depends on *) ext_debug : string; (** just for printing during debugging *) } @@ -105,7 +92,7 @@ val is_builtin_type : name:string -> tau -> bool val get_builtin_type : name:string -> adt val datatype : library:string -> string -> adt val record : - link:string infoprover -> library:string -> (string * tau) list -> adt + link:string -> library:string -> (string * tau) list -> adt val comp : compinfo -> adt val comp_init : compinfo -> adt val field : adt -> string -> field @@ -119,7 +106,7 @@ type balance = Nary | Left | Right val extern_s : library:library -> - ?link:(Engine.link infoprover) -> + ?link:Engine.link -> ?category:lfun category -> ?params:sort list -> ?sort:sort -> @@ -130,7 +117,7 @@ val extern_s : val extern_f : library:library -> - ?link:(Engine.link infoprover) -> + ?link:Engine.link -> ?balance:balance -> ?category:lfun category -> ?params:sort list -> @@ -145,13 +132,13 @@ val extern_p : library:library -> ?bool:string -> ?prop:string -> - ?link:Engine.link infoprover -> + ?link:Engine.link -> ?params:sort list -> ?coloring:bool -> unit -> lfun val extern_fp : library:library -> ?params:sort list -> - ?link:string infoprover -> ?coloring:bool -> string -> lfun + ?link:string -> ?coloring:bool -> string -> lfun val generated_f : ?context:bool -> ?category:lfun category -> ?params:sort list -> ?sort:sort -> ?result:tau -> ?coloring:bool -> @@ -160,7 +147,7 @@ val generated_f : ?context:bool -> ?category:lfun category -> val generated_p : ?context:bool -> ?coloring:bool -> string -> lfun val extern_t: - string -> link:string infoprover -> library:library -> mdt + string -> link:string -> library:library -> mdt (** {2 Sorting and Typing} *) @@ -209,9 +196,6 @@ class virtual idprinting : object method virtual sanitize : string -> string - method virtual infoprover : 'a. 'a infoprover -> 'a - (** Specify the field to use in an infoprover *) - method sanitize_type : string -> string (** Defaults to [self#sanitize] *) diff --git a/src/plugins/wp/LogicBuiltins.ml b/src/plugins/wp/LogicBuiltins.ml index 5808c304bcfa208cdfd8a5cb7d34bf2f999b9536..04077deac7bbe2232c8eb55c771e16d1e12f6826 100644 --- a/src/plugins/wp/LogicBuiltins.ml +++ b/src/plugins/wp/LogicBuiltins.ml @@ -239,7 +239,7 @@ let add_logic ~source result name kinds ~library ?category ~link () = let add_predicate ~source name kinds ~library ~link () = let params = List.map skind kinds in - let lfun = Lang.extern_fp ~library ~params ~link link.altergo in + let lfun = Lang.extern_fp ~library ~params ~link link in register ~source name kinds (LFUN lfun) let add_ctor ~source name kinds ~library ~link () = @@ -248,7 +248,7 @@ let add_ctor ~source name kinds ~library ~link () = let lfun = Lang.extern_s ~library ~category ~params ~link name in register ~source name kinds (LFUN lfun) -let add_type ?source name ~library ?(link=Lang.infoprover name) () = +let add_type ?source name ~library ?(link=name) () = let mdt = Lang.extern_t name ~link ~library in register_type ?source name (E_mdt mdt) diff --git a/src/plugins/wp/LogicBuiltins.mli b/src/plugins/wp/LogicBuiltins.mli index 2ae96f291fc9cf31a4a5700ed3d4dc41a3be472b..7d4f5dc99001b2203c78a32b96a16508aea070b6 100644 --- a/src/plugins/wp/LogicBuiltins.mli +++ b/src/plugins/wp/LogicBuiltins.mli @@ -78,17 +78,17 @@ val add_library : string -> string list -> unit val add_alias : source:Filepath.position -> string -> kind list -> alias:string -> unit -> unit val add_type : ?source:Filepath.position -> string -> library:string -> - ?link:string infoprover -> unit -> unit + ?link:string -> unit -> unit val add_ctor : source:Filepath.position -> string -> kind list -> - library:string -> link:Qed.Engine.link infoprover -> unit -> unit + library:string -> link:Qed.Engine.link -> unit -> unit val add_logic : source:Filepath.position -> kind -> string -> kind list -> - library:string -> ?category:category -> link:Qed.Engine.link infoprover -> + library:string -> ?category:category -> link:Qed.Engine.link -> unit -> unit val add_predicate : source:Filepath.position -> string -> kind list -> - library:string -> link:string infoprover -> + library:string -> link:string -> unit -> unit val add_option : diff --git a/src/plugins/wp/Makefile.in b/src/plugins/wp/Makefile.in index d9c8c5f2903af5bc661e3015e2dcbba5f025a0bd..e0d4f620803ca394f56cbd1ba015bd08e7418946 100644 --- a/src/plugins/wp/Makefile.in +++ b/src/plugins/wp/Makefile.in @@ -34,7 +34,7 @@ ifneq ("$(FRAMAC_INTERNAL)","yes") include $(FRAMAC_SHARE)/Makefile.config endif -# Coq Resources Installation +# Resources Installation include $(PLUGIN_DIR)/share/Makefile.resources # Extension of the GUI for wp is compilable @@ -84,7 +84,7 @@ PLUGIN_CMO:= \ MemMemory MemTyped MemRegion MemVal \ wpReached wpRTE wpTarget \ CfgCompiler StmtSemantics \ - VCS script proof wpo wpReport \ + VCS script wpo wpReport \ Footprint Tactical Strategy \ TacClear TacSplit TacChoice TacRange TacInduction \ TacArray TacCompound TacUnfold \ @@ -94,7 +94,7 @@ PLUGIN_CMO:= \ TacSequence \ TacCongruence TacOverflow Auto \ ProofSession ProofScript ProofEngine \ - ProverTask ProverErgo ProverCoq \ + ProverTask \ filter_axioms Cache ProverWhy3 \ driver prover ProverSearch ProverScript \ Factory \ @@ -158,7 +158,6 @@ endif WP_CONFIGURE_MAKEFILE= \ $(Wp_DIR)/Makefile.in \ - $(Wp_DIR)/share/Makefile.coqwp \ $(Wp_DIR)/share/Makefile.resources \ $(CONFIG_STATUS_DIR)/config.status @@ -303,15 +302,10 @@ clean:: ## All relative to share/ -ALL_COQ_SOURCES= $(addprefix coqwp/, $(COQ_LIBS_CEA) $(COQ_LIBS_INRIA)) -ALL_COQ_BINARIES= $(addsuffix o, $(ALL_COQ_SOURCES)) -ALL_ERGO_SOURCES= $(addprefix ergo/, $(ERGO_LIBS_CEA) $(ERGO_LIBS_INRIA)) ALL_WHY3_SOURCES= $(addprefix why3/frama_c_wp/, $(WHY3_LIBS_CEA)) ALL_RESOURCES= \ wp.driver \ - $(ALL_COQ_SOURCES) \ - $(ALL_ERGO_SOURCES) \ $(ALL_WHY3_SOURCES) INSTALL_OPT?= @@ -326,22 +320,6 @@ clean:: $(Wp_DIR)/share/instwp: $(Wp_DIR)/share/install.ml $(OCAMLC) $(WARNINGS) -w -70 -o $@ unix.cma $^ -# -------------------------------------------------------------------------- -# --- Pre-Compiled Coq Libraries --- -# -------------------------------------------------------------------------- - -WP_COQC_ENABLED=@COQC@ - -ifeq ($(WP_COQC_ENABLED),yes) - -include $(Wp_DIR)/share/Makefile.coqwp - -byte:: coqwpcompile -opt:: coqwpcompile -clean:: wp-coq-clean - -endif #($(WP_COQC_ENABLED),yes) - # -------------------------------------------------------------------------- # --- Installation --- # -------------------------------------------------------------------------- @@ -352,7 +330,7 @@ install:: clean-install $(INSTALL_SHARE) -p \ -i $(Wp_DIR)/share \ -d $(FRAMAC_DATADIR)/wp \ - $(ALL_RESOURCES) -f -b $(ALL_COQ_BINARIES) + $(ALL_RESOURCES) -f -b uninstall:: $(PRINT_RM) WP shared files diff --git a/src/plugins/wp/MemMemory.ml b/src/plugins/wp/MemMemory.ml index 2a1f2ec14ab720ecd36bbcfad79c12668358e1c1..7c4439368ec666ff44f8782f3c23ba1709fccd26 100644 --- a/src/plugins/wp/MemMemory.ml +++ b/src/plugins/wp/MemMemory.ml @@ -34,15 +34,9 @@ let library = "memory" let a_addr = Lang.datatype ~library "addr" let t_addr = L.Data(a_addr,[]) let f_base = Lang.extern_f ~library ~result:L.Int - ~link:{altergo = Qed.Engine.F_subst("%1.base"); - why3 = Qed.Engine.F_call "base"; - coq = Qed.Engine.F_subst("(base %1)"); - } "base" + ~link:(Qed.Engine.F_subst ("base", "%1.base")) "base" let f_offset = Lang.extern_f ~library ~result:L.Int - ~link:{altergo = Qed.Engine.F_subst("%1.offset"); - why3 = Qed.Engine.F_call "offset"; - coq = Qed.Engine.F_subst("(offset %1)"); - } "offset" + ~link:(Qed.Engine.F_subst ("offset", "%1.offset")) "offset" let f_shift = Lang.extern_f ~library ~result:t_addr "shift" let f_global = Lang.extern_f ~library ~result:t_addr ~category:L.Injection "global" let f_null = Lang.extern_f ~library ~result:t_addr "null" @@ -60,17 +54,8 @@ let ty_fst_arg = function | Some l :: _ -> l | _ -> raise Not_found -let l_havoc = Qed.Engine.{ - coq = F_call "fhavoc" ; - altergo = F_call "havoc" ; - why3 = F_call "havoc" ; - } - -let l_set_init = Qed.Engine.{ - coq = F_call "fset_init" ; - altergo = F_call "set_init" ; - why3 = F_call "set_init" ; - } +let l_havoc = Qed.Engine.F_call "havoc" +let l_set_init = Qed.Engine.F_call "set_init" let p_valid_rd = Lang.extern_fp ~library "valid_rd" let p_valid_rw = Lang.extern_fp ~library "valid_rw" diff --git a/src/plugins/wp/MemVal.ml b/src/plugins/wp/MemVal.ml index 41fe7034755482a024ad6f5e08373a439a18058f..f9ce1bc2aee6234cf669662def2482faee5ce75a 100644 --- a/src/plugins/wp/MemVal.ml +++ b/src/plugins/wp/MemVal.ml @@ -93,15 +93,9 @@ let library = "memory" let a_addr = Lang.datatype ~library "addr" let t_addr = Logic.Data(a_addr,[]) let f_base = Lang.extern_f ~library ~result:Logic.Int - ~link:{altergo = Qed.Engine.F_subst("%1.base"); - why3 = Qed.Engine.F_subst("%1.base"); - coq = Qed.Engine.F_subst("(base %1)"); - } "base" + ~link:(Qed.Engine.F_subst ("base", "%1.base")) "base" let f_offset = Lang.extern_f ~library ~result:Logic.Int - ~link:{altergo = Qed.Engine.F_subst("%1.offset"); - why3 = Qed.Engine.F_subst("%1.offset"); - coq = Qed.Engine.F_subst("(offset %1)"); - } "offset" + ~link:(Qed.Engine.F_subst ("offset", "%1.offset")) "offset" let f_shift = Lang.extern_f ~library ~result:t_addr "shift" let f_global = Lang.extern_f ~library ~result:t_addr "global" let f_null = Lang.extern_f ~library ~result:t_addr "null" diff --git a/src/plugins/wp/Plang.ml b/src/plugins/wp/Plang.ml index 57124006229ee4da71d2282c2da6646e4b8490d7..d7db964ede9e406c71deaafb7a2f7d4a7c6a63be 100644 --- a/src/plugins/wp/Plang.ml +++ b/src/plugins/wp/Plang.ml @@ -75,7 +75,6 @@ class engine = object(self) inherit E.engine as super inherit Lang.idprinting - method infoprover w = w.altergo (* --- Types --- *) diff --git a/src/plugins/wp/Plang.mli b/src/plugins/wp/Plang.mli index 8bb4335527bf1fa85615332b80082d2c81605a96..852594b6362e40a55a69c25cbf03e0b3c982063d 100644 --- a/src/plugins/wp/Plang.mli +++ b/src/plugins/wp/Plang.mli @@ -52,7 +52,6 @@ class engine : (**/**) inherit Lang.idprinting method sanitize : string -> string - method infoprover : 'a. 'a Lang.infoprover -> 'a method op_spaced : string -> bool (**/**) end diff --git a/src/plugins/wp/ProverCoq.ml b/src/plugins/wp/ProverCoq.ml deleted file mode 100644 index 75a1361e434a0a813ada48324e9da4cbd8584f8f..0000000000000000000000000000000000000000 --- a/src/plugins/wp/ProverCoq.ml +++ /dev/null @@ -1,671 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* -------------------------------------------------------------------------- *) -(* --- Prover Coq Interface --- *) -(* -------------------------------------------------------------------------- *) - -open Cil_types -open Qed -open Lang -open Definitions - -let dkey = Wp_parameters.register_category "prover" - -let cluster_file c = - let dir = WpContext.directory () in - let base = cluster_id c in - Printf.sprintf "%s/%s.v" (dir :> string) base - -(* -------------------------------------------------------------------------- *) -(* --- External Coq Libraries --- *) -(* -------------------------------------------------------------------------- *) - -(* Applies to both WP resources from the Share, and User-defined libraries *) -let option_file = LogicBuiltins.create_option - (fun ~driver_dir x -> driver_dir ^ "/" ^ x) - "coq" "file" - -type coqlib = { - c_id : string ; (* Identifies the very original file. *) - c_source : string ; (* Original file directory. *) - c_file : string ; (* Relative Coq source file. *) - c_path : string ; (* Relative Coq source directory. *) - c_name : string ; (* Module package. *) - c_module : string ; (* Full module name. *) -} - -(* example: - - { - c_id="/mydir/foobar:a/b/User.v" ; - c_source="/mydir/foobar" ; - c_file= "a/b/User.v" ; - c_path = "a/b" ; - c_name = "a.b" ; - c_module = "a.b.User" ; - } - -*) - -(* Take the directory name and changes all '/' into '.' *) -let name_of_path path = - if path = "." then "" - else - String.map (fun c -> if c = '/' || c = '\\' then '.' else c) path - -let find_nonwin_column opt = - let p = String.rindex opt ':' in - if String.length opt >= 3 && - opt.[1] = ':' && (opt.[2] = '/' || opt.[2] = '\\') && p = 1 then - (* windows absolute path, not <source>:<dir>/<file.v> format. *) - raise Not_found - else p - -(* Parses the coq.file option from the driver. *) -let parse_c_option opt = - try - (* Format "<source>:<dir>/<file.v>" *) - let p = find_nonwin_column opt in - let c_source = String.sub opt 0 p in - let c_file = String.sub opt (p+1) (String.length opt - p - 1) in - let c_path = Filename.dirname c_file in - let c_name = name_of_path c_path in - let coqid = Filename.chop_extension (Filename.basename c_file) in - let c_module = - Printf.sprintf "%s.%s" c_name - (String.capitalize_ascii coqid) - in - { c_id = opt ; c_source ; c_file ; c_path ; c_name ; c_module } - with Not_found -> - (* Format "<source>/<file.v>" *) - let c_source = Filename.dirname opt in - let c_file = Filename.basename opt in - let c_module = - String.capitalize_ascii (Filename.chop_extension c_file) - in - { c_id = opt ; c_source ; c_file ; c_path = "." ; c_name = "" ; c_module } - -let coqlibs = Hashtbl.create 128 (*[LC] Not Projectified. *) -let c_option opt = - try Hashtbl.find coqlibs opt - with Not_found -> - let clib = parse_c_option opt in - Hashtbl.add coqlibs opt clib ; clib -(* -------------------------------------------------------------------------- *) -(* --- Dependencies --- *) -(* -------------------------------------------------------------------------- *) - -type depend = - | D_cluster of cluster (* Generated in <out>/<model>/A.v *) - | D_coqlib of coqlib (* From <source>/ or <out>/coqwp/ *) - -(* -------------------------------------------------------------------------- *) -(* --- Exporting Formulae to Coq --- *) -(* -------------------------------------------------------------------------- *) - -let engine = - let module E = Qed.Export_coq.Make(Lang.F.QED) in - object(self) - inherit E.engine as super - inherit Lang.idprinting - method infoprover p = p.coq - - method! pp_fun cmode fct ts = - if fct == Vlist.f_concat - then Vlist.export self ts - else super#pp_fun cmode fct ts - - end - - -class visitor fmt c = - object(self) - - inherit Definitions.visitor c - inherit ProverTask.printer fmt (cluster_title c) - - val mutable deps : depend list = [] - - (* --- Managing Formatter --- *) - - method flush = - begin - Format.pp_print_newline fmt () ; - List.rev deps - end - - (* --- Files, Theories and Clusters --- *) - - method add_coqfile opt = - let clib = c_option opt in - Format.fprintf fmt "Require Import %s.@\n" clib.c_module ; - deps <- (D_coqlib clib) :: deps - - method on_library thy = - let files = LogicBuiltins.get_option option_file ~library:thy in - List.iter self#add_coqfile files - - method on_cluster c = - self#lines ; - Format.fprintf fmt "Require Import %s.@\n" (cluster_id c) ; - deps <- (D_cluster c) :: deps - - method on_type lt def = - begin - self#lines ; - engine#declare_type fmt (Lang.adt lt) (List.length lt.lt_params) def ; - end - - method private gen_on_comp kind c fts = - begin - self#paragraph ; - let adt = match kind with - | KValue -> Lang.comp c - | KInit -> Lang.comp_init c - in - let t = match fts with - | None -> Qed.Engine.Tabs - | Some fts -> Qed.Engine.Trec fts - in - engine#declare_type fmt adt 0 t ; - end - - method on_comp = self#gen_on_comp KValue - method on_icomp = self#gen_on_comp KInit - - method on_dlemma l = - begin - self#paragraph ; - engine#declare_axiom fmt - (Lang.lemma_id l.l_name) - l.l_forall l.l_triggers - (F.e_prop l.l_lemma) - end - - method on_dfun d = - begin - self#paragraph ; - match d.d_definition with - | Logic t -> - engine#declare_signature fmt - d.d_lfun (List.map F.tau_of_var d.d_params) t ; - | Function(t,mu,v) -> - let pp = match mu with - | Rec -> engine#declare_fixpoint ~prefix:"Fix" - | Def -> engine#declare_definition - in pp fmt d.d_lfun d.d_params t v - | Predicate(mu,p) -> - let pp = match mu with - | Rec -> engine#declare_fixpoint ~prefix:"Fix" - | Def -> engine#declare_definition - in pp fmt d.d_lfun d.d_params Logic.Prop (F.e_prop p) - | Inductive dl -> - engine#declare_inductive fmt - d.d_lfun (List.map F.tau_of_var d.d_params) Logic.Prop - (List.map (fun l -> (Lang.lemma_id l.l_name, - l.l_forall, - l.l_triggers, - (F.e_prop l.l_lemma)) - ) dl) - end - - end - -let write_cluster c = - let f = cluster_file c in - Wp_parameters.debug ~dkey "Generate '%s'" f ; - let deps = Command.print_file f - begin fun fmt -> - let v = new visitor fmt c in - v#lines ; - v#printf "Require Import ZArith.@\n" ; - v#printf "Require Import Reals.@\n" ; - v#on_library "qed" ; - v#vself ; - v#flush ; - end - in Wp_parameters.print_generated f ; deps - -(* -------------------------------------------------------------------------- *) -(* --- Assembling Goal --- *) -(* -------------------------------------------------------------------------- *) - -(* Returns whether source was modified after target *) -let need_recompile ~source ~target = - try - let t_src = (Unix.stat source).Unix.st_mtime in - let t_tgt = (Unix.stat target).Unix.st_mtime in - t_src >= t_tgt - with Unix.Unix_error _ -> true - -(* Used to mark version of clusters already available *) - -module CLUSTERS = WpContext.Index - (struct - type key = cluster - type data = int * depend list - let name = "ProverCoq.FILES" - let compare = cluster_compare - let pretty = pp_cluster - end) - -(* Used to mark coqlib versions to use *) -module Marked = Set.Make - (struct - type t = depend - let compare d1 d2 = - match d1 , d2 with - | D_coqlib _ , D_cluster _ -> (-1) - | D_cluster _ , D_coqlib _ -> 1 - | D_cluster c1 , D_cluster c2 -> Definitions.cluster_compare c1 c2 - | D_coqlib c1 , D_coqlib c2 -> String.compare c1.c_id c2.c_id - end) - -type included = string * string -(* -R <path> <name>, name possibly empty, use -I instead *) -type coqcc = { - mutable marked : Marked.t ; - mutable includes : included list ; (* (reversed) includes with as *) - mutable sources : string list ; (* (reversed) file .v to recompile *) -} - -let add_include coqcc dir = - if not (List.mem dir coqcc.includes) then coqcc.includes <- dir :: coqcc.includes - -let add_source coqcc file = - if not (List.mem file coqcc.sources) then coqcc.sources <- file :: coqcc.sources - -(* Recursive assembly: some file need further dependencies *) - -let rec assemble coqcc d = - if not (Marked.mem d coqcc.marked) then - begin - coqcc.marked <- Marked.add d coqcc.marked ; - match d with - | D_cluster cluster -> assemble_cluster coqcc cluster - | D_coqlib clib -> assemble_coqlib coqcc clib - end - -and assemble_cluster coqcc c = - let (age,deps) = try CLUSTERS.find c with Not_found -> (-1,[]) in - let deps = - if age < cluster_age c then - let deps = write_cluster c in - CLUSTERS.update c (cluster_age c , deps) ; deps - else deps in - List.iter (assemble coqcc) deps ; - add_source coqcc (cluster_file c) - -and assemble_coqlib coqcc c = - let compiled = Printf.sprintf "%s/%so" c.c_source c.c_file in - if Sys.file_exists compiled then - let dir = Printf.sprintf "%s/%s" c.c_source c.c_path in - add_include coqcc (dir,c.c_name) - else - begin - let tgtdir = Wp_parameters.get_output_dir "coqwp" in - let source = Printf.sprintf "%s/%s" c.c_source c.c_file in - let target = Printf.sprintf "%s/%s" (tgtdir :> string) c.c_file in - let dir = Printf.sprintf "%s/%s" (tgtdir :> string) c.c_path in - if need_recompile ~source ~target then - begin - Wp_parameters.make_output_dir dir ; - Command.copy source target ; - end ; - add_include coqcc (dir,c.c_name) ; - add_source coqcc target; - end - -(* -------------------------------------------------------------------------- *) -(* --- Assembling Goal --- *) -(* -------------------------------------------------------------------------- *) - -let assemble_goal ~pid axioms prop = - let title = Pretty_utils.to_string WpPropId.pretty pid in - let model = WpContext.directory () in - let id = WpPropId.get_propid pid in - let file = Printf.sprintf "%s/%s.coq" (model :> string) id in - let goal = cluster ~id ~title () in - let deps = Command.print_file file - begin fun fmt -> - let v = new visitor fmt goal in - v#printf "Require Import ZArith.@\n" ; - v#printf "Require Import Reals.@\n" ; - v#on_library "qed" ; - v#vgoal axioms prop ; - let libs = Wp_parameters.CoqLibs.get () in - if libs <> [] then - begin - v#section "Additional Libraries" ; - List.iter v#add_coqfile libs ; - v#hline ; - end ; - v#paragraph ; - engine#global - begin fun () -> - v#printf "@[<hv 2>Goal@ %a.@]@." - engine#pp_prop (F.e_prop prop) ; - end ; - v#flush - end in - let coqcc = { marked = Marked.empty ; includes = [] ; sources = [] } in - List.iter (assemble coqcc) deps ; - let includes = ((model :> string) , "") :: List.rev coqcc.includes in - let sources = List.rev coqcc.sources in - includes , sources , file - -(* -------------------------------------------------------------------------- *) -(* --- Running Coq --- *) -(* -------------------------------------------------------------------------- *) - -open Task -open VCS - -let coq_timeout () = - let coqtimeout = Wp_parameters.CoqTimeout.get () in - let gentimeout = Wp_parameters.Timeout.get () in - max coqtimeout gentimeout - -let coqide_lock = Task.mutex () -let emacs_regexp = Str.regexp_string_case_fold "emacs" -let is_emacs cmd = - try ignore (Str.search_forward emacs_regexp cmd 0) ; true - with Not_found -> false - -class runcoq includes source = - let base = Filename.chop_extension source in - let logout = base ^ "_Coq.out" in - let logerr = base ^ "_Coq.err" in - object(self) - - inherit ProverTask.command "coq" - - method private project = - let dir = Filename.dirname source in - let p = Wp_parameters.CoqProject.get () in - Command.pp_to_file (Printf.sprintf "%s/%s" dir p) - begin fun fmt -> - List.iter - (fun (dir,name) -> - if name = "" then - Format.fprintf fmt "-R %s ''@\n" dir - else - Format.fprintf fmt "-R %s %s@\n" dir name - ) includes ; - Format.fprintf fmt "-arg@\n" ; - end - - method private options = - begin - List.iter - (fun (dir,name) -> - if name = "" then - self#add ["-R";dir;""] - else - self#add ["-R";dir;name] - ) includes ; - end - - method failed : 'a. 'a task = - begin - let name = Filename.basename source in - Wp_parameters.feedback ~ontty:`Message "[Coq] '%s' compilation failed." name ; - if Wp_parameters.verbose_atleast 1 then - begin - ProverTask.pp_file ~message:"Coqc (stdout)" ~file:logout ; - ProverTask.pp_file ~message:"Coqc (stderr)" ~file:logerr ; - end ; - Task.failed "Compilation of '%s' failed." name ; - end - - method compile = - let cmd = Wp_parameters.CoqCompiler.get () in - self#set_command cmd ; - self#options ; - self#add [ source ] ; - self#timeout (coq_timeout ()) ; - Task.call - (fun () -> - let name = Filename.basename source in - Wp_parameters.feedback ~ontty:`Transient - "[Coq] Compiling '%s'." name) () - >>= self#run ~logout ~logerr - >>= fun r -> - if r = 127 then Task.failed "Command '%s' not found" cmd - else if r <> 0 then self#failed - else Task.return () - - method check = - let cmd = Wp_parameters.CoqCompiler.get () in - self#set_command cmd ; - self#options ; - self#add [ source ] ; - self#timeout (coq_timeout ()) ; - self#run ~logout ~logerr () >>= function - | 127 -> Task.failed "Command '%s' not found" cmd - | 0 -> Task.return true - | 1 -> Task.return false - | _ -> self#failed - - method coqide = - let coqide = Wp_parameters.CoqIde.get () in - self#set_command coqide ; - if is_emacs coqide then - begin - self#project ; - self#add [ source ] ; - end - else - begin - self#options ; - self#add [ source ] ; - end ; - Task.sync coqide_lock (self#run ~logout ~logerr) - end - -(* -------------------------------------------------------------------------- *) -(* --- Compilation Helpers --- *) -(* -------------------------------------------------------------------------- *) - -let shared_demon = ref true -let shared_headers : (string,unit Task.shared) Hashtbl.t = Hashtbl.create 120 - -let shared includes source = - try Hashtbl.find shared_headers source - with Not_found -> - if !shared_demon then - begin - shared_demon := false ; - let server = ProverTask.server () in - Task.on_server_stop server (fun () -> Hashtbl.clear shared_headers) ; - end ; - let shared = Task.shared ~retry:true - (fun () -> (new runcoq includes source)#compile) - in Hashtbl.add shared_headers source shared ; shared - -let rec compile_headers includes forced = function - | [] -> Task.nop - | source::headers -> - let target = source ^ "o" in - if forced || need_recompile ~source ~target then - begin - let cc = shared includes source in - Task.share cc >>= fun () -> compile_headers includes true headers - end - else compile_headers includes forced headers - -(* -------------------------------------------------------------------------- *) -(* --- Coq Prover --- *) -(* -------------------------------------------------------------------------- *) - -let ontty = `Feedback - -open Wpo - -type coq_wpo = { - cw_pid : WpPropId.prop_id ; - cw_gid : string ; - cw_goal : string ; (* filename for goal without proof *) - cw_script : string ; (* filename for goal with proof script *) - cw_headers : string list ; (* filename for libraries *) - cw_includes : included list ; (* -R ... ... *) -} - -let make_script w script closing = - Command.print_file w.cw_script - begin fun fmt -> - Command.pp_from_file fmt w.cw_goal ; - Format.fprintf fmt "Proof.@\n%s%s@\n@." script closing ; - end - -let try_script w script closing = - make_script w script closing ; - (new runcoq w.cw_includes w.cw_script)#check - -let rec try_hints w = function - | [] -> Task.return false - | (kind,script,closing) :: hints -> - Wp_parameters.feedback ~ontty "[Coq] Goal %s : %s" w.cw_gid kind ; - try_script w script closing >>= fun succeed -> - if succeed then - let required,hints = WpPropId.prop_id_keys w.cw_pid in - let keys = List.merge String.compare required hints in - Proof.add_script_for ~gid:w.cw_gid keys script closing ; - Task.return true - else - try_hints w hints - -let try_prove w = - begin - match Proof.script_for ~pid:w.cw_pid ~gid:w.cw_gid with - | Some (script,closing) -> - Wp_parameters.feedback ~ontty "[Coq] Goal %s : Saved script" w.cw_gid ; - try_script w script closing - | None -> Task.return false - end - >>= fun succeed -> - if succeed then - Task.return true - else - try_hints w (Proof.hints_for ~pid:w.cw_pid) - -let try_coqide w = - let script,closing = - Proof.script_for_ide ~pid:w.cw_pid ~gid:w.cw_gid in - make_script w script closing ; - (new runcoq w.cw_includes w.cw_script)#coqide >>= fun st -> - if st = 0 then - match Proof.parse_coqproof w.cw_script with - | None -> - Wp_parameters.feedback "[Coq] No proof found" ; - Task.return false - | Some(script,closing) -> - if Proof.is_empty_script script then - begin - Proof.delete_script_for ~gid:w.cw_gid ; - Task.canceled () ; - end - else - begin - let req,hs = WpPropId.prop_id_keys w.cw_pid in - let hints = List.merge String.compare req hs in - Proof.add_script_for ~gid:w.cw_gid hints script closing ; - Wp_parameters.feedback ~ontty "[Coq] Goal %s : Script" w.cw_gid ; - try_script w script closing - end - else if st = 127 - then Task.failed "CoqIde command '%s' not found" (Wp_parameters.CoqIde.get ()) - else Task.failed "CoqIde exits with status %d." st - -let prove_session ~mode w = - begin - compile_headers w.cw_includes false w.cw_headers >>= - begin fun () -> - match mode with - | Batch | Update -> try_prove w - | Edit -> try_coqide w - | Fix | FixUpdate -> - begin - try_prove w >>> function - | Task.Result true -> Task.return true - | Task.Failed e -> Task.raised e - | Task.Canceled | Task.Timeout _ | Task.Result false -> try_coqide w - end - end - end - >>= Task.call (fun r -> if r then VCS.valid else VCS.unknown) - -let gen_session w = - begin - make_script w " ...\n" "Qed." ; - Wp_parameters.print_generated w.cw_script ; - Task.return VCS.no_result - end - -let prove_session ~mode w = - if Wp_parameters.Generate.get () then - gen_session w - else - prove_session ~mode w - -let prove_prop wpo ~mode ~axioms ~prop = - let pid = wpo.po_pid in - let gid = wpo.po_gid in - let model = wpo.po_model in - let context = Wpo.get_context wpo in - let script = DISK.file_goal ~pid ~model ~prover:NativeCoq in - let includes , headers , goal = - WpContext.on_context context (assemble_goal ~pid axioms) prop - in - prove_session ~mode { - cw_pid = pid ; - cw_gid = gid ; - cw_goal = goal ; - cw_script = script ; - cw_headers = headers ; - cw_includes = includes ; - } - -let prove_annot wpo vcq ~mode = - Task.todo - begin fun () -> - let prop = - WpContext.on_context (Wpo.get_context wpo) - (GOAL.compute_proof ~pid:wpo.po_pid) vcq.VC_Annot.goal in - prove_prop wpo ~mode ~axioms:None ~prop - end - -let prove_lemma wpo vca ~mode = - Task.todo - begin fun () -> - let lemma = vca.VC_Lemma.lemma in - let depends = vca.VC_Lemma.depends in - let prop = F.p_forall lemma.l_forall lemma.l_lemma in - let axioms = Some(lemma.l_cluster,depends) in - prove_prop wpo ~mode ~axioms ~prop - end - -let prove mode wpo = - match wpo.Wpo.po_formula with - | GoalAnnot vcq -> prove_annot wpo vcq ~mode - | GoalLemma vca -> prove_lemma wpo vca ~mode diff --git a/src/plugins/wp/ProverCoq.mli b/src/plugins/wp/ProverCoq.mli deleted file mode 100644 index 35287cc626049deb497a95353d6737e3e44b587a..0000000000000000000000000000000000000000 --- a/src/plugins/wp/ProverCoq.mli +++ /dev/null @@ -1,30 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -open Task -open VCS - -(* -------------------------------------------------------------------------- *) -(* --- Alt-Ergo Theorem Prover --- *) -(* -------------------------------------------------------------------------- *) - -val prove : mode -> Wpo.t -> result task diff --git a/src/plugins/wp/ProverErgo.ml b/src/plugins/wp/ProverErgo.ml deleted file mode 100644 index e78bb4bb0f79193b9f870cac7d9b4633963886ff..0000000000000000000000000000000000000000 --- a/src/plugins/wp/ProverErgo.ml +++ /dev/null @@ -1,513 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* -------------------------------------------------------------------------- *) -(* --- Prover Alt-Ergo Interface --- *) -(* -------------------------------------------------------------------------- *) - -open Cil_types -open Qed -open Lang -open Definitions - -let dkey = Wp_parameters.register_category "prover" -let dkey_cluster = Wp_parameters.register_category "cluster" - -let option_file = LogicBuiltins.create_option - (fun ~driver_dir x -> Filename.concat driver_dir x) - "altergo" "file" - -(* -------------------------------------------------------------------------- *) -(* --- Making Goal File --- *) -(* -------------------------------------------------------------------------- *) - -let altergo_gui = - lazy - begin - let name = Wp_parameters.AltGrErgo.get () in - let x = Command.command name [| "-version" |] in - match x with - | Unix.WEXITED 0 -> true - | Unix.WEXITED 127 -> Wp_parameters.error ~current:false "AltGr-Ergo command '%s' not found." name; false - | Unix.WEXITED r -> Wp_parameters.error ~current:false "AltGr-Ergo command '%s' exits with status [%d]" name r ; false - | _ -> Wp_parameters.error ~current:false "AltGr-Ergo command '%s' does not work." name; false - end - -let append_file out file = - let lines = ref 0 in - Command.read_lines file - begin fun line -> - output_string out line ; - output_string out "\n" ; - incr lines ; - end ; - !lines - -let rec locate_error files file line = - match files with - | [] -> ProverTask.location file line - | (f,n)::files -> - if line <= n then ProverTask.location f line - else locate_error files file (line-n) - -let cluster_file c = - let dir = WpContext.directory () in - let base = cluster_id c in - Format.sprintf "%s/%s.ergo" (dir :> string) base - -(* -------------------------------------------------------------------------- *) -(* --- Exporting Formulae to Alt-Ergo --- *) -(* -------------------------------------------------------------------------- *) - -type depend = - | D_file of string - | D_cluster of cluster - -[@@@warning "-32"] -let pp_depend fmt = function - | D_file file -> Format.fprintf fmt "File %s" file - | D_cluster cluster -> Format.fprintf fmt "Cluster %a" - Definitions.pp_cluster cluster -[@@@warning "+32"] - -module TYPES = WpContext.Index - (struct - type key = adt - type data = tau - let name = "ProverErgo.TYPES" - let compare = ADT.compare - let pretty = ADT.pretty - end) - -let engine = - let module E = Qed.Export_altergo.Make(Lang.F.QED) in - object(self) - inherit E.engine as super - inherit Lang.idprinting - - method infoprover p = p.altergo - method set_typedef = TYPES.define - method get_typedef = TYPES.get - - val mutable share = true - method! shareable e = share && super#shareable e - method! declare_axiom fmt a xs tgs phi = - try share <- false ; super#declare_axiom fmt a xs tgs phi ; share <- true - with err -> share <- true ; raise err - - val mutable goal = false - method set_goal g = goal <- g - - method private is_vlist polarity a b = - goal && self#mode = polarity && - (Vlist.check_term a || Vlist.check_term b) - - method! pp_equal fmt a b = - if self#is_vlist Qed.Engine.Mpositive a b - then Qed.Plib.pp_call_var "vlist_eq" self#pp_term fmt [a;b] - else super#pp_equal fmt a b - - method! pp_noteq fmt a b = - if self#is_vlist Qed.Engine.Mnegative a b - then - begin - Format.fprintf fmt "@[<hov 2>not@,(" ; - Qed.Plib.pp_call_var "vlist_eq" self#pp_term fmt [a;b] ; - Format.fprintf fmt ")@]" ; - end - else super#pp_noteq fmt a b - - method! pp_fun cmode fct ts = - if fct == Vlist.f_concat - then Vlist.export self ts - else super#pp_fun cmode fct ts - - end - -class visitor fmt c = - object(self) - - inherit Definitions.visitor c - inherit ProverTask.printer fmt (cluster_title c) - - val mutable deps = [] - - (* --- Managing Formatter --- *) - - method flush = - begin - Format.pp_print_newline fmt () ; - List.rev deps - end - - (* --- Files, Theories and Clusters --- *) - - method add_dfile f = - let df = D_file f in - if not (List.mem df deps) then deps <- df :: deps - - method add_shared f = self#add_dfile ((Wp_parameters.Share.get_file ~mode:`Must_exist f) :> string) - method add_library f = self#add_dfile f - - method on_cluster c = deps <- (D_cluster c) :: deps - - method on_library thy = - let iter file = self#add_library file in - List.iter iter - (LogicBuiltins.get_option option_file ~library:thy) - - method on_type lt def = - begin - self#lines ; - engine#declare_type fmt (Lang.adt lt) (List.length lt.lt_params) def ; - end - - method private gen_on_comp kind c fts = - begin - self#lines ; - let adt = match kind with - | KValue -> Lang.comp c - | KInit -> Lang.comp_init c - in - let t = match fts with - | None -> Qed.Engine.Tabs - | Some fts -> Qed.Engine.Trec fts - in - engine#declare_type fmt adt 0 t ; - end - - method on_comp = self#gen_on_comp KValue - method on_icomp = self#gen_on_comp KInit - - method on_dlemma l = - begin - self#paragraph ; - engine#declare_axiom fmt - (Lang.lemma_id l.l_name) - l.l_forall l.l_triggers - (F.e_prop l.l_lemma) - end - - method on_dfun d = - begin - self#paragraph ; - match d.d_definition with - | Logic t -> - engine#declare_signature fmt - d.d_lfun (List.map F.tau_of_var d.d_params) t ; - | Function(t,_,v) -> - engine#declare_definition fmt - d.d_lfun d.d_params t v - | Predicate(_,p) -> - engine#declare_definition fmt - d.d_lfun d.d_params Logic.Prop (F.e_prop p) - | Inductive ds -> - engine#declare_signature fmt - d.d_lfun (List.map F.tau_of_var d.d_params) Logic.Prop; - List.iter self#on_dlemma ds - end - - end - -let write_cluster c job = - let f = cluster_file c in - Wp_parameters.debug ~dkey "Generate '%s'" f ; - let output = Command.print_file f - begin fun fmt -> - let v = new visitor fmt c in - engine#set_goal false ; - job v ; - v#flush - end - in - if Wp_parameters.has_dkey dkey_cluster then - Log.print_on_output - begin fun fmt -> - Format.fprintf fmt "---------------------------------------------@\n" ; - Format.fprintf fmt "--- File '%s/%s.ergo' @\n" - (WpContext.get_context () |> WpContext.S.id) (cluster_id c) ; - Format.fprintf fmt "---------------------------------------------@\n" ; - Command.pp_from_file fmt f ; - end ; - output - -(* -------------------------------------------------------------------------- *) -(* --- File Assembly --- *) -(* -------------------------------------------------------------------------- *) - -module CLUSTERS = WpContext.Index - (struct - type key = cluster - type data = int * depend list - let name = "ProverErgo.CLUSTERS" - let compare = cluster_compare - let pretty = pp_cluster - end) - -type export = { - out : out_channel ; - mutable files : (string * int) list ; -} - -let rec assemble export = function - | D_file file -> assemble_file export file - | D_cluster c -> assemble_cluster export c - -and assemble_file export file = - if List.for_all (fun (f,_) -> f <> file) export.files - then - let lines = append_file export.out file in - export.files <- (file,lines) :: export.files - -and assemble_cluster export c = - let (age,deps) = try CLUSTERS.find c with Not_found -> (-1,[]) in - let deps = - if age < cluster_age c then - let deps = write_cluster c (fun v -> v#vself) in - CLUSTERS.update c (cluster_age c , deps) ; deps - else deps - in - List.iter (assemble export) deps ; - let file = cluster_file c in - assemble_file export file - -and assemble_lib export lib = - assemble_file export (LogicBuiltins.find_lib lib) - -(* -------------------------------------------------------------------------- *) -(* --- Assembling Goal --- *) -(* -------------------------------------------------------------------------- *) - -let assemble_goal ~file ~id ~title ~axioms prop = - let goal = cluster ~id ~title () in - let deps = write_cluster goal - begin fun v -> - v#on_library "qed"; - v#vgoal axioms prop ; - v#paragraph ; - try - let qlet = List.mem "qlet" (Wp_parameters.AltErgoFlags.get ()) in - engine#set_quantify_let qlet ; - engine#set_goal true ; - engine#global - begin fun () -> - v#printf "@[<hv 2>goal %s:@ %a@]@." id - engine#pp_goal (F.e_prop prop) ; - end ; - engine#set_quantify_let false ; - engine#set_goal false ; - with error -> - engine#set_quantify_let false ; - engine#set_goal false ; - raise error - end in - Command.write_file file - begin fun out -> - let export = { files = [] ; out = out } in - List.iter (assemble export) deps ; - let libs = Wp_parameters.AltErgoLibs.get () in - List.iter (assemble_lib export) libs ; - assemble_file export (cluster_file goal) ; - List.rev export.files - end - -(* -------------------------------------------------------------------------- *) -(* --- Running AltErgo --- *) -(* -------------------------------------------------------------------------- *) - -open ProverTask - -(*bug in Alt-Ergo: sometimes error messages are repeated. *) -(*let p_loc = "^File " ... *) - -let p_loc = "^File " ^ p_string ^ ", line " ^ p_int ^ ", [^:]+:" -let p_valid = p_loc ^ "Valid (" ^ p_float ^ ") (" ^ p_int ^ "\\( +steps\\)?)" -let p_unsat = p_loc ^ "I don't know" -let p_limit = "^Steps limit reached: " ^ p_int - -let re_error = Str.regexp p_loc -let re_valid = Str.regexp p_valid -let re_limit = Str.regexp p_limit -let re_unsat = Str.regexp p_unsat - -class altergo ~config ~pid ~gui ~file ~lines ~logout ~logerr = - object(ergo) - - inherit ProverTask.command (Wp_parameters.AltErgo.get ()) - - val mutable files = [] - val mutable error = None - val mutable valid = false - val mutable limit = false - val mutable unsat = false - val mutable timer = 0.0 - val mutable steps = 0 - - method private time t = timer <- t - - method private error (a : pattern) = - let lpos = locate_error files (a#get_string 1) (a#get_int 2) in - let message = a#get_after ~offset:1 2 in - error <- Some ( lpos , message ) - - method private valid (a : pattern) = - begin - valid <- true ; - timer <- a#get_float 3 ; - steps <- a#get_int 4 ; - end - - method private limit (a : pattern) = - begin - limit <- true ; - steps <- pred (a#get_int 1) ; - end - - method private unsat (_ : pattern) = - begin - unsat <- true ; - end - - method result r = - if r = 127 then - let cmd = Wp_parameters.AltErgo.get () in - VCS.kfailed "Command '%s' not found" cmd - else - match error with - | Some(pos,message) when unsat || limit || not valid -> - let source = Cil_datatype.Position.of_lexing_pos pos in - Wp_parameters.error ~source "Alt-Ergo error:@\n%s" message ; - VCS.failed ~pos message - | _ -> - try - let verdict = - if unsat then VCS.Unknown else - if valid then VCS.Valid else - if limit then VCS.Stepout else - raise Not_found in - VCS.result - ~time:(if gui then 0.0 else timer) - ~steps verdict - with Not_found -> - begin - let message std = - Format.asprintf - "Alt-Ergo (%s) for goal %a" - std WpPropId.pretty pid - in - if Wp_parameters.verbose_atleast 1 then begin - ProverTask.pp_file ~message:(message "stdout") ~file:logout ; - ProverTask.pp_file ~message:(message "stderr") ~file:logerr ; - end; - if r = 0 then VCS.failed "Unexpected Alt-Ergo output" - else VCS.kfailed "Alt-Ergo exits with status [%d]." r - end - - method prove = - files <- lines ; - if gui then ergo#set_command (Wp_parameters.AltGrErgo.get ()) ; - ergo#add_parameter ~name:"-proof" Wp_parameters.ProofTrace.get ; - ergo#add_parameter ~name:"-model" Wp_parameters.ProofTrace.get ; - let flags = List.filter - (fun p -> p <> "qlet") - (Wp_parameters.AltErgoFlags.get ()) in - ergo#add flags ; - ergo#add [ file ] ; - if not gui then begin - ergo#add_positive - ~name:"-steps-bound" ~value:(VCS.get_stepout config) ; - let smoke = WpPropId.is_smoke_test pid in - ergo#timeout (VCS.get_timeout ~smoke config) ; - end ; - ergo#validate_time ergo#time ; - ergo#validate_pattern ~logs:`ERR re_error ergo#error ; - ergo#validate_pattern ~logs:`OUT re_valid ergo#valid ; - ergo#validate_pattern ~logs:`OUT re_limit ergo#limit ; - ergo#validate_pattern ~logs:`OUT re_unsat ergo#unsat ; - ergo#run ~logout ~logerr () - - end - -open VCS -open Wpo -open Task - -let try_prove ~config ~pid ~gui ~file ~lines ~logout ~logerr = - let ergo = new altergo ~config ~pid ~gui ~file ~lines ~logout ~logerr in - ergo#prove >>> function - | Task.Timeout t -> Task.return (VCS.timeout t) - | Task.Result r -> Task.call ergo#result r - | st -> Task.status (Task.map (fun _ -> assert false) st) - -let prove_file ~config ~pid ~mode ~file ~lines ~logout ~logerr = - let gui = match mode with - | Edit -> Lazy.force altergo_gui - | Batch | Update | Fix | FixUpdate -> false in - try_prove ~config ~pid ~gui ~file ~lines ~logout ~logerr >>= function - | { verdict=(VCS.Unknown|VCS.Timeout|VCS.Stepout) } - when (mode = Fix || mode = FixUpdate) && Lazy.force altergo_gui -> - try_prove ~config ~pid ~gui:true ~file ~lines ~logout ~logerr - | r -> Task.return r - -let prove_prop ~config ~pid ~mode ~context ~axioms ~prop = - let prover = NativeAltErgo in - let model = fst context in - let file = DISK.file_goal ~pid ~model ~prover in - let logout = DISK.file_logout ~pid ~model ~prover in - let logerr = DISK.file_logerr ~pid ~model ~prover in - let id = WpPropId.get_propid pid in - let title = Pretty_utils.to_string WpPropId.pretty pid in - let lines = WpContext.on_context context - (assemble_goal ~file ~id ~title ~axioms) prop in - if Wp_parameters.has_print_generated () then - WpContext.on_context context (fun () -> - let goal = cluster ~id ~title () in - Wp_parameters.print_generated (cluster_file goal) - ) () ; - if Wp_parameters.Generate.get () - then Task.return VCS.no_result - else prove_file ~config ~pid ~mode ~file ~lines ~logout ~logerr - -let prove_annot context pid vcq ~config ~mode = - Task.todo - begin fun () -> - let axioms = vcq.VC_Annot.axioms in - let prop = GOAL.compute_proof ~pid vcq.VC_Annot.goal in - prove_prop ~pid ~config ~mode ~context ~axioms ~prop - end - -let prove_lemma context pid vca ~config ~mode = - Task.todo - begin fun () -> - let lemma = vca.Wpo.VC_Lemma.lemma in - let depends = vca.Wpo.VC_Lemma.depends in - let prop = F.p_forall lemma.l_forall lemma.l_lemma in - let axioms = Some(lemma.l_cluster,depends) in - prove_prop ~pid ~config ~mode ~context ~axioms ~prop - end - -let prove ~config ~mode wpo = - let pid = wpo.Wpo.po_pid in - let context = Wpo.get_context wpo in - match wpo.Wpo.po_formula with - | Wpo.GoalAnnot vcq -> prove_annot context pid vcq ~config ~mode - | Wpo.GoalLemma vca -> prove_lemma context pid vca ~config ~mode diff --git a/src/plugins/wp/ProverErgo.mli b/src/plugins/wp/ProverErgo.mli deleted file mode 100644 index 6355a6e1b81c47b26e11890a6737d478bf024a4e..0000000000000000000000000000000000000000 --- a/src/plugins/wp/ProverErgo.mli +++ /dev/null @@ -1,32 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -open Task -open VCS - -(* -------------------------------------------------------------------------- *) -(* --- Alt-Ergo Theorem Prover --- *) -(* -------------------------------------------------------------------------- *) - -val dkey_cluster: Wp_parameters.category - -val prove : config:config -> mode:mode -> Wpo.t -> result task diff --git a/src/plugins/wp/ProverScript.ml b/src/plugins/wp/ProverScript.ml index 46f3ae3cf8077927156ad9b07a006b05796503b4..9b4df821321a90605ab696180861dc73c5037a7d 100644 --- a/src/plugins/wp/ProverScript.ml +++ b/src/plugins/wp/ProverScript.ml @@ -36,11 +36,10 @@ struct let stage = function | Prover( Qed , { verdict = Valid } ) -> 0 - | Prover( (NativeAltErgo | Why3 _) , { verdict = Valid } ) -> 1 - | Prover( NativeCoq , { verdict = Valid } ) -> 2 - | Tactic _ -> 3 - | Prover _ -> 4 - | Error _ -> 5 + | Prover( Why3 _ , { verdict = Valid } ) -> 1 + | Tactic _ -> 2 + | Prover _ -> 3 + | Error _ -> 4 let time = function | Tactic _ | Error _ -> 0.0 diff --git a/src/plugins/wp/ProverTask.ml b/src/plugins/wp/ProverTask.ml index 1811bf0a2bb5d253b8cd144f23ca4b5a5cf0a5cf..cb0989a0c924cd1133d9837c78ebbb812dd920e7 100644 --- a/src/plugins/wp/ProverTask.ml +++ b/src/plugins/wp/ProverTask.ml @@ -302,7 +302,6 @@ let server ?procs () = let np = getprocs procs in let s = Task.server ~procs:np () in Why3Provers.set_procs np ; - Task.on_server_stop s Proof.savescripts ; server := Some s ; s (* -------------------------------------------------------------------------- *) diff --git a/src/plugins/wp/ProverWhy3.ml b/src/plugins/wp/ProverWhy3.ml index c0cb6f8e847682f6c7baaf38399a02ed2e4ae69b..e89b87890f82921162f173f4fec10d8bfd3b42c8 100644 --- a/src/plugins/wp/ProverWhy3.ml +++ b/src/plugins/wp/ProverWhy3.ml @@ -140,7 +140,7 @@ let lfun_name (lfun:Lang.lfun) = | ACSL f -> Qed.Engine.F_call (Lang.logic_id f) | CTOR c -> Qed.Engine.F_call (Lang.ctor_id c) | Model({m_source=Generated(_,n)}) -> Qed.Engine.F_call n - | Model({m_source=Extern e}) -> e.Lang.ext_link.Lang.why3 + | Model({m_source=Extern e}) -> e.Lang.ext_link let coerce ~cnv sort expected r = @@ -151,8 +151,8 @@ let coerce ~cnv sort expected r = | _ -> r let name_of_adt = function - | Lang.Mtype a -> a.Lang.ext_link.Lang.why3 - | Mrecord(a,_) -> a.Lang.ext_link.Lang.why3 + | Lang.Mtype a -> a.Lang.ext_link + | Mrecord(a,_) -> a.Lang.ext_link | Comp (c, KValue) -> Lang.comp_id c | Comp (c, KInit) -> Lang.comp_init_id c | Atype lt -> Lang.type_id lt @@ -520,8 +520,7 @@ let rec of_term ~cnv expected t : Why3.Term.term = in match lfun_name f, expected with | F_call s, _ -> apply_from_ns' s l sort - | Qed.Engine.F_subst _, _ -> - why3_failure "Driver link with subst not yet implemented" + | Qed.Engine.F_subst (s, _), _ -> apply_from_ns' s l sort | Qed.Engine.F_left s, _ | Qed.Engine.F_assoc s, _ -> let rec aux = function | [] -> why3_failure "Empty application" diff --git a/src/plugins/wp/VCS.ml b/src/plugins/wp/VCS.ml index 05aacf11a7cd7dffab4c1608e0368110c98ffa57..2faa6011629180a42c57748deef6e8074fd42600 100644 --- a/src/plugins/wp/VCS.ml +++ b/src/plugins/wp/VCS.ml @@ -28,8 +28,6 @@ let dkey_shell = Wp_parameters.register_category "shell" type prover = | Why3 of Why3Provers.t (* Prover via WHY *) - | NativeAltErgo (* Direct Alt-Ergo *) - | NativeCoq (* Direct Coq and Coqide *) | Qed (* Qed Solver *) | Tactical (* Interactive Prover *) @@ -43,18 +41,6 @@ type mode = let parse_prover = function | "" | "none" -> None | "qed" | "Qed" -> Some Qed - | "native-alt-ergo" (* for wp-reports *) - | "native:alt-ergo" | "native:altgr-ergo" - -> - Wp_parameters.warning ~once:true ~current:false - "native support for alt-ergo is deprecated, use why3 instead" ; - Some NativeAltErgo - | "native-coq" (* for wp-reports *) - | "native:coq" | "native:coqide" | "native:coqedit" - -> - Wp_parameters.warning ~once:true ~current:false - "native support for coq is deprecated, use tip instead" ; - Some NativeCoq | "script" -> Some Tactical | "tip" -> Some Tactical | "why3" -> Some (Why3 { Why3.Whyconf.prover_name = "why3"; @@ -90,8 +76,6 @@ let parse_mode m = let name_of_prover = function | Why3 s -> Why3Provers.print_wp s - | NativeAltErgo -> "native:alt-ergo" - | NativeCoq -> "native:coq" | Qed -> "qed" | Tactical -> "script" @@ -100,8 +84,6 @@ let title_of_prover = function if Wp_parameters.has_dkey dkey_shell then Why3Provers.name s else Why3Provers.title s - | NativeAltErgo -> "Alt-Ergo (native)" - | NativeCoq -> "Coq (native)" | Qed -> "Qed" | Tactical -> "Script" @@ -128,14 +110,12 @@ let sanitize_why3 s = let filename_for_prover = function | Why3 s -> sanitize_why3 (Why3Provers.print_wp s) - | NativeAltErgo -> "Alt-Ergo" - | NativeCoq -> "Coq" | Qed -> "Qed" | Tactical -> "Tactical" let is_auto = function - | Qed | NativeAltErgo -> true - | Tactical | NativeCoq -> false + | Qed -> true + | Tactical -> false | Why3 p -> match p.prover_name with | "Alt-Ergo" | "CVC4" | "Z3" -> true @@ -152,15 +132,9 @@ let cmp_prover p q = | Qed , Qed -> 0 | Qed , _ -> (-1) | _ , Qed -> 1 - | NativeAltErgo , NativeAltErgo -> 0 - | NativeAltErgo , _ -> (-1) - | _ , NativeAltErgo -> 1 | Tactical , Tactical -> 0 | Tactical , _ -> (-1) | _ , Tactical -> 1 - | NativeCoq , NativeCoq -> 0 - | NativeCoq , _ -> (-1) - | _ , NativeCoq -> 1 | Why3 p , Why3 q -> Why3Provers.compare p q let pp_prover fmt p = Format.pp_print_string fmt (title_of_prover p) @@ -344,7 +318,6 @@ let pp_result fmt r = let is_qualified prover result = match prover with | Qed | Tactical -> true - | NativeAltErgo | NativeCoq -> result.verdict <> Timeout | Why3 _ -> result.cached || result.prover_time < Rformat.epsilon let pp_cache_miss fmt st updating prover result = diff --git a/src/plugins/wp/VCS.mli b/src/plugins/wp/VCS.mli index f45575f2b6db70a52287db1638d9c8208e102bd8..7d81ce1743c382abc88859f5c3fc9b9f6e5363f9 100644 --- a/src/plugins/wp/VCS.mli +++ b/src/plugins/wp/VCS.mli @@ -28,8 +28,6 @@ type prover = | Why3 of Why3Provers.t (** Prover via WHY *) - | NativeAltErgo (** Direct Alt-Ergo *) - | NativeCoq (** Direct Coq and Coqide *) | Qed (** Qed Solver *) | Tactical (** Interactive Prover *) diff --git a/src/plugins/wp/Vlist.ml b/src/plugins/wp/Vlist.ml index a748662b125a457d52fe8821f12b718bf4427423..c46c6b226aef8d634e93f6df32fbecff73698184 100644 --- a/src/plugins/wp/Vlist.ml +++ b/src/plugins/wp/Vlist.ml @@ -38,18 +38,10 @@ let library = "vlist" (*--- Linked Symbols ---*) let t_list = "\\list" -let l_list = Lang.infoprover "list" -let l_concat = Lang.infoprover (E.F_right "concat") -let l_elt = Lang.(E.({ - altergo = F_subst "cons(%1,nil)" ; - why3 = F_call "elt" ; - coq = F_subst "(cons %1 nil)" ; - })) -let l_repeat = Lang.(E.({ - altergo = F_call "repeat_box" ; - why3 = F_call "repeat" ; - coq = F_call "repeat" ; - })) +let l_list = "list" +let l_concat = E.F_right "concat" +let l_elt = E.(F_call "elt") +let l_repeat = E.(F_call "repeat") (*--- Typechecking ---*) diff --git a/src/plugins/wp/configure.ac b/src/plugins/wp/configure.ac index bfda65f8de4803c7a6e21af047d8a7d5005437f2..2063cb8fbb8dbf0b5519c4a006c93723b740e094 100644 --- a/src/plugins/wp/configure.ac +++ b/src/plugins/wp/configure.ac @@ -35,13 +35,6 @@ m4_ifndef([FRAMAC_M4_MACROS], check_plugin(wp,PLUGIN_RELATIVE_PATH(plugin_file),[WP plug-in],yes,yes) -AC_ARG_ENABLE( - wp-coq, - [ --enable-wp-coq Wp precompiled Coq libraries (default: yes)], - WPCOQ=$enableval, - WPCOQ=yes -) - plugin_require(wp,qed) plugin_require(wp,rtegen) plugin_use(wp,gui) @@ -76,29 +69,4 @@ case $WHY3VERSION in esac fi -# Nb: this would deserve to use plugin_requires mechanism -if test "$ENABLE_WP" != "no"; then - - ## Configuring for WP-COQ - if test "$WPCOQ" = "yes" ; then - AC_CHECK_PROG(COQC,coqc,yes,no) - if test "$COQC" = "yes" ; then - COQVERSION=`coqc -v | sed -n -e 's|.*version* *\([[^ ]]*\) .*$|\1|p' ` - case $COQVERSION in - 8.13.*|trunk) - AC_MSG_RESULT(coqc version $COQVERSION found) - ;; - *) - AC_MSG_RESULT(unsupported coqc version $COQVERSION for - deprecated - native backend) - COQC="no" - ;; - esac - fi - else - COQC="no" - fi - AC_SUBST(COQC) - -fi - write_plugin_config(Makefile) diff --git a/src/plugins/wp/doc/manual/wp_builtins.tex b/src/plugins/wp/doc/manual/wp_builtins.tex index c5df277c89c59b1a6e60f9227438a53b73e72689..4454601c8d3cd38a8eb861d195ac1ba37a7ac09b 100644 --- a/src/plugins/wp/doc/manual/wp_builtins.tex +++ b/src/plugins/wp/doc/manual/wp_builtins.tex @@ -141,7 +141,7 @@ Moreover, the following lemmas are added to complement the reference ones: \vskip 1em \hrule \label{builtin-exp-log} -\paragraph{$\builtin{exp}(x)$, $\builtin{log}(x)$ and $\builtin{log10}(x)$} are declared +\paragraph{$\builtin{exp}(x)$, $\builtin{log}(x)$ and $\builtin{log10}(x)$} are declared to be injective, monotonically increasing and are associated with the following simplifiers: \[ \begin{array}{rcl@{\quad}l} @@ -188,14 +188,14 @@ imported from \textsf{Why-3}. \vskip 1em \hrule \label{builtin-trigo} -\paragraph{$\builtin{sin}(x)$, $\builtin{cos}(x)$ and $\builtin{tan}(x)$} trigonometric +\paragraph{$\builtin{sin}(x)$, $\builtin{cos}(x)$ and $\builtin{tan}(x)$} trigonometric operations. Useful lemmas are already defined in the reference implementation from \textsf{Why-3} library. \label{builtin-arctrigo} -\paragraph{$\builtin{asin}(x)$, $\builtin{acos}(x)$ and $\builtin{atan}(x)$} trigonometric +\paragraph{$\builtin{asin}(x)$, $\builtin{acos}(x)$ and $\builtin{atan}(x)$} trigonometric operations. Except definition of $\builtin{atan}$ which is available from reference, -definition for arc-$\builtin{sin}$ and arc-$\builtin{cos}$ have been added. Moreover, +definition for arc-$\builtin{sin}$ and arc-$\builtin{cos}$ have been added. Moreover, all the arc-trigonometric operations are declared to be injective. In addition, the following simplifiers are also registered: @@ -216,7 +216,7 @@ and are actually provided by custom extensions installed in the \textsf{WP} shar \vskip 1em \hrule \label{builtin-hyperbolic} -\paragraph{$\builtin{sinh}(x)$, $\builtin{cosh}(x)$ and $\builtin{tanh}(x)$} trigonometric +\paragraph{$\builtin{sinh}(x)$, $\builtin{cosh}(x)$ and $\builtin{tanh}(x)$} trigonometric operations. Useful lemmas are already defined in the reference implementation from \textsf{Why-3} library. @@ -256,21 +256,21 @@ Since all the builtin symbols of \textsf{ACSL} are actually linked to the standa of \textsf{Why-3}, any user theory also referring to the standard symbols can be added to the proof environment by using option \verb+-wp-why-lib 'file...'+. -Otherwise, a driver shall be written. For instance, the additional lemma regarding $\builtin{exp}$ -p.\pageref{builtin-hyperbolic} for \textsf{Alt-Ergo} is simply defined in the following way: +Otherwise, a driver can be written. For instance, the additional lemma regarding $\builtin{exp}$ +p.\pageref{builtin-hyperbolic} for \textsf{Why3} is simply defined in the following way: -\begin{logs} +\begin{logs} // MyExp.mlw file - axiom exp_pos : (forall x:real. (0.0 < exp(x))) + axiom exp_pos : forall x:real. (0.0 < exp(x)) \end{logs} -Of course, this piece of \textsf{Alt-Ergo} input file must be integrated after the symbol +Of course, this piece of \textsf{Why3} input file must be integrated after the symbol \verb+exp+ has been defined. The corresponding driver is then: \begin{logs} // MyExp.driver file library exponential: - ergo.file += "MyExp.mlw" ; + why3.file += "MyExp.mlw" ; \end{logs} Such a driver, once loaded with option \verb+-wp-driver+, instructs \textsf{Frama-C/WP} to @@ -278,5 +278,5 @@ append your extension file to the other necessary resources for library \verb+"e which the logic ACSL builtin \verb+\exp+ belongs to. The file \verb+share/wp/wp.driver+ located into the shared directory of \textsf{Frama-C}, -and the associated files in sub-directories \verb+share/wp/ergo+ and \verb+share/wp/why3+ shall provide +and the associated files in sub-directory \verb+share/wp/why3+ shall provide all the necessary hints for extending the capabilities of \textsf{Frama-C/WP} in a similar way. diff --git a/src/plugins/wp/driver.mll b/src/plugins/wp/driver.mll index 8404774fb29a0c3eadcef27083ae3aeb8aa4f09d..e3eb5ad68cb42ae08809d2ca9578697a138c5fa0 100644 --- a/src/plugins/wp/driver.mll +++ b/src/plugins/wp/driver.mll @@ -81,10 +81,7 @@ | `Default -> conv_bal default (name,default) | `Left -> Qed.Engine.F_left name | `Right -> Qed.Engine.F_right name - | `Nary -> - if Qed.Plib.is_template name - then Qed.Engine.F_subst name - else Qed.Engine.F_call name + | `Nary -> Qed.Engine.F_call name } @@ -285,30 +282,24 @@ and bal = parse match token input with | LINK f | ID f -> let link = conv_bal def (f,(bal input.lexbuf)) in - skip input; Lang.infoprover link + skip input; link | RECLINK l -> skip input ; - begin try - {Lang.altergo = conv_bal def (List.assoc "altergo" l); - why3 = conv_bal def (List.assoc "why3" l); - coq = conv_bal def (List.assoc "coq" l) } + begin try conv_bal def (List.assoc "why3" l); with Not_found -> - failwith "a link must contain an entry for 'altergo', 'why3' and 'coq'" + failwith "a link must contain an entry for 'why3'" end | _ -> failwith "Missing link symbol" let linkstring input = match recorstring input.lexbuf with | `String f -> - skip input ; Lang.infoprover f + skip input ; f | `RecString l -> skip input ; - begin try - {Lang.altergo = List.assoc "altergo" l; - why3 = List.assoc "why3" l; - coq = List.assoc "coq" l } + begin try List.assoc "why3" l with Not_found -> - failwith "a link must contain an entry for 'altergo', 'why3' and 'coq'" + failwith "a link must contain an entry for 'why3'" end | _ -> failwith "Missing link symbol" diff --git a/src/plugins/wp/proof.ml b/src/plugins/wp/proof.ml deleted file mode 100644 index f9d54288e6a9df846fbc65c55b020a8951065f07..0000000000000000000000000000000000000000 --- a/src/plugins/wp/proof.ml +++ /dev/null @@ -1,321 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* -------------------------------------------------------------------------- *) -(* --- Proof Script Database --- *) -(* -------------------------------------------------------------------------- *) - -let scriptbase : (string, string list * string * string) Hashtbl.t = Hashtbl.create 81 -(* [ goal name -> sorted hints , script , closing ] *) -let scriptfile = ref None (* current file script name *) -let needback = ref false (* file script need backup before modification *) -let needsave = ref false (* file script need to be saved *) -let needwarn = ref false (* user should be prompted for chosen scriptfile *) - -let sanitize hint = - try - let n = String.length hint in - if n <= 0 then raise Exit ; - for i = 0 to n - 1 do - match hint.[i] with - | 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' | '-' | '*' -> () - | _ -> raise Exit - done ; true - with Exit -> false - -let register_script goal hints proof closing = - let hints = List.sort String.compare (List.filter sanitize hints) in - Hashtbl.replace scriptbase goal (hints,proof,closing) - -let delete_script_for ~gid = - Hashtbl.remove scriptbase gid - -(* -------------------------------------------------------------------------- *) -(* --- Proof Scripts Parsers --- *) -(* -------------------------------------------------------------------------- *) - -open Script - -let is_empty_script script = - try - for i=0 to String.length script - 1 do - match script.[i] with '\n' | ' ' | '\t' -> () | _ -> raise Exit - done ; true - with Exit -> false - -let parse_coqproof file = - let input = Script.open_file file in - try - let rec fetch_proof input = - match token input with - | Proof(p,c) -> Some(p,c) - | Eof -> None - | _ -> skip input ; fetch_proof input - in - let proof = fetch_proof input in - Script.close input ; proof - with e -> - Script.close input ; - raise e - -let collect_scripts input = - while key input "Goal" do - let g = ident input in - eat input "." ; - let xs = - if key input "Hint" then - let xs = idents input in - eat input "." ; xs - else [] - in - let proof,qed = - match token input with - | Proof(p,c) -> skip input ; p,c - | _ -> error input "Missing proof" - in - register_script g xs proof qed - done ; - if token input <> Eof - then error input "Unexpected script declaration" - -let parse_scripts file = - if Sys.file_exists file then - begin - let input = Script.open_file file in - try - collect_scripts input ; - Script.close input ; - with e -> - Script.close input ; - raise e - end - -let dump_scripts file = - let out = open_out file in - let fmt = Format.formatter_of_out_channel out in - try - Format.fprintf fmt "(* Generated by Frama-C WP *)@\n@\n" ; - let goals = Hashtbl.fold (fun goal _ gs -> goal::gs) scriptbase [] in - List.iter - (fun goal -> - let (hints,proof,qed) = Hashtbl.find scriptbase goal in - Format.fprintf fmt "Goal %s.@\n" goal ; - (match hints with - | [] -> () - | k::ks -> - Format.fprintf fmt "Hint %s" k ; - List.iter (fun k -> Format.fprintf fmt ",%s" k) ks ; - Format.fprintf fmt ".@\n"); - Format.fprintf fmt "Proof.@\n%s%s@\n@." proof qed - ) (List.sort String.compare goals) ; - Format.pp_print_newline fmt () ; - close_out out ; - with e -> - Format.pp_print_newline fmt () ; - close_out out ; - raise e - -(* -------------------------------------------------------------------------- *) -(* --- Scripts Management --- *) -(* -------------------------------------------------------------------------- *) - -let rec choose k = - let file = Printf.sprintf "wp%d.script" k in - if Sys.file_exists file then choose (succ k) else file - -let savescripts () = - if !needsave then - match !scriptfile with - | None -> () - | Some file -> - if Wp_parameters.UpdateScript.get () then - try - if !needback then - ( Command.copy file (file ^ ".back") ; needback := false ) ; - if !needwarn then - ( needwarn := false ; - Wp_parameters.warning ~current:false - "No script file specified.@\n\ - Your proofs are saved in '%s'@\n\ - Use -wp-script '%s' to re-run them." - file file ; - ) ; - dump_scripts file ; - needsave := false ; - with e -> - Wp_parameters.abort - "Error when dumping script file '%s':@\n%s" file - (Printexc.to_string e) - else - Wp_parameters.warning ~once:true ~current:false - "Script base modified : modification will not be saved" - -let loadscripts () = - let user = Wp_parameters.Script.get () in - if !scriptfile <> Some user then - begin - savescripts () ; - begin - try parse_scripts user ; - with e -> - Wp_parameters.error - "Error in script file '%s':@\n%s" user - (Printexc.to_string e) - end ; - if Wp_parameters.UpdateScript.get () then - if user = "" then - (* update new file *) - begin - let ftmp = choose 0 in - Wp_parameters.Script.set ftmp ; - scriptfile := Some ftmp ; - needwarn := true ; - needback := false ; - end - else - (* update user's file *) - begin - scriptfile := Some user ; - needback := Sys.file_exists user ; - end - else - (* do not update *) - begin - scriptfile := Some user ; - needback := false ; - end - end - -let find_script_for_goal ~gid = - loadscripts () ; - try - let _,proof,qed = Hashtbl.find scriptbase gid in - Some(proof,qed) - with Not_found -> - None - -let update_hints_for_goal goal hints = - try - let old_hints,script,qed = Hashtbl.find scriptbase goal in - let new_hints = List.sort String.compare hints in - if Stdlib.compare new_hints old_hints <> 0 then - begin - Hashtbl.replace scriptbase goal (new_hints,script,qed) ; - needsave := true ; - end - with Not_found -> () - - -let rec matches n xs ys = - match xs , ys with - | x::rxs , y::rys -> - let c = String.compare x y in - if c < 0 then matches n rxs ys else - if c > 0 then matches n xs rys else - matches (succ n) rxs rys - | _ -> n - -let rec filter xs ys = - match xs , ys with - | [] , _ -> ys - | _::_ , [] -> raise Not_found - | x::rxs , y::rys -> - let c = String.compare x y in - if c < 0 then raise Not_found else - if c > 0 then y :: filter xs rys else - filter rxs rys - -let most_suitable (n,_,_,_) (n',_,_,_) = n'-n - -let find_script_with_hints required hints = - loadscripts () ; - let required = List.sort String.compare required in - let hints = List.sort String.compare hints in - List.sort most_suitable - begin - Hashtbl.fold - (fun g (xs,proof,qed) scripts -> - try - let n = matches 0 hints (filter required xs) in - (n,g,proof,qed)::scripts - with Not_found -> scripts) - scriptbase [] - end - -let add_script_for ~gid hints proof = - needsave := true ; register_script gid hints proof - -(* -------------------------------------------------------------------------- *) -(* --- Prover API --- *) -(* -------------------------------------------------------------------------- *) - -let script_for ~pid ~gid = - let found = find_script_for_goal ~gid in - ( if found <> None then - let required,hints = WpPropId.prop_id_keys pid in - let all = List.merge String.compare required hints in - update_hints_for_goal gid all ) ; - found - -let rec head n = function [] -> [] - | x::xs -> if n > 0 then x :: head (pred n) xs else [] - -let hints_for ~pid = - let default = match Wp_parameters.CoqTactic.get () with - | "none" -> [] - | tactic -> ["Default tactic",Printf.sprintf " %s.\n" tactic,"Qed."] - in - if Wp_parameters.TryHints.get () then - let nhints = Wp_parameters.Hints.get () in - if nhints > 0 then - let required,hints = WpPropId.prop_id_keys pid in - let scripts = find_script_with_hints required hints in - default @ List.map (fun (_,_,s,q) -> "Hint",s,q) (head nhints scripts) - else default - else default - -let script_for_ide ~pid ~gid = - match find_script_for_goal ~gid with - | Some script -> script - | None -> - let required,hints = WpPropId.prop_id_keys pid in - let hints = find_script_with_hints required hints in - let script = - if hints = [] then - begin - match Wp_parameters.CoqTactic.get () with - | "none" -> "" - | tactic -> Format.asprintf "(* %s. *)\n" tactic - end - else - begin - let nhints = Wp_parameters.Hints.get () in - Format.asprintf "%t" - (fun fmt -> - List.iter - (fun (_,g,script,_) -> - Format.fprintf fmt - "(*@ --------------------------------------\n \ - @ From '%s': \n%s*)\n%!" g script - ) (head nhints hints)) - end - in script , "Qed." diff --git a/src/plugins/wp/proof.mli b/src/plugins/wp/proof.mli deleted file mode 100644 index 8fb4c7f14a7e12645cfb358da664d216c1bf64b6..0000000000000000000000000000000000000000 --- a/src/plugins/wp/proof.mli +++ /dev/null @@ -1,48 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* -------------------------------------------------------------------------- *) -(** Coq Proof Scripts *) -(* -------------------------------------------------------------------------- *) - -open WpPropId - -val is_empty_script : string -> bool -(** Check a proof script text for emptyness *) - -val delete_script_for : gid:string -> unit -(** [delete_script ~gid] remove known script for goal. *) - -val add_script_for : gid:string -> string list -> string -> string -> unit -(** [new_script goal keys proof qed] registers the script [proof] - terminated by [qed] for goal [gid] and keywords [keys] *) - -val parse_coqproof : string -> (string * string) option -(** [parse_coqproof f] parses a coq-file [f] and fetch the first proof. *) - -val savescripts : unit -> unit -(** If necessary, dump the scripts database into the file - specified by [-wp-script f]. *) - -val script_for : pid:prop_id -> gid:string -> (string * string) option -val script_for_ide : pid:prop_id -> gid:string -> string * string -val hints_for : pid:prop_id -> (string * string * string) list diff --git a/src/plugins/wp/prover.ml b/src/plugins/wp/prover.ml index addb11faabbe595cce13c1d13f83e4d1e996314e..4483cf24c32f0571871134cd696ecbded8eb93cb 100644 --- a/src/plugins/wp/prover.ml +++ b/src/plugins/wp/prover.ml @@ -33,8 +33,6 @@ let dispatch ?(config=VCS.default) mode prover wpo = begin match prover with | Qed | Tactical -> Task.return VCS.no_result - | NativeAltErgo -> ProverErgo.prove ~config ~mode wpo - | NativeCoq -> ProverCoq.prove mode wpo | Why3 prover -> let smoke = Wpo.is_smoke_test wpo in ProverWhy3.prove diff --git a/src/plugins/wp/share/Makefile.coqwp b/src/plugins/wp/share/Makefile.coqwp deleted file mode 100644 index 9bdd3d154b0096059f1d5a09c6a4877def52982a..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/Makefile.coqwp +++ /dev/null @@ -1,87 +0,0 @@ -########################################################################## -# # -# This file is part of WP plug-in of Frama-C. # -# # -# Copyright (C) 2007-2021 # -# CEA (Commissariat a l'energie atomique et aux energies # -# alternatives) # -# # -# you can redistribute it and/or modify it under the terms of the GNU # -# Lesser General Public License as published by the Free Software # -# Foundation, version 2.1. # -# # -# It is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Lesser General Public License for more details. # -# # -# See the GNU Lesser General Public License version 2.1 # -# for more details (enclosed in the file licenses/LGPLv2.1). # -# # -########################################################################## - - -WPLSHARE=$(Wp_DIR)/share - -# -------------------------------------------------------------------------- -# --- Coq Compilation -# -------------------------------------------------------------------------- - -.PHONY: coqwpcompile - -COQWPINCLUDES= -R $(WPLSHARE)/coqwp '' -COQWPBINARIES= $(addprefix $(WPLSHARE)/, $(ALL_COQ_BINARIES)) - -coqwpcompile: $(COQWPBINARIES) - -$(WPLSHARE)/coqwp/%.vo: $(WPLSHARE)/coqwp/%.v - echo "Coqc $<" - coqc -w none $(COQWPINCLUDES) $< - -$(WPLSHARE)/coqwp/%.ide: $(WPLSHARE)/coqwp/%.v - echo "Coqide $<" - coqide $(COQWPINCLUDES) $< - -$(WPLSHARE)/coqwp/.depend: $(addprefix $(WPLSHARE)/, $(WP_COQ_SOURCES)) - echo "Coqdep $(WPLSHARE)/coqwp" - @coqdep $(COQWPINCLUDES) $(WPLSHARE)/coqwp/*.v $(WPLSHARE)/coqwp/**/*.v > $@ - -# -------------------------------------------------------------------------- -# --- Additional Targets -# -------------------------------------------------------------------------- - -.PHONY: wp-coq-compile wp-coq-clean wp-coq-install wp-coq-uninstall - -wp-coq-compile: coqwpcompile - @echo "Run 'make wp-coq-install' to install all precompiled libraries" - -wp-coq-clean: - find $(Wp_DIR) \( -name "*.vo" -or -name "*.glob" -or -name ".*.aux" \) -delete - rm -f $(WPLSHARE)/coqwp/.depend - -wp-coq-install: - $(PRINT_INSTALL) "Coq Libraries" - $(INSTALL_SHARE) -f -p -s \ - -i $(Wp_DIR)/share \ - -d $(FRAMAC_DATADIR)/wp \ - $(ALL_COQ_BINARIES) - -wp-coq-uninstall: - $(PRINT_RM) "Coq Libraries" - @rm -f $(FRAMAC_DATADIR)/wp/why3/*.vo - @rm -f $(FRAMAC_DATADIR)/wp/coqwp/*.vo - @rm -f $(FRAMAC_DATADIR)/wp/coqwp/*/*.vo - -# -------------------------------------------------------------------------- -# --- Coq Dependencies -# -------------------------------------------------------------------------- - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) -ifneq ($(MAKECMDGOALS),smartclean) -sinclude $(WPLSHARE)/coqwp/.depend -endif -endif -endif - -# -------------------------------------------------------------------------- diff --git a/src/plugins/wp/share/Makefile.resources b/src/plugins/wp/share/Makefile.resources index 4fea780bb2adefba6f7d67c28ebf9904ab6f2adb..f28c1d26ae72c9c86b50ff23477f1a55a46bbc51 100644 --- a/src/plugins/wp/share/Makefile.resources +++ b/src/plugins/wp/share/Makefile.resources @@ -39,93 +39,6 @@ WHY3_LIBS_CEA:= \ ## Used in share/why3 WHY3_API_LIBS_CEA:= WHY3_LIBS_CEA -# -------------------------------------------------------------------------- -# --- Coq Libraries -# -------------------------------------------------------------------------- - -## Used in share/coqwp - -COQ_LIBS_CEA:= \ - ArcTrigo.v \ - Bits.v \ - Cbits.v \ - Cfloat.v \ - Cint.v \ - Cmath.v \ - Square.v \ - ExpLog.v \ - Memory.v \ - Qed.v \ - Qedlib.v \ - Vset.v \ - Vlist.v \ - Zbits.v - -COQ_LIBS_INRIA:=\ - BuiltIn.v \ - HighOrd.v \ - bool/Bool.v \ - int/Abs.v \ - int/ComputerDivision.v \ - int/EuclideanDivision.v \ - int/ComputerOfEuclideanDivision.v \ - int/Exponentiation.v \ - int/Int.v \ - int/MinMax.v \ - int/Power.v \ - map/Map.v \ - map/Const.v \ - real/Abs.v \ - real/FromInt.v \ - real/MinMax.v \ - real/Real.v \ - real/RealInfix.v \ - real/Square.v \ - real/ExpLog.v \ - real/PowerReal.v \ - real/Trigonometry.v - -# -------------------------------------------------------------------------- -# --- Alt-Ergo Libraries -# -------------------------------------------------------------------------- - -# Used in share/ergo - -ERGO_LIBS_CEA:= \ - ArcTrigo.mlw \ - Cbits.mlw \ - Cfloat.mlw \ - Cint.mlw \ - Cmath.mlw \ - Square.mlw \ - ExpLog.mlw \ - Memory.mlw \ - Qed.mlw \ - Vset.mlw \ - Vlist.mlw - -ERGO_LIBS_INRIA:= \ - bool.Bool.mlw \ - int.Abs.mlw \ - int.ComputerDivision.mlw \ - int.ComputerOfEuclideanDivision.mlw \ - int.Int.mlw \ - int.MinMax.mlw \ - map.Map.mlw \ - map.Const.mlw \ - real.Abs.mlw \ - real.FromInt.mlw \ - real.MinMax.mlw \ - real.Real.mlw \ - real.RealInfix.mlw \ - real.Square.mlw \ - real.Truncate.mlw \ - real.ExpLog.mlw \ - real.PowerReal.mlw \ - real.Trigonometry.mlw \ - real.Hyperbolic.mlw \ - real.Polar.mlw - # -------------------------------------------------------------------------- # --- LICENSES # -------------------------------------------------------------------------- @@ -135,23 +48,13 @@ ERGO_LIBS_INRIA:= \ WP_SHARE_SRC_CEA_RESOURCES:= \ wp.driver \ why3/coq.drv \ - $(addprefix why3/frama_c_wp/, $(WHY3_LIBS_CEA)) \ - $(addprefix coqwp/, $(COQ_LIBS_CEA)) \ - $(addprefix ergo/, $(ERGO_LIBS_CEA)) + $(addprefix why3/frama_c_wp/, $(WHY3_LIBS_CEA)) ALL_CEA_RESOURCES+= \ install.ml \ Makefile.resources \ - Makefile.coqwp \ $(WP_SHARE_SRC_CEA_RESOURCES) -ALL_UNMODIFIED_WHY3_RESOURCES:= \ - $(addprefix coqwp/, $(COQ_LIBS_INRIA)) - -ALL_MODIFIED_WHY3_RESOURCES:= \ - $(addprefix ergo/, $(ERGO_LIBS_INRIA)) - - ########################################################################## # Local Variables: # mode: makefile diff --git a/src/plugins/wp/share/ergo/ArcTrigo.mlw b/src/plugins/wp/share/ergo/ArcTrigo.mlw deleted file mode 100644 index e2640273c38a6fffe8579129b98475364cb6a35a..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/ArcTrigo.mlw +++ /dev/null @@ -1,40 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_RealInfix_ must be appended to this file*) -(** The theory real_Abs_ must be appended to this file*) -(** The theory real_Square_ must be appended to this file*) -(** The theory real_Trigonometry_ must be appended to this file*) -logic asin : real -> real - -logic acos : real -> real - -axiom Sin_asin : - (forall x:real. ((((-1.0) <= x) and (x <= 1.0)) -> (sin(asin(x)) = x))) - -axiom Cos_acos : - (forall x:real. ((((-1.0) <= x) and (x <= 1.0)) -> (cos(acos(x)) = x))) - diff --git a/src/plugins/wp/share/ergo/Cbits.mlw b/src/plugins/wp/share/ergo/Cbits.mlw deleted file mode 100644 index fc3e1ca738f67ed6005195dded8d1ced08f70a4f..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Cbits.mlw +++ /dev/null @@ -1,553 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory Qed_ must be appended to this file*) -(** The theory bool_Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory int_Abs_ must be appended to this file*) -(** The theory int_ComputerDivision_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_RealInfix_ must be appended to this file*) -(** The theory real_FromInt_ must be appended to this file*) -(** The theory Cint_ must be appended to this file*) - -logic bit_testb : int, int -> bool - -logic bit_test : int, int -> prop - -logic lnot : int -> int - -logic ac land : int, int -> int - -logic ac lxor : int, int -> int - -logic ac lor : int, int -> int - -logic lsl : int, int -> int - -logic lsr : int, int -> int - -axiom lnot_bool : (lnot(0) = (-1)) - -axiom lnot_bool1 : (lnot((-1)) = 0) - -axiom land_idemp : (forall x:int [land(x, x)]. (land(x, x) = x)) - -axiom land_0 : (forall x:int [land(0, x)]. (land(0, x) = 0)) - -axiom land_0bis : (forall x:int [land(x, 0)]. (land(x, 0) = 0)) - -axiom land_1 : (forall x:int [land((-1), x)]. (land((-1), x) = x)) - -axiom land_1bis : (forall x:int [land(x, (-1))]. (land(x, (-1)) = x)) - -axiom lor_idemp : (forall x:int [lor(x, x)]. (lor(x, x) = x)) - -axiom lor_1 : (forall x:int [lor((-1), x)]. (lor((-1), x) = (-1))) - -axiom lor_1bis : (forall x:int [lor(x, (-1))]. (lor(x, (-1)) = (-1))) - -axiom lor_0 : (forall x:int [lor(0, x)]. (lor(0, x) = x)) - -axiom lor_0bis : (forall x:int [lor(x, 0)]. (lor(x, 0) = x)) - -axiom lxor_nilpotent : (forall x:int [lxor(x, x)]. (lxor(x, x) = 0)) - -axiom lxor_1 : (forall x:int [lxor((-1), x)]. (lxor((-1), x) = lnot(x))) - -axiom lxor_1bis : (forall x:int [lxor(x, (-1))]. (lxor(x, (-1)) = lnot(x))) - -axiom lxor_0 : (forall x:int [lxor(0, x)]. (lxor(0, x) = x)) - -axiom lxor_0bis : (forall x:int [lxor(x, 0)]. (lxor(x, 0) = x)) - -axiom lsl_0 : (forall x:int. (lsl(x, 0) = x)) - -axiom lsl_1 : (forall x:int. (lsl(x, 1) = (2 * x))) - -axiom lsl_add : - (forall x:int. forall p:int. forall q:int. ((0 <= p) -> ((0 <= q) -> - (lsl(lsl(x, p), q) = lsl(x, (p + q)))))) - -axiom lsr_0 : (forall x:int. (lsr(x, 0) = x)) - -axiom lsr_1 : (forall x:int. ((0 <= x) -> (lsr(x, 1) = div(x,2)))) - -axiom lsr_add : - (forall x:int. forall p:int. forall q:int. ((0 <= p) -> ((0 <= q) -> - (lsr(lsr(x, p), q) = lsr(x, (p + q)))))) - -axiom lsl_lsr_add : - (forall x:int. forall p:int. forall q:int. (((0 <= q) and (q <= p)) -> - (lsr(lsl(x, p), q) = lsl(x, (p - q))))) - -axiom bit_test_def : - (forall x:int. forall k:int [bit_testb(x, k)]. ((bit_testb(x, k) = true) -> - bit_test(x, k))) - -axiom bit_test_def1 : - (forall x:int. forall k:int [bit_testb(x, k)]. (bit_test(x, k) -> - (bit_testb(x, k) = true))) - -axiom bit_test_extraction : - (forall x:int. forall k:int [land(x, lsl(1, k))| land(lsl(1, k), x)]. - ((0 <= k) -> ((not (land(x, lsl(1, k)) = 0)) -> bit_test(x, k)))) - -axiom bit_test_extraction1 : - (forall x:int. forall k:int [land(x, lsl(1, k))| land(lsl(1, k), x)]. - ((0 <= k) -> (bit_test(x, k) -> (not (land(x, lsl(1, k)) = 0))))) - -axiom lsl_1_0 : (lsl(1, 0) = 1) - -axiom bit_test_extraction_bis : - (forall x:int [land(x, 1)| land(1, x)]. ((not (land(1, x) = 0)) -> - bit_test(x, 0))) - -axiom bit_test_extraction_bis_eq : - (forall x:int [land(x, 1)| land(1, x)]. (bit_test(x, 0) -> (land(1, - x) = 1))) - -axiom lnot_extraction : - (forall x:int. forall i:int [bit_test(lnot(x), i)]. ((0 <= i) -> - (bit_test(lnot(x), i) -> (not bit_test(x, i))))) - -axiom lnot_extraction1 : - (forall x:int. forall i:int [bit_test(lnot(x), i)]. ((0 <= i) -> - ((not bit_test(x, i)) -> bit_test(lnot(x), i)))) - -axiom land_extraction : - (forall x:int. forall y:int. forall i:int [bit_test(land(x, y), i)]. - ((0 <= i) -> (bit_test(land(x, y), i) -> bit_test(x, i)))) - -axiom land_extraction1 : - (forall x:int. forall y:int. forall i:int [bit_test(land(x, y), i)]. - ((0 <= i) -> (bit_test(land(x, y), i) -> bit_test(y, i)))) - -axiom land_extraction2 : - (forall x:int. forall y:int. forall i:int [bit_test(land(x, y), i)]. - ((0 <= i) -> ((bit_test(x, i) and bit_test(y, i)) -> bit_test(land(x, y), - i)))) - -axiom lor_extraction : - (forall x:int. forall y:int. forall i:int [bit_test(lor(x, y), i)]. - ((0 <= i) -> (bit_test(lor(x, y), i) -> (bit_test(x, i) or bit_test(y, - i))))) - -axiom lor_extraction1 : - (forall x:int. forall y:int. forall i:int [bit_test(lor(x, y), i)]. - ((0 <= i) -> ((bit_test(x, i) or bit_test(y, i)) -> bit_test(lor(x, y), - i)))) - -axiom lxor_extraction : - (forall x:int. forall y:int. forall i:int [bit_test(lxor(x, y), i)]. - ((0 <= i) -> (bit_test(lxor(x, y), i) -> (bit_test(x, i) -> - (not bit_test(y, i)))))) - -axiom lxor_extraction1 : - (forall x:int. forall y:int. forall i:int [bit_test(lxor(x, y), i)]. - ((0 <= i) -> (bit_test(lxor(x, y), i) -> ((not bit_test(y, i)) -> - bit_test(x, i))))) - -axiom lxor_extraction2 : - (forall x:int. forall y:int. forall i:int [bit_test(lxor(x, y), i)]. - ((0 <= i) -> ((bit_test(x, i) <-> (not bit_test(y, i))) -> bit_test(lxor(x, - y), i)))) - -axiom land_1_lsl_1 : - (forall a:int. forall x:int. forall n:int [lsl(1, (1 + n)), lsl(1, n), - ((2 * a) + land(1, x))]. ((0 <= n) -> ((a < lsl(1, n)) -> - (((2 * a) + land(1, x)) < lsl(1, (1 + n)))))) - -axiom lsl_extraction_sup : - (forall x:int. forall n:int. forall m:int [bit_test(lsl(x, n), m)]. - ((0 <= n) -> ((0 <= m) -> ((n <= m) -> (bit_test(lsl(x, n), m) -> - bit_test(x, (m - n))))))) - -axiom lsl_extraction_sup1 : - (forall x:int. forall n:int. forall m:int [bit_test(lsl(x, n), m)]. - ((0 <= n) -> ((0 <= m) -> ((n <= m) -> (bit_test(x, (m - n)) -> - bit_test(lsl(x, n), m)))))) - -axiom lsl_extraction_inf : - (forall x:int. forall n:int. forall m:int [bit_test(lsl(x, n), m)]. - ((0 <= n) -> ((0 <= m) -> ((m < n) -> (not bit_test(lsl(x, n), m)))))) - -axiom lsr_extractionl : - (forall x:int. forall n:int. forall m:int [bit_test(lsr(x, n), m)]. - ((0 <= n) -> ((0 <= m) -> (bit_test(lsr(x, n), m) -> bit_test(x, - (m + n)))))) - -axiom lsr_extractionl1 : - (forall x:int. forall n:int. forall m:int [bit_test(lsr(x, n), m)]. - ((0 <= n) -> ((0 <= m) -> (bit_test(x, (m + n)) -> bit_test(lsr(x, n), - m))))) - -axiom lsl1_extraction : - (forall i:int. forall j:int [bit_test(lsl(1, i), j)]. ((0 <= i) -> - ((0 <= j) -> (bit_test(lsl(1, i), j) -> (i = j))))) - -axiom lsl1_extraction1 : - (forall i:int. forall j:int [bit_test(lsl(1, i), j)]. ((0 <= i) -> - ((0 <= j) -> ((i = j) -> bit_test(lsl(1, i), j))))) - -axiom to_uint8_extraction_sup : - (forall x:int. forall i:int [is_uint8(x), bit_test(x, i)]. ((8 <= i) -> - (is_uint8(x) -> (not bit_test(x, i))))) - -axiom to_uint8_extraction_inf : - (forall x:int. forall i:int [bit_test(to_uint8(x), i)]. (((0 <= i) and - (i < 8)) -> (bit_test(to_uint8(x), i) -> bit_test(x, i)))) - -axiom to_uint8_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_uint8(x), i)]. (((0 <= i) and - (i < 8)) -> (bit_test(x, i) -> bit_test(to_uint8(x), i)))) - -axiom to_uint16_extraction_sup : - (forall x:int. forall i:int [is_uint16(x), bit_test(x, i)]. ((16 <= i) -> - (is_uint16(x) -> (not bit_test(x, i))))) - -axiom to_uint16_extraction_inf : - (forall x:int. forall i:int [bit_test(to_uint16(x), i)]. (((0 <= i) and - (i < 16)) -> (bit_test(to_uint16(x), i) -> bit_test(x, i)))) - -axiom to_uint16_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_uint16(x), i)]. (((0 <= i) and - (i < 16)) -> (bit_test(x, i) -> bit_test(to_uint16(x), i)))) - -axiom to_uint32_extraction_sup : - (forall x:int. forall i:int [is_uint32(x), bit_test(x, i)]. ((32 <= i) -> - (is_uint32(x) -> (not bit_test(x, i))))) - -axiom to_uint32_extraction_inf : - (forall x:int. forall i:int [bit_test(to_uint32(x), i)]. (((0 <= i) and - (i < 32)) -> (bit_test(to_uint32(x), i) -> bit_test(x, i)))) - -axiom to_uint32_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_uint32(x), i)]. (((0 <= i) and - (i < 32)) -> (bit_test(x, i) -> bit_test(to_uint32(x), i)))) - -axiom to_uint64_extraction_sup : - (forall x:int. forall i:int [is_uint64(x), bit_test(x, i)]. ((64 <= i) -> - (is_uint64(x) -> (not bit_test(x, i))))) - -axiom to_uint64_extraction_inf : - (forall x:int. forall i:int [bit_test(to_uint64(x), i)]. (((0 <= i) and - (i < 64)) -> (bit_test(to_uint64(x), i) -> bit_test(x, i)))) - -axiom to_uint64_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_uint64(x), i)]. (((0 <= i) and - (i < 64)) -> (bit_test(x, i) -> bit_test(to_uint64(x), i)))) - -axiom to_sint8_extraction_sup : - (forall x:int. forall i:int [is_sint8(x), bit_test(x, i)]. ((7 <= i) -> - (is_sint8(x) -> (bit_test(x, i) -> (x < 0))))) - -axiom to_sint8_extraction_sup1 : - (forall x:int. forall i:int [is_sint8(x), bit_test(x, i)]. ((7 <= i) -> - (is_sint8(x) -> ((x < 0) -> bit_test(x, i))))) - -axiom to_sint8_extraction_inf : - (forall x:int. forall i:int [bit_test(to_sint8(x), i)]. (((0 <= i) and - (i < 7)) -> (bit_test(to_sint8(x), i) -> bit_test(x, i)))) - -axiom to_sint8_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_sint8(x), i)]. (((0 <= i) and - (i < 7)) -> (bit_test(x, i) -> bit_test(to_sint8(x), i)))) - -axiom to_sint16_extraction_sup : - (forall x:int. forall i:int [is_sint16(x), bit_test(x, i)]. ((15 <= i) -> - (is_sint16(x) -> (bit_test(x, i) -> (x < 0))))) - -axiom to_sint16_extraction_sup1 : - (forall x:int. forall i:int [is_sint16(x), bit_test(x, i)]. ((15 <= i) -> - (is_sint16(x) -> ((x < 0) -> bit_test(x, i))))) - -axiom to_sint16_extraction_inf : - (forall x:int. forall i:int [bit_test(to_sint16(x), i)]. (((0 <= i) and - (i < 15)) -> (bit_test(to_sint16(x), i) -> bit_test(x, i)))) - -axiom to_sint16_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_sint16(x), i)]. (((0 <= i) and - (i < 15)) -> (bit_test(x, i) -> bit_test(to_sint16(x), i)))) - -axiom to_sint32_extraction_sup : - (forall x:int. forall i:int [is_sint32(x), bit_test(x, i)]. ((31 <= i) -> - (is_sint32(x) -> (bit_test(x, i) -> (x < 0))))) - -axiom to_sint32_extraction_sup1 : - (forall x:int. forall i:int [is_sint32(x), bit_test(x, i)]. ((31 <= i) -> - (is_sint32(x) -> ((x < 0) -> bit_test(x, i))))) - -axiom to_sint32_extraction_inf : - (forall x:int. forall i:int [bit_test(to_sint32(x), i)]. (((0 <= i) and - (i < 31)) -> (bit_test(to_sint32(x), i) -> bit_test(x, i)))) - -axiom to_sint32_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_sint32(x), i)]. (((0 <= i) and - (i < 31)) -> (bit_test(x, i) -> bit_test(to_sint32(x), i)))) - -axiom to_sint64_extraction_sup : - (forall x:int. forall i:int [is_sint64(x), bit_test(x, i)]. ((63 <= i) -> - (is_sint64(x) -> (bit_test(x, i) -> (x < 0))))) - -axiom to_sint64_extraction_sup1 : - (forall x:int. forall i:int [is_sint64(x), bit_test(x, i)]. ((63 <= i) -> - (is_sint64(x) -> ((x < 0) -> bit_test(x, i))))) - -axiom to_sint64_extraction_inf : - (forall x:int. forall i:int [bit_test(to_sint64(x), i)]. (((0 <= i) and - (i < 63)) -> (bit_test(to_sint64(x), i) -> bit_test(x, i)))) - -axiom to_sint64_extraction_inf1 : - (forall x:int. forall i:int [bit_test(to_sint64(x), i)]. (((0 <= i) and - (i < 63)) -> (bit_test(x, i) -> bit_test(to_sint64(x), i)))) - -axiom is_uint_lxor : - (forall n:int. forall x:int. forall y:int. (is_uint(n, x) -> (is_uint(n, - y) -> (to_uint(n, lxor(x, y)) = lxor(x, y))))) - -axiom is_uint8_lxor : - (forall x:int. forall y:int [to_uint8(lxor(x, y))]. (is_uint8(x) -> - (is_uint8(y) -> (to_uint8(lxor(x, y)) = lxor(x, y))))) - -axiom is_uint8_lor : - (forall x:int. forall y:int [to_uint8(lor(x, y))]. (is_uint8(x) -> - (is_uint8(y) -> (to_uint8(lor(x, y)) = lor(x, y))))) - -axiom is_uint8_land : - (forall x:int. forall y:int [to_uint8(land(x, y))]. (is_uint8(x) -> - (is_uint8(y) -> (to_uint8(land(x, y)) = land(x, y))))) - -axiom is_uint8_lsr : - (forall x:int. forall y:int [to_uint8(lsr(x, y))]. ((0 <= y) -> - (is_uint8(x) -> (to_uint8(lsr(x, y)) = lsr(x, y))))) - -axiom is_uint8_lsl1_inf : - (forall y:int [to_uint8(lsl(1, y))]. (((0 <= y) and (y < 8)) -> - (to_uint8(lsl(1, y)) = lsl(1, y)))) - -axiom is_uint8_lsl1_sup : - (forall y:int [to_uint8(lsl(1, y))]. ((8 <= y) -> (to_uint8(lsl(1, - y)) = 0))) - -axiom is_uint16_lxor : - (forall x:int. forall y:int [to_uint16(lxor(x, y))]. (is_uint16(x) -> - (is_uint16(y) -> (to_uint16(lxor(x, y)) = lxor(x, y))))) - -axiom is_uint16_lor : - (forall x:int. forall y:int [to_uint16(lor(x, y))]. (is_uint16(x) -> - (is_uint16(y) -> (to_uint16(lor(x, y)) = lor(x, y))))) - -axiom is_uint16_land : - (forall x:int. forall y:int [to_uint16(land(x, y))]. (is_uint16(x) -> - (is_uint16(y) -> (to_uint16(land(x, y)) = land(x, y))))) - -axiom is_uint16_lsr : - (forall x:int. forall y:int [to_uint16(lsr(x, y))]. ((0 <= y) -> - (is_uint16(x) -> (to_uint16(lsr(x, y)) = lsr(x, y))))) - -axiom is_uint16_lsl1_inf : - (forall y:int [to_uint16(lsl(1, y))]. (((0 <= y) and (y < 16)) -> - (to_uint16(lsl(1, y)) = lsl(1, y)))) - -axiom is_uint16_lsl1_sup : - (forall y:int [to_uint16(lsl(1, y))]. ((16 <= y) -> (to_uint16(lsl(1, - y)) = 0))) - -axiom is_uint32_lxor : - (forall x:int. forall y:int [to_uint32(lxor(x, y))]. (is_uint32(x) -> - (is_uint32(y) -> (to_uint32(lxor(x, y)) = lxor(x, y))))) - -axiom is_uint32_lor : - (forall x:int. forall y:int [to_uint32(lor(x, y))]. (is_uint32(x) -> - (is_uint32(y) -> (to_uint32(lor(x, y)) = lor(x, y))))) - -axiom is_uint32_land : - (forall x:int. forall y:int [to_uint32(land(x, y))]. (is_uint32(x) -> - (is_uint32(y) -> (to_uint32(land(x, y)) = land(x, y))))) - -axiom is_uint32_lsr : - (forall x:int. forall y:int [to_uint32(lsr(x, y))]. ((0 <= y) -> - (is_uint32(x) -> (to_uint32(lsr(x, y)) = lsr(x, y))))) - -axiom is_uint32_lsl1_inf : - (forall y:int [to_uint32(lsl(1, y))]. (((0 <= y) and (y < 32)) -> - (to_uint32(lsl(1, y)) = lsl(1, y)))) - -axiom is_uint32_lsl1_sup : - (forall y:int [to_uint32(lsl(1, y))]. ((32 <= y) -> (to_uint32(lsl(1, - y)) = 0))) - -axiom is_uint64_lxor : - (forall x:int. forall y:int [to_uint64(lxor(x, y))]. (is_uint64(x) -> - (is_uint64(y) -> (to_uint64(lxor(x, y)) = lxor(x, y))))) - -axiom is_uint64_lor : - (forall x:int. forall y:int [to_uint64(lor(x, y))]. (is_uint64(x) -> - (is_uint64(y) -> (to_uint64(lor(x, y)) = lor(x, y))))) - -axiom is_uint64_land : - (forall x:int. forall y:int [to_uint64(land(x, y))]. (is_uint64(x) -> - (is_uint64(y) -> (to_uint64(land(x, y)) = land(x, y))))) - -axiom is_uint64_lsr : - (forall x:int. forall y:int [to_uint64(lsr(x, y))]. ((0 <= y) -> - (is_uint64(x) -> (to_uint64(lsr(x, y)) = lsr(x, y))))) - -axiom is_uint64_lsl1_inf : - (forall y:int [to_uint64(lsl(1, y))]. (((0 <= y) and (y < 64)) -> - (to_uint64(lsl(1, y)) = lsl(1, y)))) - -axiom is_uint64_lsl1_sup : - (forall y:int [to_uint64(lsl(1, y))]. ((64 <= y) -> (to_uint64(lsl(1, - y)) = 0))) - -axiom is_sint8_lnot : - (forall x:int [to_sint8(lnot(x))]. (is_sint8(x) -> - (to_sint8(lnot(x)) = lnot(x)))) - -axiom is_sint8_lxor : - (forall x:int. forall y:int [to_sint8(lxor(x, y))]. (is_sint8(x) -> - (is_sint8(y) -> (to_sint8(lxor(x, y)) = lxor(x, y))))) - -axiom is_sint8_lor : - (forall x:int. forall y:int [to_sint8(lor(x, y))]. (is_sint8(x) -> - (is_sint8(y) -> (to_sint8(lor(x, y)) = lor(x, y))))) - -axiom is_sint8_land : - (forall x:int. forall y:int [to_sint8(land(x, y))]. (is_sint8(x) -> - (is_sint8(y) -> (to_sint8(land(x, y)) = land(x, y))))) - -axiom is_sint8_lsr : - (forall x:int. forall y:int [to_sint8(lsr(x, y))]. ((0 <= y) -> - (is_sint8(x) -> (to_sint8(lsr(x, y)) = lsr(x, y))))) - -axiom is_sint8_lsl1 : (lsl(1, 7) = 128) - -axiom is_sint8_lsl1_inf : - (forall y:int [to_sint8(lsl(1, y))]. (((0 <= y) and (y < 7)) -> - (to_sint8(lsl(1, y)) = lsl(1, y)))) - -axiom is_sint8_lsl1_sup : - (forall y:int [to_sint8(lsl(1, y))]. ((8 <= y) -> (to_sint8(lsl(1, - y)) = 0))) - -axiom is_sint16_lnot : - (forall x:int [to_sint16(lnot(x))]. (is_sint16(x) -> - (to_sint16(lnot(x)) = lnot(x)))) - -axiom is_sint16_lxor : - (forall x:int. forall y:int [to_sint16(lxor(x, y))]. (is_sint16(x) -> - (is_sint16(y) -> (to_sint16(lxor(x, y)) = lxor(x, y))))) - -axiom is_sint16_lor : - (forall x:int. forall y:int [to_sint16(lor(x, y))]. (is_sint16(x) -> - (is_sint16(y) -> (to_sint16(lor(x, y)) = lor(x, y))))) - -axiom is_sint16_land : - (forall x:int. forall y:int [to_sint16(land(x, y))]. (is_sint16(x) -> - (is_sint16(y) -> (to_sint16(land(x, y)) = land(x, y))))) - -axiom is_sint16_lsr : - (forall x:int. forall y:int [to_sint16(lsr(x, y))]. ((0 <= y) -> - (is_sint16(x) -> (to_sint16(lsr(x, y)) = lsr(x, y))))) - -axiom is_sint16_lsl1 : (lsl(1, 15) = 32768) - -axiom is_sint16_lsl1_inf : - (forall y:int [to_sint16(lsl(1, y))]. (((0 <= y) and (y < 15)) -> - (to_sint16(lsl(1, y)) = lsl(1, y)))) - -axiom is_sint16_lsl1_sup : - (forall y:int [to_sint16(lsl(1, y))]. ((16 <= y) -> (to_sint16(lsl(1, - y)) = 0))) - -axiom is_sint32_lnot : - (forall x:int [to_sint32(lnot(x))]. (is_sint32(x) -> - (to_sint32(lnot(x)) = lnot(x)))) - -axiom is_sint32_lxor : - (forall x:int. forall y:int [to_sint32(lxor(x, y))]. (is_sint32(x) -> - (is_sint32(y) -> (to_sint32(lxor(x, y)) = lxor(x, y))))) - -axiom is_sint32_lor : - (forall x:int. forall y:int [to_sint32(lor(x, y))]. (is_sint32(x) -> - (is_sint32(y) -> (to_sint32(lor(x, y)) = lor(x, y))))) - -axiom is_sint32_land : - (forall x:int. forall y:int [to_sint32(land(x, y))]. (is_sint32(x) -> - (is_sint32(y) -> (to_sint32(land(x, y)) = land(x, y))))) - -axiom is_sint32_lsr : - (forall x:int. forall y:int [to_sint32(lsr(x, y))]. ((0 <= y) -> - (is_sint32(x) -> (to_sint32(lsr(x, y)) = lsr(x, y))))) - -axiom is_sint32_lsl1 : (lsl(1, 31) = 2147483648) - -axiom is_sint32_lsl1_inf : - (forall y:int [to_sint32(lsl(1, y))]. (((0 <= y) and (y < 31)) -> - (to_sint32(lsl(1, y)) = lsl(1, y)))) - -axiom is_sint32_lsl1_sup : - (forall y:int [to_sint32(lsl(1, y))]. ((32 <= y) -> (to_sint32(lsl(1, - y)) = 0))) - -axiom is_sint64_lnot : - (forall x:int [to_sint64(lnot(x))]. (is_sint64(x) -> - (to_sint64(lnot(x)) = lnot(x)))) - -axiom is_sint64_lxor : - (forall x:int. forall y:int [to_sint64(lxor(x, y))]. (is_sint64(x) -> - (is_sint64(y) -> (to_sint64(lxor(x, y)) = lxor(x, y))))) - -axiom is_sint64_lor : - (forall x:int. forall y:int [to_sint64(lor(x, y))]. (is_sint64(x) -> - (is_sint64(y) -> (to_sint64(lor(x, y)) = lor(x, y))))) - -axiom is_sint64_land : - (forall x:int. forall y:int [to_sint64(land(x, y))]. (is_sint64(x) -> - (is_sint64(y) -> (to_sint64(land(x, y)) = land(x, y))))) - -axiom is_sint64_lsr : - (forall x:int. forall y:int [to_sint64(lsr(x, y))]. ((0 <= y) -> - (is_sint64(x) -> (to_sint64(lsr(x, y)) = lsr(x, y))))) - -axiom is_sint64_lsl1 : (lsl(1, 63) = 9223372036854775808) - -axiom is_sint64_lsl1_inf : - (forall y:int [to_sint64(lsl(1, y))]. (((0 <= y) and (y < 63)) -> - (to_sint64(lsl(1, y)) = lsl(1, y)))) - -axiom is_sint64_lsl1_sup : - (forall y:int [to_sint64(lsl(1, y))]. ((64 <= y) -> (to_sint64(lsl(1, - y)) = 0))) - -axiom lor_addition : - (forall x:int. forall y:int [land(x, y), lor(x, y)]. ((land(x, y) = 0) -> - ((x + y) = lor(x, y)))) - -axiom lxor_addition : - (forall x:int. forall y:int [land(x, y), lxor(x, y)]. ((land(x, y) = 0) -> - ((x + y) = lxor(x, y)))) diff --git a/src/plugins/wp/share/ergo/Cfloat.mlw b/src/plugins/wp/share/ergo/Cfloat.mlw deleted file mode 100644 index 8767b09720cadfd0849504b8647b601a1337bd8b..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Cfloat.mlw +++ /dev/null @@ -1,360 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory bool_Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_RealInfix_ must be appended to this file*) -(** The theory real_Abs_ must be appended to this file*) -(** The theory real_FromInt_ must be appended to this file*) -(** The theory real_Square_ must be appended to this file*) -type f32 - -type f64 - -logic to_f32 : real -> f32 - -logic of_f32 : f32 -> real - -logic to_f64 : real -> f64 - -logic of_f64 : f64 -> real - -axiom to_f32_zero : (of_f32(to_f32(0.0)) = 0.0) - -axiom to_f32_one : (of_f32(to_f32(1.0)) = 1.0) - -axiom to_f64_zero : (of_f64(to_f64(0.0)) = 0.0) - -axiom to_f64_one : (of_f64(to_f64(1.0)) = 1.0) - -type rounding_mode = Up | Down | ToZero | NearestTiesToAway - | NearestTiesToEven - -logic match_rounding_mode : rounding_mode, 'a, 'a, 'a, 'a, 'a -> 'a - -axiom match_rounding_mode_Up : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. - (match_rounding_mode(Up, z, z1, z2, z3, z4) = z)) - -axiom match_rounding_mode_Down : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. - (match_rounding_mode(Down, z, z1, z2, z3, z4) = z1)) - -axiom match_rounding_mode_ToZero : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. - (match_rounding_mode(ToZero, z, z1, z2, z3, z4) = z2)) - -axiom match_rounding_mode_NearestTiesToAway : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. - (match_rounding_mode(NearestTiesToAway, z, z1, z2, z3, z4) = z3)) - -axiom match_rounding_mode_NearestTiesToEven : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. forall z4:'a. - (match_rounding_mode(NearestTiesToEven, z, z1, z2, z3, z4) = z4)) - -logic round_float : rounding_mode, real -> f32 - -logic round_double : rounding_mode, real -> f64 - -axiom float_32 : - (forall x:real [round_float(NearestTiesToEven, x)]. - (to_f32(x) = round_float(NearestTiesToEven, x))) - -axiom float_64 : - (forall x:real [round_double(NearestTiesToEven, x)]. - (to_f64(x) = round_double(NearestTiesToEven, x))) - -type float_kind = Finite | NaN | Inf_pos | Inf_neg - -logic match_float_kind : float_kind, 'a, 'a, 'a, 'a -> 'a - -axiom match_float_kind_Finite : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. - (match_float_kind(Finite, z, z1, z2, z3) = z)) - -axiom match_float_kind_NaN : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. - (match_float_kind(NaN, z, z1, z2, z3) = z1)) - -axiom match_float_kind_Inf_pos : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. - (match_float_kind(Inf_pos, z, z1, z2, z3) = z2)) - -axiom match_float_kind_Inf_neg : - (forall z:'a. forall z1:'a. forall z2:'a. forall z3:'a. - (match_float_kind(Inf_neg, z, z1, z2, z3) = z3)) - -logic classify_f32 : f32 -> float_kind - -logic classify_f64 : f64 -> float_kind - -predicate is_finite_f32(f: f32) = (classify_f32(f) = Finite) - -predicate is_finite_f64(d: f64) = (classify_f64(d) = Finite) - -predicate is_NaN_f32(f: f32) = (classify_f32(f) = NaN) - -predicate is_NaN_f64(d: f64) = (classify_f64(d) = NaN) - -predicate is_infinite_f32(f: f32) = ((classify_f32(f) = Inf_pos) or - (classify_f32(f) = Inf_neg)) - -predicate is_infinite_f64(d: f64) = ((classify_f64(d) = Inf_pos) or - (classify_f64(d) = Inf_neg)) - -predicate is_positive_infinite_f32(f: f32) = (classify_f32(f) = Inf_pos) - -predicate is_positive_infinite_f64(d: f64) = (classify_f64(d) = Inf_pos) - -predicate is_negative_infinite_f32(f: f32) = (classify_f32(f) = Inf_neg) - -predicate is_negative_infinite_f64(d: f64) = (classify_f64(d) = Inf_neg) - -axiom is_finite_to_float_32 : - (forall x:real [is_finite_f32(to_f32(x))]. is_finite_f32(to_f32(x))) - -axiom is_finite_to_float_64 : - (forall x:real [is_finite_f64(to_f64(x))]. is_finite_f64(to_f64(x))) - -axiom to_float_is_finite_32 : - (forall f:f32 [to_f32(of_f32(f))| is_finite_f32(f)]. (is_finite_f32(f) -> - (to_f32(of_f32(f)) = f))) - -axiom to_float_is_finite_64 : - (forall d:f64 [to_f64(of_f64(d))| is_finite_f64(d)]. (is_finite_f64(d) -> - (to_f64(of_f64(d)) = d))) - -predicate finite(x: real) = (is_finite_f32(to_f32(x)) and - is_finite_f64(to_f64(x))) - -axiom finite_small_f32 : - (forall x:real. - ((((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= x) and - (x <= 340282346600000016151267322115014000640.0)) -> - is_finite_f32(to_f32(x)))) - -axiom finite_small_f64 : - (forall x:real. - ((((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= x) and - (x <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0)) -> - is_finite_f64(to_f64(x)))) - -axiom finite_range_f32 : - (forall f:f32. (is_finite_f32(f) -> - ((-340282346600000016151267322115014000640.0) <= of_f32(f)))) - -axiom finite_range_f321 : - (forall f:f32. (is_finite_f32(f) -> - (of_f32(f) <= 340282346600000016151267322115014000640.0))) - -axiom finite_range_f322 : - (forall f:f32. - ((((-340282346600000016151267322115014000640.0) <= of_f32(f)) and - (of_f32(f) <= 340282346600000016151267322115014000640.0)) -> - is_finite_f32(f))) - -axiom finite_range_f64 : - (forall d:f64. (is_finite_f64(d) -> - ((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= of_f64(d)))) - -axiom finite_range_f641 : - (forall d:f64. (is_finite_f64(d) -> - (of_f64(d) <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0))) - -axiom finite_range_f642 : - (forall d:f64. - ((((-179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0) <= of_f64(d)) and - (of_f64(d) <= 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0)) -> - is_finite_f64(d))) - -logic eq_f32b : f32, f32 -> bool - -logic eq_f64b : f64, f64 -> bool - -predicate eq_f32(x: f32, y: f32) = (eq_f32b(x, y) = true) - -predicate eq_f64(x: f64, y: f64) = (eq_f64b(x, y) = true) - -axiom eq_finite_f32 : - (forall x:f32. forall y:f32 [eq_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> (eq_f32(x, y) -> (of_f32(x) = of_f32(y)))))) - -axiom eq_finite_f321 : - (forall x:f32. forall y:f32 [eq_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> ((of_f32(x) = of_f32(y)) -> eq_f32(x, y))))) - -axiom eq_finite_f64 : - (forall x:f64. forall y:f64 [eq_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> (eq_f64(x, y) -> (of_f64(x) = of_f64(y)))))) - -axiom eq_finite_f641 : - (forall x:f64. forall y:f64 [eq_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> ((of_f64(x) = of_f64(y)) -> eq_f64(x, y))))) - -logic ne_f32b : f32, f32 -> bool - -logic ne_f64b : f64, f64 -> bool - -predicate ne_f32(x: f32, y: f32) = (ne_f32b(x, y) = true) - -predicate ne_f64(x: f64, y: f64) = (ne_f64b(x, y) = true) - -axiom ne_finite_f32 : - (forall x:f32. forall y:f32 [ne_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> (ne_f32(x, y) -> (not (of_f32(x) = of_f32(y))))))) - -axiom ne_finite_f321 : - (forall x:f32. forall y:f32 [ne_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> ((not (of_f32(x) = of_f32(y))) -> ne_f32(x, y))))) - -axiom ne_finite_f64 : - (forall x:f64. forall y:f64 [ne_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> (ne_f64(x, y) -> (not (of_f64(x) = of_f64(y))))))) - -axiom ne_finite_f641 : - (forall x:f64. forall y:f64 [ne_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> ((not (of_f64(x) = of_f64(y))) -> ne_f64(x, y))))) - -logic le_f32b : f32, f32 -> bool - -logic le_f64b : f64, f64 -> bool - -predicate le_f32(x: f32, y: f32) = (le_f32b(x, y) = true) - -predicate le_f64(x: f64, y: f64) = (le_f64b(x, y) = true) - -axiom le_finite_f32 : - (forall x:f32. forall y:f32 [le_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> (le_f32(x, y) -> (of_f32(x) <= of_f32(y)))))) - -axiom le_finite_f321 : - (forall x:f32. forall y:f32 [le_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> ((of_f32(x) <= of_f32(y)) -> le_f32(x, y))))) - -axiom le_finite_f64 : - (forall x:f64. forall y:f64 [le_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> (le_f64(x, y) -> (of_f64(x) <= of_f64(y)))))) - -axiom le_finite_f641 : - (forall x:f64. forall y:f64 [le_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> ((of_f64(x) <= of_f64(y)) -> le_f64(x, y))))) - -logic lt_f32b : f32, f32 -> bool - -logic lt_f64b : f64, f64 -> bool - -predicate lt_f32(x: f32, y: f32) = (lt_f32b(x, y) = true) - -predicate lt_f64(x: f64, y: f64) = (lt_f64b(x, y) = true) - -axiom lt_finite_f32 : - (forall x:f32. forall y:f32 [lt_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> (lt_f32(x, y) -> (of_f32(x) < of_f32(y)))))) - -axiom lt_finite_f321 : - (forall x:f32. forall y:f32 [lt_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> ((of_f32(x) < of_f32(y)) -> lt_f32(x, y))))) - -axiom lt_finite_f64 : - (forall x:f64. forall y:f64 [lt_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> (lt_f64(x, y) -> (of_f64(x) < of_f64(y)))))) - -axiom lt_finite_f641 : - (forall x:f64. forall y:f64 [lt_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> ((of_f64(x) < of_f64(y)) -> lt_f64(x, y))))) - -logic neg_f32 : f32 -> f32 - -logic neg_f64 : f64 -> f64 - -axiom neg_finite_f32 : - (forall x:f32 [neg_f32(x)]. (is_finite_f32(x) -> - (of_f32(neg_f32(x)) = (-of_f32(x))))) - -axiom neg_finite_f64 : - (forall x:f64 [neg_f64(x)]. (is_finite_f64(x) -> - (of_f64(neg_f64(x)) = (-of_f64(x))))) - -logic add_f32 : f32, f32 -> f32 - -logic add_f64 : f64, f64 -> f64 - -axiom add_finite_f32 : - (forall x:f32. forall y:f32 [add_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> (add_f32(x, y) = to_f32((of_f32(x) + of_f32(y))))))) - -axiom add_finite_f64 : - (forall x:f64. forall y:f64 [add_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> (add_f64(x, y) = to_f64((of_f64(x) + of_f64(y))))))) - -logic mul_f32 : f32, f32 -> f32 - -logic mul_f64 : f64, f64 -> f64 - -axiom mul_finite_f32 : - (forall x:f32. forall y:f32 [mul_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> (mul_f32(x, y) = to_f32((of_f32(x) * of_f32(y))))))) - -axiom mul_finite_f64 : - (forall x:f64. forall y:f64 [mul_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> (mul_f64(x, y) = to_f64((of_f64(x) * of_f64(y))))))) - -logic div_f32 : f32, f32 -> f32 - -logic div_f64 : f64, f64 -> f64 - -axiom div_finite_f32 : - (forall x:f32. forall y:f32 [div_f32(x, y)]. (is_finite_f32(x) -> - (is_finite_f32(y) -> (div_f32(x, y) = to_f32((of_f32(x) / of_f32(y))))))) - -axiom div_finite_f64 : - (forall x:f64. forall y:f64 [div_f64(x, y)]. (is_finite_f64(x) -> - (is_finite_f64(y) -> (div_f64(x, y) = to_f64((of_f64(x) / of_f64(y))))))) - -logic sqrt_f32 : f32 -> f32 - -logic sqrt_f64 : f64 -> f64 - -axiom sqrt_finite_f32 : - (forall x:f32 [sqrt_f32(x)]. (is_finite_f32(x) -> - (sqrt_f32(x) = to_f32(sqrt(of_f32(x)))))) - -axiom sqrt_finite_f64 : - (forall x:f64 [sqrt_f64(x)]. (is_finite_f64(x) -> - (sqrt_f64(x) = to_f64(sqrt(of_f64(x)))))) - -logic model_f32 : f32 -> real - -function delta_f32(f: f32) : real = abs_real((of_f32(f) - model_f32(f))) - -function error_f32(f: f32) : real = (delta_f32(f) / abs_real(model_f32(f))) - -logic model_f64 : f64 -> real - -function delta_f64(f: f64) : real = abs_real((of_f64(f) - model_f64(f))) - -function error_f64(f: f64) : real = (delta_f64(f) / abs_real(model_f64(f))) - diff --git a/src/plugins/wp/share/ergo/Cint.mlw b/src/plugins/wp/share/ergo/Cint.mlw deleted file mode 100644 index 7dab26534909598507551f442cd70d138ea49697..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Cint.mlw +++ /dev/null @@ -1,224 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory bool_Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -predicate is_bool(x: int) = ((x = 0) or (x = 1)) - -logic is_uint8 : int -> prop - -axiom is_uint8_def : (forall x:int [is_uint8(x)]. (is_uint8(x) -> (0 <= x))) - -axiom is_uint8_def1 : - (forall x:int [is_uint8(x)]. (is_uint8(x) -> (x < 256))) - -axiom is_uint8_def2 : - (forall x:int [is_uint8(x)]. (((0 <= x) and (x < 256)) -> is_uint8(x))) - -logic is_sint8 : int -> prop - -axiom is_sint8_def : - (forall x:int [is_sint8(x)]. (is_sint8(x) -> ((-128) <= x))) - -axiom is_sint8_def1 : - (forall x:int [is_sint8(x)]. (is_sint8(x) -> (x < 128))) - -axiom is_sint8_def2 : - (forall x:int [is_sint8(x)]. ((((-128) <= x) and (x < 128)) -> - is_sint8(x))) - -logic is_uint16 : int -> prop - -axiom is_uint16_def : - (forall x:int [is_uint16(x)]. (is_uint16(x) -> (0 <= x))) - -axiom is_uint16_def1 : - (forall x:int [is_uint16(x)]. (is_uint16(x) -> (x < 65536))) - -axiom is_uint16_def2 : - (forall x:int [is_uint16(x)]. (((0 <= x) and (x < 65536)) -> - is_uint16(x))) - -predicate is_sint16(x: int) = (((-32768) <= x) and (x < 32768)) - -logic is_uint32 : int -> prop - -axiom is_uint32_def : - (forall x:int [is_uint32(x)]. (is_uint32(x) -> (0 <= x))) - -axiom is_uint32_def1 : - (forall x:int [is_uint32(x)]. (is_uint32(x) -> (x < 4294967296))) - -axiom is_uint32_def2 : - (forall x:int [is_uint32(x)]. (((0 <= x) and (x < 4294967296)) -> - is_uint32(x))) - -logic is_sint32 : int -> prop - -axiom is_sint32_def : - (forall x:int [is_sint32(x)]. (is_sint32(x) -> ((-2147483648) <= x))) - -axiom is_sint32_def1 : - (forall x:int [is_sint32(x)]. (is_sint32(x) -> (x < 2147483648))) - -axiom is_sint32_def2 : - (forall x:int [is_sint32(x)]. ((((-2147483648) <= x) and - (x < 2147483648)) -> is_sint32(x))) - -logic is_uint64 : int -> prop - -axiom is_uint64_def : - (forall x:int [is_uint64(x)]. (is_uint64(x) -> (0 <= x))) - -axiom is_uint64_def1 : - (forall x:int [is_uint64(x)]. (is_uint64(x) -> - (x < 18446744073709551616))) - -axiom is_uint64_def2 : - (forall x:int [is_uint64(x)]. (((0 <= x) and - (x < 18446744073709551616)) -> is_uint64(x))) - -logic is_sint64 : int -> prop - -axiom is_sint64_def : - (forall x:int [is_sint64(x)]. (is_sint64(x) -> - ((-9223372036854775808) <= x))) - -axiom is_sint64_def1 : - (forall x:int [is_sint64(x)]. (is_sint64(x) -> (x < 9223372036854775808))) - -axiom is_sint64_def2 : - (forall x:int [is_sint64(x)]. ((((-9223372036854775808) <= x) and - (x < 9223372036854775808)) -> is_sint64(x))) - -axiom is_bool0 : is_bool(0) - -axiom is_bool1 : is_bool(1) - -logic to_bool : int -> int - -axiom to_bool_def : (forall x:int. ((x = 0) -> (to_bool(x) = 0))) - -axiom to_bool_def1 : (forall x:int. ((not (x = 0)) -> (to_bool(x) = 1))) - -logic to_uint8 : int -> int - -logic to_sint8 : int -> int - -logic to_uint16 : int -> int - -logic to_sint16 : int -> int - -logic to_uint32 : int -> int - -logic to_sint32 : int -> int - -logic to_uint64 : int -> int - -logic to_sint64 : int -> int - -logic two_power_abs : int -> int - -predicate is_uint(n: int, x: int) = ((0 <= x) and (x < two_power_abs(n))) - -predicate is_sint(n: int, x: int) = (((-two_power_abs(n)) <= x) and - (x < two_power_abs(n))) - -logic to_uint : int, int -> int - -logic to_sint : int, int -> int - -axiom is_to_uint8 : - (forall x:int [is_uint8(to_uint8(x))]. is_uint8(to_uint8(x))) - -axiom is_to_sint8 : - (forall x:int [is_sint8(to_sint8(x))]. is_sint8(to_sint8(x))) - -axiom is_to_uint16 : - (forall x:int [is_uint16(to_uint16(x))]. is_uint16(to_uint16(x))) - -axiom is_to_sint16 : - (forall x:int [is_sint16(to_sint16(x))]. is_sint16(to_sint16(x))) - -axiom is_to_uint32 : - (forall x:int [is_uint32(to_uint32(x))]. is_uint32(to_uint32(x))) - -axiom is_to_sint32 : - (forall x:int [is_sint32(to_sint32(x))]. is_sint32(to_sint32(x))) - -axiom is_to_uint64 : - (forall x:int [is_uint64(to_uint64(x))]. is_uint64(to_uint64(x))) - -axiom is_to_sint64 : - (forall x:int [is_sint64(to_sint64(x))]. is_sint64(to_sint64(x))) - -axiom id_uint8 : - (forall x:int [to_uint8(x)]. (((0 <= x) and (x < 256)) -> - (to_uint8(x) = x))) - -axiom id_sint8 : - (forall x:int [to_sint8(x)]. ((((-128) <= x) and (x < 128)) -> - (to_sint8(x) = x))) - -axiom id_uint16 : - (forall x:int [to_uint16(x)]. (((0 <= x) and (x < 65536)) -> - (to_uint16(x) = x))) - -axiom id_sint16 : - (forall x:int [to_sint16(x)]. ((((-32768) <= x) and (x < 32768)) -> - (to_sint16(x) = x))) - -axiom id_uint32 : - (forall x:int [to_uint32(x)]. (((0 <= x) and (x < 4294967296)) -> - (to_uint32(x) = x))) - -axiom id_sint32 : - (forall x:int [to_sint32(x)]. ((((-2147483648) <= x) and - (x < 2147483648)) -> (to_sint32(x) = x))) - -axiom id_uint64 : - (forall x:int [to_uint64(x)]. (((0 <= x) and - (x < 18446744073709551616)) -> (to_uint64(x) = x))) - -axiom id_sint64 : - (forall x:int [to_sint64(x)]. ((((-9223372036854775808) <= x) and - (x < 9223372036854775808)) -> (to_sint64(x) = x))) - -axiom proj_int8 : - (forall x:int [to_sint8(to_uint8(x))]. - (to_sint8(to_uint8(x)) = to_sint8(x))) - -axiom proj_int16 : - (forall x:int [to_sint16(to_uint16(x))]. - (to_sint16(to_uint16(x)) = to_sint16(x))) - -axiom proj_int32 : - (forall x:int [to_sint32(to_uint32(x))]. - (to_sint32(to_uint32(x)) = to_sint32(x))) - -axiom proj_int64 : - (forall x:int [to_sint64(to_uint64(x))]. - (to_sint64(to_uint64(x)) = to_sint64(x))) - diff --git a/src/plugins/wp/share/ergo/Cmath.mlw b/src/plugins/wp/share/ergo/Cmath.mlw deleted file mode 100644 index 137cf15a396cfcc2fa4b9385f4fc60a026504ae2..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Cmath.mlw +++ /dev/null @@ -1,34 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory int_Abs_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_RealInfix_ must be appended to this file*) -axiom abs_def : (forall x:int [abs_int(x)]. ((0 <= x) -> (abs_int(x) = x))) - -axiom abs_def1 : - (forall x:int [abs_int(x)]. ((not (0 <= x)) -> (abs_int(x) = (-x)))) - diff --git a/src/plugins/wp/share/ergo/ExpLog.mlw b/src/plugins/wp/share/ergo/ExpLog.mlw deleted file mode 100644 index c71d17e18b02ce657cc08c06f1cdbde2bac393ed..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/ExpLog.mlw +++ /dev/null @@ -1,30 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_RealInfix_ must be appended to this file*) -(** The theory real_ExpLog_ must be appended to this file*) -axiom exp_pos : (forall x:real. (0.0 < exp(x))) - diff --git a/src/plugins/wp/share/ergo/Memory.mlw b/src/plugins/wp/share/ergo/Memory.mlw deleted file mode 100644 index 32ac4406cf93bca73f2a0222d9844a96c472880a..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Memory.mlw +++ /dev/null @@ -1,212 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory bool_Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory map_Map_ must be appended to this file*) -type addr = { base : int; offset : int -} - -logic addr_le : addr, addr -> prop - -logic addr_lt : addr, addr -> prop - -logic addr_le_bool : addr, addr -> bool - -logic addr_lt_bool : addr, addr -> bool - -axiom addr_le_def : - (forall p:addr. forall q:addr [addr_le(p, q)]. (((p).base = (q).base) -> - (addr_le(p, q) -> ((p).offset <= (q).offset)))) - -axiom addr_le_def1 : - (forall p:addr. forall q:addr [addr_le(p, q)]. (((p).base = (q).base) -> - (((p).offset <= (q).offset) -> addr_le(p, q)))) - -axiom addr_lt_def : - (forall p:addr. forall q:addr [addr_lt(p, q)]. (((p).base = (q).base) -> - (addr_lt(p, q) -> ((p).offset < (q).offset)))) - -axiom addr_lt_def1 : - (forall p:addr. forall q:addr [addr_lt(p, q)]. (((p).base = (q).base) -> - (((p).offset < (q).offset) -> addr_lt(p, q)))) - -axiom addr_le_bool_def : - (forall p:addr. forall q:addr [addr_le_bool(p, q)]. (addr_le(p, q) -> - (addr_le_bool(p, q) = true))) - -axiom addr_le_bool_def1 : - (forall p:addr. forall q:addr [addr_le_bool(p, q)]. ((addr_le_bool(p, - q) = true) -> addr_le(p, q))) - -axiom addr_lt_bool_def : - (forall p:addr. forall q:addr [addr_lt_bool(p, q)]. (addr_lt(p, q) -> - (addr_lt_bool(p, q) = true))) - -axiom addr_lt_bool_def1 : - (forall p:addr. forall q:addr [addr_lt_bool(p, q)]. ((addr_lt_bool(p, - q) = true) -> addr_lt(p, q))) - -function null() : addr = { base = 0; offset = 0 } - -function global(b: int) : addr = { base = b; offset = 0 } - -function shift(p: addr, k: int) : addr = { base = (p).base; offset = - ((p).offset + k) } - -predicate included(p: addr, a: int, q: addr, b: int) = ((0 < a) -> - ((0 <= b) and (((p).base = (q).base) and (((q).offset <= (p).offset) and - (((p).offset + a) <= ((q).offset + b)))))) - -predicate separated(p: addr, a: int, q: addr, b: int) = ((a <= 0) or - ((b <= 0) or ((not ((p).base = (q).base)) or - ((((q).offset + b) <= (p).offset) or (((p).offset + a) <= (q).offset))))) - -predicate eqmem(m1: (addr,'a) farray, m2: (addr,'a) farray, p: addr, - a1: int) = - (forall q:addr [(m1[p])| (m2[q])]. (included(q, 1, p, a1) -> - ((m1[q]) = (m2[q])))) - -logic havoc : (addr,'a) farray, (addr,'a) farray, addr, - int -> (addr,'a) farray - -predicate valid_rw(m: (int,int) farray, p: addr, n: int) = ((0 < n) -> - ((0 < (p).base) and ((0 <= (p).offset) and - (((p).offset + n) <= (m[(p).base]))))) - -predicate valid_rd(m: (int,int) farray, p: addr, n: int) = ((0 < n) -> - ((not (0 = (p).base)) and ((0 <= (p).offset) and - (((p).offset + n) <= (m[(p).base]))))) - -predicate invalid(m: (int,int) farray, p: addr, n: int) = ((0 < n) -> - (((m[(p).base]) <= (p).offset) or (((p).offset + n) <= 0))) - -axiom valid_rw_rd : - (forall m:(int,int) farray. - (forall p:addr. (forall n:int. (valid_rw(m, p, n) -> valid_rd(m, p, n))))) - -axiom valid_string : - (forall m:(int,int) farray. - (forall p:addr. (((p).base < 0) -> (((0 <= (p).offset) and - ((p).offset < (m[(p).base]))) -> valid_rd(m, p, 1))))) - -axiom valid_string1 : - (forall m:(int,int) farray. - (forall p:addr. (((p).base < 0) -> (((0 <= (p).offset) and - ((p).offset < (m[(p).base]))) -> (not valid_rw(m, p, 1)))))) - -axiom separated_1 : - (forall p:addr. forall q:addr. - (forall a:int. forall b:int. forall i:int. forall j:int [separated(p, a, q, - b), { base = (p).base; offset = i }, { base = (q).base; offset = j }]. - (separated(p, a, q, b) -> ((((p).offset <= i) and - (i < ((p).offset + a))) -> ((((q).offset <= j) and - (j < ((q).offset + b))) -> (not ({ base = (p).base; offset = i } = { - base = (q).base; offset = j }))))))) - -logic region : int -> int - -logic linked : (int,int) farray -> prop - -logic sconst : (addr,int) farray -> prop - -predicate framed(m: (addr,addr) farray) = - (forall p:addr [(m[p])]. (region(((m[p])).base) <= 0)) - -axiom separated_included : - (forall p:addr. forall q:addr. - (forall a:int. forall b:int [separated(p, a, q, b), included(p, a, q, b)]. - ((0 < a) -> ((0 < b) -> (separated(p, a, q, b) -> (not included(p, a, q, - b))))))) - -axiom included_trans : - (forall p:addr. forall q:addr. forall r:addr. - (forall a:int. forall b:int. forall c:int [included(p, a, q, b), - included(q, b, r, c)]. (included(p, a, q, b) -> (included(q, b, r, c) -> - included(p, a, r, c))))) - -axiom separated_trans : - (forall p:addr. forall q:addr. forall r:addr. - (forall a:int. forall b:int. forall c:int [included(p, a, q, b), - separated(q, b, r, c)]. (included(p, a, q, b) -> (separated(q, b, r, c) -> - separated(p, a, r, c))))) - -axiom separated_sym : - (forall p:addr. forall q:addr. - (forall a:int. forall b:int [separated(p, a, q, b)]. (separated(p, a, q, - b) -> separated(q, b, p, a)))) - -axiom separated_sym1 : - (forall p:addr. forall q:addr. - (forall a:int. forall b:int [separated(p, a, q, b)]. (separated(q, b, p, - a) -> separated(p, a, q, b)))) - -axiom eqmem_included : - (forall m1:(addr,'a) farray. forall m2:(addr,'a) farray. - (forall p:addr. forall q:addr. - (forall a1:int. forall b:int [eqmem(m1, m2, p, a1), eqmem(m1, m2, q, b)]. - (included(p, a1, q, b) -> (eqmem(m1, m2, q, b) -> eqmem(m1, m2, p, a1)))))) - -axiom eqmem_sym : - (forall m1:(addr,'a) farray. forall m2:(addr,'a) farray. - (forall p:addr. - (forall a1:int. (eqmem(m1, m2, p, a1) -> eqmem(m2, m1, p, a1))))) - -axiom havoc_access : - (forall m0:(addr,'a) farray. forall m1:(addr,'a) farray. - (forall q:addr. forall p:addr. - (forall a1:int. (separated(q, 1, p, a1) -> ((havoc(m0, m1, p, - a1)[q]) = (m1[q])))))) - -axiom havoc_access1 : - (forall m0:(addr,'a) farray. forall m1:(addr,'a) farray. - (forall q:addr. forall p:addr. - (forall a1:int. ((not separated(q, 1, p, a1)) -> ((havoc(m0, m1, p, - a1)[q]) = (m0[q])))))) - -logic int_of_addr : addr -> int - -logic addr_of_int : int -> addr - -logic base_offset : int -> int - -logic base_index : int -> int - -axiom int_of_addr_bijection : - (forall a:int. (int_of_addr(addr_of_int(a)) = a)) - -axiom addr_of_int_bijection : - (forall p:addr. (addr_of_int(int_of_addr(p)) = p)) - -axiom addr_of_null : (int_of_addr(null) = 0) - -axiom base_offset_zero : (base_offset(0) = 0) - -axiom base_offset_inj : (forall i:int. (base_index(base_offset(i)) = i)) - -axiom base_offset_monotonic : - (forall i:int. forall j:int. ((i < j) -> - (base_offset(i) < base_offset(j)))) - diff --git a/src/plugins/wp/share/ergo/Qed.mlw b/src/plugins/wp/share/ergo/Qed.mlw deleted file mode 100644 index 08a3998f07c8d0d923f3ceb0e6b8d3c3344caf67..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Qed.mlw +++ /dev/null @@ -1,158 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory bool_Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory int_Abs_ must be appended to this file*) -(** The theory int_ComputerDivision_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_RealInfix_ must be appended to this file*) -(** The theory real_FromInt_ must be appended to this file*) -logic match_bool : bool, 'a, 'a -> 'a - -axiom match_bool1 : - (forall p:bool. forall x:'a. forall y:'a [match_bool(p, x, y)]. - (((p = true) and (match_bool(p, x, y) = x)) or ((p = false) and - (match_bool(p, x, y) = y)))) - -logic eqb : 'a, 'a -> bool - -axiom eqb1 : (forall x:'a. forall y:'a. ((eqb(x, y) = true) -> (x = y))) - -axiom eqb2 : (forall x:'a. forall y:'a. ((x = y) -> (eqb(x, y) = true))) - -logic neqb : 'a, 'a -> bool - -axiom neqb1 : - (forall x:'a. forall y:'a. ((neqb(x, y) = true) -> (not (x = y)))) - -axiom neqb2 : - (forall x:'a. forall y:'a. ((not (x = y)) -> (neqb(x, y) = true))) - -logic zlt : int, int -> bool - -logic zleq : int, int -> bool - -axiom zlt1 : (forall x:int. forall y:int. ((zlt(x, y) = true) -> (x < y))) - -axiom zlt2 : (forall x:int. forall y:int. ((x < y) -> (zlt(x, y) = true))) - -axiom zleq1 : (forall x:int. forall y:int. ((zleq(x, y) = true) -> (x <= y))) - -axiom zleq2 : (forall x:int. forall y:int. ((x <= y) -> (zleq(x, y) = true))) - -logic rlt : real, real -> bool - -logic rleq : real, real -> bool - -axiom rlt1 : (forall x:real. forall y:real. ((rlt(x, y) = true) -> (x < y))) - -axiom rlt2 : (forall x:real. forall y:real. ((x < y) -> (rlt(x, y) = true))) - -axiom rleq1 : - (forall x:real. forall y:real. ((rleq(x, y) = true) -> (x <= y))) - -axiom rleq2 : - (forall x:real. forall y:real. ((x <= y) -> (rleq(x, y) = true))) - -function real_of_int(x: int) : real = from_int(x) - -axiom cdiv_cases : - (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((0 < d) -> (div(n, - d) = (n / d))))) - -axiom cdiv_cases1 : - (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((0 < d) -> (div(n, - d) = (-((-n) / d)))))) - -axiom cdiv_cases2 : - (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((d < 0) -> (div(n, - d) = (-(n / (-d))))))) - -axiom cdiv_cases3 : - (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((d < 0) -> (div(n, - d) = ((-n) / (-d)))))) - -axiom cmod_cases : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> (mod(n, - d) = (n % d))))) - -axiom cmod_cases1 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> (mod(n, - d) = (-((-n) % d)))))) - -axiom cmod_cases2 : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> (mod(n, - d) = (n % (-d)))))) - -axiom cmod_cases3 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> (mod(n, - d) = (-((-n) % (-d))))))) - -axiom c_euclidian : - (forall n:int. forall d:int [div(n, d), mod(n, d)]. ((not (d = 0)) -> - (n = ((div(n, d) * d) + mod(n, d))))) - -axiom cmod_remainder : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> - (0 <= mod(n, d))))) - -axiom cmod_remainder1 : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> (mod(n, - d) < d)))) - -axiom cmod_remainder2 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> - ((-d) < mod(n, d))))) - -axiom cmod_remainder3 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> (mod(n, - d) <= 0)))) - -axiom cmod_remainder4 : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> - (0 <= mod(n, d))))) - -axiom cmod_remainder5 : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> (mod(n, - d) < (-d))))) - -axiom cmod_remainder6 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> - (d < mod(n, d))))) - -axiom cmod_remainder7 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> (mod(n, - d) <= 0)))) - -axiom cdiv_neutral : (forall a:int [div(a, 1)]. (div(a, 1) = a)) - -axiom cdiv_inv : - (forall a:int [div(a, a)]. ((not (a = 0)) -> (div(a, a) = 1))) - -axiom cdiv_closed_remainder : - (forall a:int. forall b:int. forall n:int. ((0 <= a) -> ((0 <= b) -> - (((0 <= (b - a)) and ((b - a) < n)) -> ((mod(a,n) = mod(b,n)) -> - (a = b)))))) diff --git a/src/plugins/wp/share/ergo/Square.mlw b/src/plugins/wp/share/ergo/Square.mlw deleted file mode 100644 index 3a1f199e50e96781dfe603cef57352028480a721..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Square.mlw +++ /dev/null @@ -1,37 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_RealInfix_ must be appended to this file*) -(** The theory real_Square_ must be appended to this file*) -axiom sqrt_lin1 : (forall x:real [sqrt(x)]. ((1.0 < x) -> (sqrt(x) < x))) - -axiom sqrt_lin0 : - (forall x:real [sqrt(x)]. (((0.0 < x) and (x < 1.0)) -> (x < sqrt(x)))) - -axiom sqrt_0 : (sqrt(0.0) = 0.0) - -axiom sqrt_1 : (sqrt(1.0) = 1.0) - diff --git a/src/plugins/wp/share/ergo/Vlist.mlw b/src/plugins/wp/share/ergo/Vlist.mlw deleted file mode 100644 index c10ced2bdb52503e1331f53739b5074126e748c3..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Vlist.mlw +++ /dev/null @@ -1,126 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory int_Abs_ must be appended to this file*) -(** The theory int_ComputerDivision_ must be appended to this file*) -type 'a list - -logic nil : 'a list - -logic cons : 'a, 'a list -> 'a list - -logic concat : 'a list, 'a list -> 'a list - -logic repeat : 'a list, int -> 'a list - -logic length : 'a list -> int - -logic nth : 'a list, int -> 'a - -axiom length_pos : (forall w:'a list. (0 <= length(w))) - -axiom length_nil : (length((nil : 'a list)) = 0) - -axiom length_nil_bis : - (forall w:'a list. ((length(w) = 0) -> (w = (nil : 'a list)))) - -axiom length_cons : - (forall x:'a. forall w:'a list [length(cons(x, w))]. (length(cons(x, - w)) = (1 + length(w)))) - -axiom length_concat : - (forall u:'a list. forall v:'a list [length(concat(u, v))]. - (length(concat(u, v)) = (length(u) + length(v)))) - -axiom length_repeat : - (forall w:'a list. forall n:int [length(repeat(w, n))]. ((0 <= n) -> - (length(repeat(w, n)) = (n * length(w))))) - -axiom nth_cons : - (forall k:int. forall x:'a. forall w:'a list [nth(cons(x, w), k)]. - ((k = 0) -> (nth(cons(x, w), k) = x))) - -axiom nth_cons1 : - (forall k:int. forall x:'a. forall w:'a list [nth(cons(x, w), k)]. - ((not (k = 0)) -> (nth(cons(x, w), k) = nth(w, (k - 1))))) - -axiom nth_concat : - (forall u:'a list. forall v:'a list. forall k:int [nth(concat(u, v), k)]. - ((k < length(u)) -> (nth(concat(u, v), k) = nth(u, k)))) - -axiom nth_concat1 : - (forall u:'a list. forall v:'a list. forall k:int [nth(concat(u, v), k)]. - ((not (k < length(u))) -> (nth(concat(u, v), k) = nth(v, - (k - length(u)))))) - -axiom nth_repeat : - (forall n:int. forall k:int. forall w:'a list [nth(repeat(w, n), k)]. - (((0 <= k) and (k < (n * length(w)))) -> ((0 < length(w)) -> - (nth(repeat(w, n), k) = nth(w, mod(k, length(w))))))) - -predicate vlist_eq(u: 'a list, v: 'a list) = ((length(u) = length(v)) and - (forall i:int. (((0 <= i) and (i < length(u))) -> (nth(u, i) = nth(v, - i))))) - -axiom extensionality : - (forall u:'a list. forall v:'a list. (vlist_eq(u, v) -> (u = v))) - -axiom rw_nil_concat_left : - (forall w:'a list [concat((nil : 'a list), w)]. (concat((nil : 'a list), - w) = w)) - -axiom rw_nil_concat_right : - (forall w:'a list [concat(w, (nil : 'a list))]. (concat(w, - (nil : 'a list)) = w)) - -axiom rw_nil_repeat : - (forall n:int [repeat((nil : 'a list), n)]. ((0 <= n) -> - (repeat((nil : 'a list), n) = (nil : 'a list)))) - -axiom rw_repeat_zero : - (forall w:'a list [repeat(w, 0)]. (repeat(w, 0) = (nil : 'a list))) - -axiom rw_repeat_one : (forall w:'a list [repeat(w, 1)]. (repeat(w, 1) = w)) - -logic repeat_box : 'a list, int -> 'a list - -axiom rw_repeat_box_unfold : - (forall w:'a list. forall n:int [repeat_box(w, n)]. (repeat_box(w, - n) = repeat(w, n))) - -axiom rw_repeat_plus_box_unfold : - (forall w:'a list. forall a1:int. forall b:int [repeat_box(w, (a1 + b))]. - ((0 <= a1) -> ((0 <= b) -> (repeat_box(w, (a1 + b)) = concat(repeat(w, a1), - repeat(w, b)))))) - -axiom rw_repeat_plus_one_box_unfold : - (forall w:'a list. forall n:int [repeat_box(w, n)]. ((0 < n) -> - (repeat_box(w, n) = concat(repeat(w, (n - 1)), w)))) - -axiom rw_repeat_plus_one_box_unfold1 : - (forall w:'a list. forall n:int [repeat_box(w, n)]. ((0 < n) -> - (repeat_box(w, (n + 1)) = concat(repeat(w, n), w)))) - diff --git a/src/plugins/wp/share/ergo/Vset.mlw b/src/plugins/wp/share/ergo/Vset.mlw deleted file mode 100644 index 250caa049582d78402817b02faedff2b3022772f..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/Vset.mlw +++ /dev/null @@ -1,152 +0,0 @@ -(**************************************************************************) -(* *) -(* This file is part of WP plug-in of Frama-C. *) -(* *) -(* Copyright (C) 2007-2021 *) -(* CEA (Commissariat a l'energie atomique et aux energies *) -(* alternatives) *) -(* *) -(* you can redistribute it and/or modify it under the terms of the GNU *) -(* Lesser General Public License as published by the Free Software *) -(* Foundation, version 2.1. *) -(* *) -(* It is distributed in the hope that it will be useful, *) -(* but WITHOUT ANY WARRANTY; without even the implied warranty of *) -(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *) -(* GNU Lesser General Public License for more details. *) -(* *) -(* See the GNU Lesser General Public License version 2.1 *) -(* for more details (enclosed in the file licenses/LGPLv2.1). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory bool_Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -type 'a set - -logic empty : 'a set - -logic singleton : 'a -> 'a set - -logic ac union : 'a set, 'a set -> 'a set - -logic ac inter : 'a set, 'a set -> 'a set - -logic member : 'a, 'a set -> prop - -logic member_bool : 'a, 'a set -> bool - -logic range : int, int -> int set - -logic range_sup : int -> int set - -logic range_inf : int -> int set - -logic range_all : int set - -predicate eqset(a: 'a1 set, b: 'a1 set) = - (forall x:'a1. (member(x, a) <-> member(x, b))) - -predicate subset(a: 'a1 set, b: 'a1 set) = - (forall x:'a1. (member(x, a) -> member(x, b))) - -predicate disjoint(a: 'a1 set, b: 'a1 set) = - (forall x:'a1. (member(x, a) -> (not member(x, b)))) - -axiom member_bool1 : - (forall x:'a. - (forall s:'a set [member_bool(x, s)]. (member(x, s) -> (member_bool(x, - s) = true)))) - -axiom member_bool2 : - (forall x:'a. - (forall s:'a set [member_bool(x, s)]. ((not member(x, s)) -> - (member_bool(x, s) = false)))) - -axiom member_empty : - (forall x:'a [member(x, (empty : 'a set))]. (not member(x, - (empty : 'a set)))) - -axiom member_singleton : - (forall x:'a. forall y:'a [member(x, singleton(y))]. (member(x, - singleton(y)) -> (x = y))) - -axiom member_singleton1 : - (forall x:'a. forall y:'a [member(x, singleton(y))]. ((x = y) -> member(x, - singleton(y)))) - -axiom member_union : - (forall x:'a. - (forall a1:'a set. forall b:'a set [member(x, union(a1, b))]. (member(x, - union(a1, b)) -> (member(x, a1) or member(x, b))))) - -axiom member_union1 : - (forall x:'a. - (forall a1:'a set. forall b:'a set [member(x, union(a1, b))]. ((member(x, - a1) or member(x, b)) -> member(x, union(a1, b))))) - -axiom member_inter : - (forall x:'a. - (forall a1:'a set. forall b:'a set [member(x, inter(a1, b))]. (member(x, - inter(a1, b)) -> member(x, a1)))) - -axiom member_inter1 : - (forall x:'a. - (forall a1:'a set. forall b:'a set [member(x, inter(a1, b))]. (member(x, - inter(a1, b)) -> member(x, b)))) - -axiom member_inter2 : - (forall x:'a. - (forall a1:'a set. forall b:'a set [member(x, inter(a1, b))]. ((member(x, - a1) and member(x, b)) -> member(x, inter(a1, b))))) - -axiom union_empty : - (forall a:'a1 set [union(a, (empty : 'a1 set))| union((empty : 'a1 set), - a)]. (union(a, (empty : 'a1 set)) = a)) - -axiom union_empty1 : - (forall a:'a1 set [union(a, (empty : 'a1 set))| union((empty : 'a1 set), - a)]. (union((empty : 'a1 set), a) = a)) - -axiom inter_empty : - (forall a:'a1 set [inter(a, (empty : 'a1 set))| inter((empty : 'a1 set), - a)]. (inter(a, (empty : 'a1 set)) = (empty : 'a1 set))) - -axiom inter_empty1 : - (forall a:'a1 set [inter(a, (empty : 'a1 set))| inter((empty : 'a1 set), - a)]. (inter((empty : 'a1 set), a) = (empty : 'a1 set))) - -axiom member_range : - (forall x:int. forall a:int. forall b:int [member(x, range(a, b))]. - (member(x, range(a, b)) -> (a <= x))) - -axiom member_range1 : - (forall x:int. forall a:int. forall b:int [member(x, range(a, b))]. - (member(x, range(a, b)) -> (x <= b))) - -axiom member_range2 : - (forall x:int. forall a:int. forall b:int [member(x, range(a, b))]. - (((a <= x) and (x <= b)) -> member(x, range(a, b)))) - -axiom member_range_sup : - (forall x:int. forall a:int [member(x, range_sup(a))]. (member(x, - range_sup(a)) -> (a <= x))) - -axiom member_range_sup1 : - (forall x:int. forall a:int [member(x, range_sup(a))]. ((a <= x) -> - member(x, range_sup(a)))) - -axiom member_range_inf : - (forall x:int. forall b:int [member(x, range_inf(b))]. (member(x, - range_inf(b)) -> (x <= b))) - -axiom member_range_inf1 : - (forall x:int. forall b:int [member(x, range_inf(b))]. ((x <= b) -> - member(x, range_inf(b)))) - -axiom member_range_all : - (forall x:int [member(x, range_all)]. member(x, range_all)) - diff --git a/src/plugins/wp/share/ergo/bool.Bool.mlw b/src/plugins/wp/share/ergo/bool.Bool.mlw deleted file mode 100644 index e31c6ffa0dcbc70040a4db98b637938760e52c21..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/bool.Bool.mlw +++ /dev/null @@ -1,27 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -function andb(x: bool, y: bool) : bool = match_bool(x, y, false) - -function orb(x: bool, y: bool) : bool = match_bool(x, true, y) - -function notb(x: bool) : bool = match_bool(x, false, true) - -function xorb(x: bool, y: bool) : bool = match_bool(x, notb(y), y) - -function implb(x: bool, y: bool) : bool = match_bool(x, y, true) - diff --git a/src/plugins/wp/share/ergo/int.Abs.mlw b/src/plugins/wp/share/ergo/int.Abs.mlw deleted file mode 100644 index e03de293a7104e962c3d046e2a4b4c47fb57d572..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/int.Abs.mlw +++ /dev/null @@ -1,35 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -logic abs_int : int -> int - -axiom abs_def : (forall x:int. ((0 <= x) -> (abs_int(x) = x))) - -axiom abs_def1 : (forall x:int. ((not (0 <= x)) -> (abs_int(x) = (-x)))) - -axiom Abs_le : - (forall x:int. forall y:int. ((abs_int(x) <= y) -> ((-y) <= x))) - -axiom Abs_le1 : (forall x:int. forall y:int. ((abs_int(x) <= y) -> (x <= y))) - -axiom Abs_le2 : - (forall x:int. forall y:int. ((((-y) <= x) and (x <= y)) -> - (abs_int(x) <= y))) - -axiom Abs_pos : (forall x:int. (0 <= abs_int(x))) - diff --git a/src/plugins/wp/share/ergo/int.ComputerDivision.mlw b/src/plugins/wp/share/ergo/int.ComputerDivision.mlw deleted file mode 100644 index cc9054d9d97353e3de3697cf7f3421e4eae8c05c..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/int.ComputerDivision.mlw +++ /dev/null @@ -1,49 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory int_Abs_ must be appended to this file*) -logic div : int, int -> int - -logic mod : int, int -> int - -axiom Div_bound : - (forall x:int. forall y:int. (((0 <= x) and (0 < y)) -> (0 <= div(x, y)))) - -axiom Div_bound1 : - (forall x:int. forall y:int. (((0 <= x) and (0 < y)) -> (div(x, y) <= x))) - -axiom Div_1 : (forall x:int. (div(x, 1) = x)) - -axiom Mod_1 : (forall x:int. (mod(x, 1) = 0)) - -axiom Div_inf : - (forall x:int. forall y:int. (((0 <= x) and (x < y)) -> (div(x, y) = 0))) - -axiom Mod_inf : - (forall x:int. forall y:int. (((0 <= x) and (x < y)) -> (mod(x, y) = x))) - -axiom Div_mult : - (forall x:int. forall y:int. forall z:int [div(((x * y) + z), x)]. - (((0 < x) and ((0 <= y) and (0 <= z))) -> (div(((x * y) + z), - x) = (y + div(z, x))))) - -axiom Mod_mult : - (forall x:int. forall y:int. forall z:int [mod(((x * y) + z), x)]. - (((0 < x) and ((0 <= y) and (0 <= z))) -> (mod(((x * y) + z), x) = mod(z, - x)))) - diff --git a/src/plugins/wp/share/ergo/int.ComputerOfEuclideanDivision.mlw b/src/plugins/wp/share/ergo/int.ComputerOfEuclideanDivision.mlw deleted file mode 100644 index 4fca9c6c375416d431f1e8a4491f37f58da2b61f..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/int.ComputerOfEuclideanDivision.mlw +++ /dev/null @@ -1,52 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory int_Abs_ must be appended to this file*) -(** The theory int_ComputerDivision_ must be appended to this file*) - -axiom cdiv_cases : - (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((0 < d) -> (div(n, - d) = (n / d))))) - -axiom cdiv_cases1 : - (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((0 < d) -> (div(n, - d) = (-((-n) / d)))))) - -axiom cdiv_cases2 : - (forall n:int. forall d:int [div(n, d)]. ((0 <= n) -> ((d < 0) -> (div(n, - d) = (-(n / (-d))))))) - -axiom cdiv_cases3 : - (forall n:int. forall d:int [div(n, d)]. ((n <= 0) -> ((d < 0) -> (div(n, - d) = ((-n) / (-d)))))) - -axiom cmod_cases : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((0 < d) -> (mod(n, - d) = (n % d))))) - -axiom cmod_cases1 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((0 < d) -> (mod(n, - d) = (-((-n) % d)))))) - -axiom cmod_cases2 : - (forall n:int. forall d:int [mod(n, d)]. ((0 <= n) -> ((d < 0) -> (mod(n, - d) = (n % (-d)))))) - -axiom cmod_cases3 : - (forall n:int. forall d:int [mod(n, d)]. ((n <= 0) -> ((d < 0) -> (mod(n, - d) = (-((-n) % (-d))))))) diff --git a/src/plugins/wp/share/ergo/int.Int.mlw b/src/plugins/wp/share/ergo/int.Int.mlw deleted file mode 100644 index 703c83034f641fe81a193048411fb921648182a2..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/int.Int.mlw +++ /dev/null @@ -1,18 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(* this is a prelude for Alt-Ergo integer arithmetic *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) diff --git a/src/plugins/wp/share/ergo/int.MinMax.mlw b/src/plugins/wp/share/ergo/int.MinMax.mlw deleted file mode 100644 index 5bbc63f78125e8a2f8ae673961a740e801b59582..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/int.MinMax.mlw +++ /dev/null @@ -1,52 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -logic min_int : int, int -> int - -axiom min_def : - (forall x:int. forall y:int. ((x <= y) -> (min_int(x, y) = x))) - -axiom min_def1 : - (forall x:int. forall y:int. ((not (x <= y)) -> (min_int(x, y) = y))) - -logic max_int : int, int -> int - -axiom max_def : - (forall x:int. forall y:int. ((x <= y) -> (max_int(x, y) = y))) - -axiom max_def1 : - (forall x:int. forall y:int. ((not (x <= y)) -> (max_int(x, y) = x))) - -axiom Min_r : (forall x:int. forall y:int. ((y <= x) -> (min_int(x, y) = y))) - -axiom Max_l : (forall x:int. forall y:int. ((y <= x) -> (max_int(x, y) = x))) - -axiom Min_comm : - (forall x:int. forall y:int. (min_int(x, y) = min_int(y, x))) - -axiom Max_comm : - (forall x:int. forall y:int. (max_int(x, y) = max_int(y, x))) - -axiom Min_assoc : - (forall x:int. forall y:int. forall z:int. (min_int(min_int(x, y), - z) = min_int(x, min_int(y, z)))) - -axiom Max_assoc : - (forall x:int. forall y:int. forall z:int. (max_int(max_int(x, y), - z) = max_int(x, max_int(y, z)))) - diff --git a/src/plugins/wp/share/ergo/map.Const.mlw b/src/plugins/wp/share/ergo/map.Const.mlw deleted file mode 100644 index d93ab7e64681b8c8ccecb007ee96567b4b4cec5c..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/map.Const.mlw +++ /dev/null @@ -1,23 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory map_Map_ must be appended to this file*) -logic const : 'b -> ('a,'b) farray - -axiom const_def : - (forall v:'b. forall us:'a. (((const(v) : ('a,'b) farray)[us]) = v)) - diff --git a/src/plugins/wp/share/ergo/map.Map.mlw b/src/plugins/wp/share/ergo/map.Map.mlw deleted file mode 100644 index ddb3b00ec7e09e5b1bafa89f4421e2a37b6ee0ec..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/map.Map.mlw +++ /dev/null @@ -1,17 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) diff --git a/src/plugins/wp/share/ergo/real.Abs.mlw b/src/plugins/wp/share/ergo/real.Abs.mlw deleted file mode 100644 index 1340bfad895cf643a707f95e455b6a88b6fd81a2..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.Abs.mlw +++ /dev/null @@ -1,48 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -logic abs_real : real -> real - -axiom abs_def : (forall x:real. ((0.0 <= x) -> (abs_real(x) = x))) - -axiom abs_def1 : (forall x:real. ((not (0.0 <= x)) -> (abs_real(x) = (-x)))) - -axiom Abs_le : - (forall x:real. forall y:real. ((abs_real(x) <= y) -> ((-y) <= x))) - -axiom Abs_le1 : - (forall x:real. forall y:real. ((abs_real(x) <= y) -> (x <= y))) - -axiom Abs_le2 : - (forall x:real. forall y:real. ((((-y) <= x) and (x <= y)) -> - (abs_real(x) <= y))) - -axiom Abs_pos : (forall x:real. (0.0 <= abs_real(x))) - -axiom Abs_sum : - (forall x:real. forall y:real. - (abs_real((x + y)) <= (abs_real(x) + abs_real(y)))) - -axiom Abs_prod : - (forall x:real. forall y:real. - (abs_real((x * y)) = (abs_real(x) * abs_real(y)))) - -axiom triangular_inequality : - (forall x:real. forall y:real. forall z:real. - (abs_real((x - z)) <= (abs_real((x - y)) + abs_real((y - z))))) - diff --git a/src/plugins/wp/share/ergo/real.ExpLog.mlw b/src/plugins/wp/share/ergo/real.ExpLog.mlw deleted file mode 100644 index a600122dfd8185e26c6f1dba6dddfa3decfdb20b..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.ExpLog.mlw +++ /dev/null @@ -1,41 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -logic exp : real -> real - -axiom Exp_zero : (exp(0.0) = 1.0) - -axiom Exp_sum : - (forall x:real. forall y:real. (exp((x + y)) = (exp(x) * exp(y)))) - -logic log : real -> real - -axiom Log_one : (log(1.0) = 0.0) - -axiom Log_mul : - (forall x:real. forall y:real. (((0.0 < x) and (0.0 < y)) -> - (log((x * y)) = (log(x) + log(y))))) - -axiom Log_exp : (forall x:real. (log(exp(x)) = x)) - -axiom Exp_log : (forall x:real. ((0.0 < x) -> (exp(log(x)) = x))) - -function log2(x: real) : real = (log(x) / log(2.0)) - -function log10(x: real) : real = (log(x) / log(10.0)) - diff --git a/src/plugins/wp/share/ergo/real.FromInt.mlw b/src/plugins/wp/share/ergo/real.FromInt.mlw deleted file mode 100644 index a1f51341456db10cded4ea61739f8905b0a7722d..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.FromInt.mlw +++ /dev/null @@ -1,45 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -logic from_int : int -> real - -axiom Zero : (from_int(0) = 0.0) - -axiom One : (from_int(1) = 1.0) - -axiom Add : - (forall x:int. forall y:int. - (from_int((x + y)) = (from_int(x) + from_int(y)))) - -axiom Sub : - (forall x:int. forall y:int. - (from_int((x - y)) = (from_int(x) - from_int(y)))) - -axiom Mul : - (forall x:int. forall y:int. - (from_int((x * y)) = (from_int(x) * from_int(y)))) - -axiom Neg : (forall x:int. (from_int((-x)) = (-from_int(x)))) - -axiom Injective : - (forall x:int. forall y:int. ((from_int(x) = from_int(y)) -> (x = y))) - -axiom Monotonic : - (forall x:int. forall y:int. ((x <= y) -> (from_int(x) <= from_int(y)))) - diff --git a/src/plugins/wp/share/ergo/real.Hyperbolic.mlw b/src/plugins/wp/share/ergo/real.Hyperbolic.mlw deleted file mode 100644 index 14a08dae73f575e56497771f23b865f90a5a7dfe..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.Hyperbolic.mlw +++ /dev/null @@ -1,40 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_Square_ must be appended to this file*) -(** The theory real_ExpLog_ must be appended to this file*) -function sinh(x: real) : real = (0.5 * (exp(x) - exp((-x)))) - -function cosh(x: real) : real = (0.5 * (exp(x) + exp((-x)))) - -function tanh(x: real) : real = (sinh(x) / cosh(x)) - -function asinh(x: real) : real = log((x + sqrt((sqr(x) + 1.0)))) - -logic acosh : real -> real - -axiom Acosh_def : - (forall x:real. ((1.0 <= x) -> - (acosh(x) = log((x + sqrt((sqr(x) - 1.0))))))) - -logic atanh : real -> real - -axiom Atanh_def : - (forall x:real. ((((- 1.0) < x) and (x < 1.0)) -> - (atanh(x) = (0.5 * log(((1.0 + x) / (1.0 - x))))))) - diff --git a/src/plugins/wp/share/ergo/real.MinMax.mlw b/src/plugins/wp/share/ergo/real.MinMax.mlw deleted file mode 100644 index d1438d67fd2d8b51cba1a8b2f74db3b65b34ec99..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.MinMax.mlw +++ /dev/null @@ -1,54 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -logic min_real : real, real -> real - -axiom min_def : - (forall x:real. forall y:real. ((x <= y) -> (min_real(x, y) = x))) - -axiom min_def1 : - (forall x:real. forall y:real. ((not (x <= y)) -> (min_real(x, y) = y))) - -logic max_real : real, real -> real - -axiom max_def : - (forall x:real. forall y:real. ((x <= y) -> (max_real(x, y) = y))) - -axiom max_def1 : - (forall x:real. forall y:real. ((not (x <= y)) -> (max_real(x, y) = x))) - -axiom Min_r : - (forall x:real. forall y:real. ((y <= x) -> (min_real(x, y) = y))) - -axiom Max_l : - (forall x:real. forall y:real. ((y <= x) -> (max_real(x, y) = x))) - -axiom Min_comm : - (forall x:real. forall y:real. (min_real(x, y) = min_real(y, x))) - -axiom Max_comm : - (forall x:real. forall y:real. (max_real(x, y) = max_real(y, x))) - -axiom Min_assoc : - (forall x:real. forall y:real. forall z:real. (min_real(min_real(x, y), - z) = min_real(x, min_real(y, z)))) - -axiom Max_assoc : - (forall x:real. forall y:real. forall z:real. (max_real(max_real(x, y), - z) = max_real(x, max_real(y, z)))) - diff --git a/src/plugins/wp/share/ergo/real.Polar.mlw b/src/plugins/wp/share/ergo/real.Polar.mlw deleted file mode 100644 index 4c953665ad72a84b9b036919327f73bd00a52a2a..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.Polar.mlw +++ /dev/null @@ -1,31 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_Abs_ must be appended to this file*) -(** The theory real_Square_ must be appended to this file*) -(** The theory real_Trigonometry_ must be appended to this file*) -function hypot(x: real, y: real) : real = sqrt((sqr(x) + sqr(y))) - -logic atan2 : real, real -> real - -axiom X_from_polar : - (forall x:real. forall y:real. (x = (hypot(x, y) * cos(atan2(y, x))))) - -axiom Y_from_polar : - (forall x:real. forall y:real. (y = (hypot(x, y) * sin(atan2(y, x))))) - diff --git a/src/plugins/wp/share/ergo/real.PowerReal.mlw b/src/plugins/wp/share/ergo/real.PowerReal.mlw deleted file mode 100644 index 140f336820ee45ac74e03671b18c21d22d4c23c3..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.PowerReal.mlw +++ /dev/null @@ -1,50 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory int_Exponentiation_ must be appended to this file*) -(** The theory int_Power_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_FromInt_ must be appended to this file*) -(** The theory real_Square_ must be appended to this file*) -(** The theory real_ExpLog_ must be appended to this file*) -logic pow : real, real -> real - -axiom Pow_def : - (forall x:real. forall y:real. ((0.0 < x) -> (pow(x, - y) = exp((y * log(x)))))) - -axiom Pow_pos : - (forall x:real. forall y:real. ((0.0 < x) -> (0.0 < pow(x, y)))) - -axiom Pow_plus : - (forall x:real. forall y:real. forall z:real. ((0.0 < z) -> (pow(z, - (x + y)) = (pow(z, x) * pow(z, y))))) - -axiom Pow_mult : - (forall x:real. forall y:real. forall z:real. ((0.0 < x) -> (pow(pow(x, - y), z) = pow(x, (y * z))))) - -axiom Pow_x_zero : (forall x:real. ((0.0 < x) -> (pow(x, 0.0) = 1.0))) - -axiom Pow_x_one : (forall x:real. ((0.0 < x) -> (pow(x, 1.0) = x))) - -axiom Pow_one_y : (forall y:real. (pow(1.0, y) = 1.0)) - -axiom Pow_x_two : (forall x:real. ((0.0 < x) -> (pow(x, 2.0) = sqr(x)))) - -axiom Pow_half : (forall x:real. ((0.0 < x) -> (pow(x, 0.5) = sqrt(x)))) diff --git a/src/plugins/wp/share/ergo/real.Real.mlw b/src/plugins/wp/share/ergo/real.Real.mlw deleted file mode 100644 index db80917b1b0b39d54729ec9c3b07a8bbf451311c..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.Real.mlw +++ /dev/null @@ -1,42 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(* this is a prelude for Alt-Ergo real arithmetic *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -axiom add_div : - (forall x:real. forall y:real. forall z:real. ((not (z = 0.0)) -> - (((x + y) / z) = ((x / z) + (y / z))))) - -axiom sub_div : - (forall x:real. forall y:real. forall z:real. ((not (z = 0.0)) -> - (((x - y) / z) = ((x / z) - (y / z))))) - -axiom neg_div : - (forall x:real. forall y:real. ((not (y = 0.0)) -> - (((-x) / y) = (-(x / y))))) - -axiom assoc_mul_div : - (forall x:real. forall y:real. forall z:real. ((not (z = 0.0)) -> - (((x * y) / z) = (x * (y / z))))) - -axiom assoc_div_mul : - (forall x:real. forall y:real. forall z:real. (((not (y = 0.0)) and - (not (z = 0.0))) -> (((x / y) / z) = (x / (y * z))))) - -axiom assoc_div_div : - (forall x:real. forall y:real. forall z:real. (((not (y = 0.0)) and - (not (z = 0.0))) -> ((x / (y / z)) = ((x * z) / y)))) - diff --git a/src/plugins/wp/share/ergo/real.RealInfix.mlw b/src/plugins/wp/share/ergo/real.RealInfix.mlw deleted file mode 100644 index 5134839728aff4c170354cdb4d709da7418a7bcf..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.RealInfix.mlw +++ /dev/null @@ -1,18 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) diff --git a/src/plugins/wp/share/ergo/real.Square.mlw b/src/plugins/wp/share/ergo/real.Square.mlw deleted file mode 100644 index 4eaec010938bcd45adf0fd9894486a36232fcaf9..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.Square.mlw +++ /dev/null @@ -1,36 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -function sqr(x: real) : real = (x * x) - -logic sqrt : real -> real - -axiom Sqrt_positive : (forall x:real. ((0.0 <= x) -> (0.0 <= sqrt(x)))) - -axiom Sqrt_square : (forall x:real. ((0.0 <= x) -> (sqr(sqrt(x)) = x))) - -axiom Square_sqrt : (forall x:real. ((0.0 <= x) -> (sqrt((x * x)) = x))) - -axiom Sqrt_mul : - (forall x:real. forall y:real. (((0.0 <= x) and (0.0 <= y)) -> - (sqrt((x * y)) = (sqrt(x) * sqrt(y))))) - -axiom Sqrt_le : - (forall x:real. forall y:real. (((0.0 <= x) and (x <= y)) -> - (sqrt(x) <= sqrt(y)))) - diff --git a/src/plugins/wp/share/ergo/real.Trigonometry.mlw b/src/plugins/wp/share/ergo/real.Trigonometry.mlw deleted file mode 100644 index 93f357ea6d89eb3cbfb00f057cdcc200f5071c16..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.Trigonometry.mlw +++ /dev/null @@ -1,75 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_Abs_ must be appended to this file*) -(** The theory real_Square_ must be appended to this file*) -logic cos : real -> real - -logic sin : real -> real - -axiom Pythagorean_identity : - (forall x:real. ((sqr(cos(x)) + sqr(sin(x))) = 1.0)) - -axiom Cos_le_one : (forall x:real. (abs_real(cos(x)) <= 1.0)) - -axiom Sin_le_one : (forall x:real. (abs_real(sin(x)) <= 1.0)) - -axiom Cos_0 : (cos(0.0) = 1.0) - -axiom Sin_0 : (sin(0.0) = 0.0) - -logic pi : real - -axiom Pi_double_precision_bounds : (0x1.921fb54442d18p1 < pi) - -axiom Pi_double_precision_bounds1 : (pi < 0x1.921fb54442d19p1) - -axiom Cos_pi : (cos(pi) = (- 1.0)) - -axiom Sin_pi : (sin(pi) = 0.0) - -axiom Cos_pi2 : (cos((0.5 * pi)) = 0.0) - -axiom Sin_pi2 : (sin((0.5 * pi)) = 1.0) - -axiom Cos_plus_pi : (forall x:real. (cos((x + pi)) = (-cos(x)))) - -axiom Sin_plus_pi : (forall x:real. (sin((x + pi)) = (-sin(x)))) - -axiom Cos_plus_pi2 : (forall x:real. (cos((x + (0.5 * pi))) = (-sin(x)))) - -axiom Sin_plus_pi2 : (forall x:real. (sin((x + (0.5 * pi))) = cos(x))) - -axiom Cos_neg : (forall x:real. (cos((-x)) = cos(x))) - -axiom Sin_neg : (forall x:real. (sin((-x)) = (-sin(x)))) - -axiom Cos_sum : - (forall x:real. forall y:real. - (cos((x + y)) = ((cos(x) * cos(y)) - (sin(x) * sin(y))))) - -axiom Sin_sum : - (forall x:real. forall y:real. - (sin((x + y)) = ((sin(x) * cos(y)) + (cos(x) * sin(y))))) - -function tan(x: real) : real = (sin(x) / cos(x)) - -logic atan : real -> real - -axiom Tan_atan : (forall x:real. (tan(atan(x)) = x)) - diff --git a/src/plugins/wp/share/ergo/real.Truncate.mlw b/src/plugins/wp/share/ergo/real.Truncate.mlw deleted file mode 100644 index f86ba0df6fb6717d8d4f9ab7d7182db95c9af023..0000000000000000000000000000000000000000 --- a/src/plugins/wp/share/ergo/real.Truncate.mlw +++ /dev/null @@ -1,73 +0,0 @@ -(**************************************************************************) -(* *) -(* The Why3 Verification Platform / The Why3 Development Team *) -(* Copyright 2010-2019 -- Inria - CNRS - Paris-Sud University *) -(* *) -(* This software is distributed under the terms of the GNU Lesser *) -(* General Public License version 2.1, with the special exception *) -(* on linking described in file LICENSE. *) -(* *) -(* File modified by CEA (Commissariat à l'énergie atomique et aux *) -(* énergies alternatives). *) -(* *) -(**************************************************************************) - -(* this is the prelude for Alt-Ergo, version >= 0.95.2 *) -(** The theory BuiltIn_ must be appended to this file*) -(** The theory Bool_ must be appended to this file*) -(** The theory int_Int_ must be appended to this file*) -(** The theory real_Real_ must be appended to this file*) -(** The theory real_FromInt_ must be appended to this file*) -logic truncate : real -> int - -axiom Truncate_int : (forall i:int. (truncate(from_int(i)) = i)) - -axiom Truncate_down_pos : - (forall x:real. ((0.0 <= x) -> (from_int(truncate(x)) <= x))) - -axiom Truncate_down_pos1 : - (forall x:real. ((0.0 <= x) -> (x < from_int((truncate(x) + 1))))) - -axiom Truncate_up_neg : - (forall x:real. ((x <= 0.0) -> (from_int((truncate(x) - 1)) < x))) - -axiom Truncate_up_neg1 : - (forall x:real. ((x <= 0.0) -> (x <= from_int(truncate(x))))) - -axiom Real_of_truncate : - (forall x:real. ((x - 1.0) <= from_int(truncate(x)))) - -axiom Real_of_truncate1 : - (forall x:real. (from_int(truncate(x)) <= (x + 1.0))) - -axiom Truncate_monotonic : - (forall x:real. forall y:real. ((x <= y) -> (truncate(x) <= truncate(y)))) - -axiom Truncate_monotonic_int1 : - (forall x:real. forall i:int. ((x <= from_int(i)) -> (truncate(x) <= i))) - -axiom Truncate_monotonic_int2 : - (forall x:real. forall i:int. ((from_int(i) <= x) -> (i <= truncate(x)))) - -logic floor : real -> int - -logic ceil : real -> int - -axiom Floor_int : (forall i:int. (floor(from_int(i)) = i)) - -axiom Ceil_int : (forall i:int. (ceil(from_int(i)) = i)) - -axiom Floor_down : (forall x:real. (from_int(floor(x)) <= x)) - -axiom Floor_down1 : (forall x:real. (x < from_int((floor(x) + 1)))) - -axiom Ceil_up : (forall x:real. (from_int((ceil(x) - 1)) < x)) - -axiom Ceil_up1 : (forall x:real. (x <= from_int(ceil(x)))) - -axiom Floor_monotonic : - (forall x:real. forall y:real. ((x <= y) -> (floor(x) <= floor(y)))) - -axiom Ceil_monotonic : - (forall x:real. forall y:real. ((x <= y) -> (ceil(x) <= ceil(y)))) - diff --git a/src/plugins/wp/share/wp.driver b/src/plugins/wp/share/wp.driver index 8024f1f67fbb52a95c4094437906301afe8119ef..92fcd8039c8d53ea7bff2188cad2a46b63075dc5 100644 --- a/src/plugins/wp/share/wp.driver +++ b/src/plugins/wp/share/wp.driver @@ -21,81 +21,40 @@ /**************************************************************************/ library qed: -coq.file += "coqwp/BuiltIn.v"; -coq.file += "coqwp:bool/Bool.v"; -coq.file += "coqwp/HighOrd.v"; -coq.file += "coqwp:int/Int.v"; -coq.file += "coqwp:int/Abs.v"; -coq.file += "coqwp:int/ComputerDivision.v"; -coq.file += "coqwp:int/EuclideanDivision.v"; -coq.file += "coqwp:int/ComputerOfEuclideanDivision.v"; -coq.file += "coqwp:real/Real.v"; -coq.file += "coqwp:real/RealInfix.v"; -coq.file += "coqwp:real/FromInt.v"; -coq.file += "coqwp:map/Map.v"; -coq.file += "coqwp:bool/Bool.v"; -coq.file += "coqwp/Qedlib.v"; -coq.file += "coqwp/Qed.v"; why3.import += "int.Abs:IAbs"; why3.import += "frama_c_wp.qed.Qed"; why3.qualifier := "frama_c_wp.qed"; -altergo.file += "ergo/int.Int.mlw"; -altergo.file += "ergo/int.Abs.mlw"; -altergo.file += "ergo/int.ComputerDivision.mlw"; -altergo.file += "ergo/int.ComputerOfEuclideanDivision.mlw"; -altergo.file += "ergo/real.Real.mlw"; -altergo.file += "ergo/real.RealInfix.mlw"; -altergo.file += "ergo/real.FromInt.mlw"; -altergo.file += "ergo/Qed.mlw"; library const: -coq.file += "coqwp:map/Const.v"; why3.import += "map.Const"; -altergo.file += "ergo/map.Const.mlw"; - -library bool: -altergo.file += "ergo/bool.Bool.mlw"; library minmax_int: -coq.file += "coqwp:int/MinMax.v"; -altergo.file += "ergo/int.MinMax.mlw"; why3.import += "int.MinMax:Ig"; logic integer "\\max"(integer,integer) = commutative:associative:idempotent: - {coq="Zmax";altergo="max_int";why3="Ig.max"}; + {why3="Ig.max"}; logic integer "\\min"(integer,integer) = commutative:associative:idempotent: - {coq="Zmin";altergo="min_int";why3="Ig.min"}; + {why3="Ig.min"}; library minmax_real: -coq.file += "coqwp:real/MinMax.v"; -altergo.file += "ergo/real.MinMax.mlw"; why3.import += "real.MinMax:Rg"; logic real "\\max"(real,real) = commutative:associative:idempotent: - {coq="Rmax";altergo="max_real";why3="Rg.max"}; + {why3="Rg.max"}; logic real "\\min"(real,real) = commutative:associative:idempotent: - {coq="Rmin";altergo="min_real";why3="Rg.min"}; + {why3="Rg.min"}; library cint: -coq.file += "coqwp/Bits.v"; -coq.file += "coqwp/Zbits.v"; -coq.file += "coqwp/Cint.v"; why3.import += "frama_c_wp.cint.Cint"; -altergo.file += "ergo/Cint.mlw"; library cbits: cint logic boolean "bit_test"(integer,integer) := \bit_test_stdlib; -coq.file += "coqwp/Cbits.v"; -altergo.file += "ergo/Cbits.mlw"; why3.import += "frama_c_wp.cbits.Cbits"; library cfloat: cmath sqrt -coq.file += "coqwp:real/Abs.v"; -coq.file += "coqwp/Cfloat.v"; why3.import += "frama_c_wp.cfloat.Cfloat"; -altergo.file += "ergo/Cfloat.mlw"; type "rounding_mode" = "Rounding.mode"; ctor "\\Up"() = "Rounding.RTP"; ctor "\\Down"() = "Rounding.RTN"; @@ -117,69 +76,40 @@ logic float64 "\\round_double"(rounding_mode,real) = "round_double"; library vset: type set = "set"; -coq.file := "coqwp/Vset.v"; why3.import := "vset.Vset"; -altergo.file := "ergo/Vset.mlw"; library vlist: -coq.file := "coqwp/Vlist.v"; why3.import := "frama_c_wp.vlist.Vlist"; -altergo.file := "ergo/Vlist.mlw"; library memory: -coq.file := "coqwp/Memory.v"; why3.import := "frama_c_wp.memory.Memory"; -altergo.file := "ergo/Memory.mlw"; library sqrt: cmath why3.import += "real.Square"; -coq.file += "coqwp/Square.v"; why3.import += "frama_c_wp.cmath.Square"; -altergo.file += "ergo/real.Square.mlw"; -altergo.file += "ergo/Square.mlw"; library exponential: qed why3.import += "real.ExpLog" ; why3.import += "frama_c_wp.cmath.ExpLog" ; -coq.file += "coqwp:real/ExpLog.v" ; -coq.file += "coqwp/Exp.v" ; -altergo.file += "ergo/real.ExpLog.mlw" ; -altergo.file += "ergo/ExpLog.mlw" ; library power: exponential sqrt why3.import += "real.PowerReal" ; -coq.file += "coqwp:int/Exponentiation.v" ; -coq.file += "coqwp:int/Power.v" ; -coq.file += "coqwp:real/PowerReal.v" ; -altergo.file += "ergo/real.PowerReal.mlw" ; library truncate: qed why3.import += "real.Truncate" ; -altergo.file += "ergo/real.Truncate.mlw" ; library cmath: qed why3.import += "real.Abs:RAbs" ; why3.import += "frama_c_wp.cmath.Cmath"; -coq.file += "coqwp:real/Abs.v" ; -coq.file += "coqwp:real/Square.v"; -coq.file += "coqwp/Cmath.v"; -altergo.file += "ergo/real.Abs.mlw" ; -altergo.file += "ergo/Cmath.mlw"; library trigonometry: sqrt cmath why3.import += "real.Trigonometry"; -coq.file += "coqwp:real/Trigonometry.v"; -altergo.file += "ergo/real.Trigonometry.mlw"; library arctrigo: trigonometry why3.import += "frama_c_wp.cmath.ArcTrigo"; -coq.file += "coqwp/ArcTrigo.v"; -altergo.file += "ergo/ArcTrigo.mlw"; library hyperbolic: sqrt exponential why3.import += "real.Hyperbolic"; -altergo.file += "ergo/real.Hyperbolic.mlw"; library polar: sqrt trigonometry why3.import += "real.Polar"; -altergo.file += "ergo/real.Polar.mlw"; diff --git a/src/plugins/wp/tests/test_config_qualif b/src/plugins/wp/tests/test_config_qualif index e92f71e312cedfa7a4d3d316991f7904c32d185d..395f0c6f754e0898ef3c7c570de157da9e5c3b4f 100644 --- a/src/plugins/wp/tests/test_config_qualif +++ b/src/plugins/wp/tests/test_config_qualif @@ -1,3 +1,3 @@ PLUGIN: wp -CMD: @frama-c@ -wp -wp-par 1 -wp-share @PTEST_SHARE_DIR@ -wp-msg-key shell -wp-warn-key pedantic-assigns=inactive -wp-report @PTEST_SUITE_DIR@/../qualif.report -wp-session @PTEST_SUITE_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.session -wp-cache-env -wp-cache replay @PTEST_FILE@ -wp-coq-timeout 120 +CMD: @frama-c@ -wp -wp-par 1 -wp-share @PTEST_SHARE_DIR@ -wp-msg-key shell -wp-warn-key pedantic-assigns=inactive -wp-report @PTEST_SUITE_DIR@/../qualif.report -wp-session @PTEST_SUITE_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.session -wp-cache-env -wp-cache replay @PTEST_FILE@ OPT: diff --git a/src/plugins/wp/tests/wp_acsl/chunk_typing_usable.i b/src/plugins/wp/tests/wp_acsl/chunk_typing_usable.i index 7f41b168b082e3d19f3540484cd7557b03a9c276..3f4b3a0a572362e7f43dfd91cd9ab2f354642fc1 100644 --- a/src/plugins/wp/tests/wp_acsl/chunk_typing_usable.i +++ b/src/plugins/wp/tests/wp_acsl/chunk_typing_usable.i @@ -2,7 +2,7 @@ OPT: -wp-gen -wp-rte -wp-prover why3 -wp-msg-key print-generated */ /* run.config_qualif - OPT: -wp-rte -wp-coq-script %{dep:@PTEST_DIR@/chunk_typing_usable.script} -wp-prover alt-ergo,native:coq + OPT: -wp-rte -wp-prover alt-ergo */ /*@ diff --git a/src/plugins/wp/tests/wp_acsl/chunk_typing_usable.script b/src/plugins/wp/tests/wp_acsl/chunk_typing_usable.script deleted file mode 100644 index 7e86db5b5e787c3126afb74e22e641ba12b9c35c..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_acsl/chunk_typing_usable.script +++ /dev/null @@ -1,37 +0,0 @@ -(* Generated by Frama-C WP *) - -Goal typed_lemma_provable_lemma. -Hint property,provable_lemma. -Proof. - Import Compound. - - Ltac norm := repeat(match goal with - | [ _ : _ |- context [ (?i + 1 - 1)%Z ]] => replace (i + 1 - 1)%Z with i by omega - | [ _ : _ |- context [ (0 + ?i)%Z ]] => replace (0 + i)%Z with i by omega - | [ _ : _ |- context [ (?i + 0)%Z ]] => replace (i + 0)%Z with i by omega - end). - intros e from cut to. - generalize dependent cut. - induction to using Z_induction with (m := from) ; intros cut mem page Hct Hfc Hm He. - * repeat(rewrite A_Occ.Q_empty ; auto ; try omega). - * assert(EqNeq: { mem.[ (shift_sint32 page to) ] = e } + { mem.[ (shift_sint32 page to) ] <> e }) by - repeat(decide equality). - assert(Cut: (cut < to + 1 \/ cut = to + 1)%Z ) by omega ; inversion Cut as [ Inf | Eq ]. - + inversion_clear EqNeq as [ Eq | Neq ]. - - rewrite <- Eq. - replace (mem .[ shift_sint32 page to]) with (mem .[ shift_sint32 page (to + 1 - 1)]) by (norm ; auto). - rewrite <- A_Occ.Q_is with (i := (to+1)%Z) ; - [ rewrite <- A_Occ.Q_is with (i := (to+1)%Z) | | | | |] ; - norm ; try rewrite Eq ; auto ; try omega. - assert(Simpl: forall x y z : Z, (x + y = z)%Z -> (1 + x + y = 1 + z)%Z) by (intros ; omega). - apply Simpl. - apply IHto ; auto ; omega. - - rewrite <- A_Occ.Q_isnt with (i := (to+1)%Z) ; - [ rewrite <- A_Occ.Q_isnt with (i := (to+1)%Z) | | | | |] ; - norm ; auto ; try omega. - apply IHto ; auto ; omega. - + rewrite Eq. - rewrite A_Occ.Q_empty ; auto ; try omega. -Qed. - - diff --git a/src/plugins/wp/tests/wp_acsl/classify_float.c b/src/plugins/wp/tests/wp_acsl/classify_float.c index 8c4932391e6248f70ca55fb5d29ae2b59cb0d332..dd45b597a3fee283dab0d234f794f6a8ba3cc867 100644 --- a/src/plugins/wp/tests/wp_acsl/classify_float.c +++ b/src/plugins/wp/tests/wp_acsl/classify_float.c @@ -1,7 +1,5 @@ /* run.config_qualif OPT: -wp-prover alt-ergo - OPT: -wp-prover native:alt-ergo - OPT: -wp-prover native:coq -wp-coq-script %{dep:@PTEST_DIR@/classify_float.script} OPT: -wp-model real */ diff --git a/src/plugins/wp/tests/wp_acsl/classify_float.script b/src/plugins/wp/tests/wp_acsl/classify_float.script deleted file mode 100644 index 0b2ca5d38ec8c0ff75950cbbd9cf6debdf566330..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_acsl/classify_float.script +++ /dev/null @@ -1,25 +0,0 @@ -(* Generated by Frama-C WP *) - -Goal typed_lemma_InfN_not_finite. -Hint InfN_not_finite,property. -Proof. -(* auto with zarith. *) -admit. -Admitted. - -Goal typed_lemma_InfP_not_finite. -Hint InfP_not_finite,property. -Proof. -(* auto with zarith. *) -admit. -Admitted. - -Goal typed_lemma_NaN_not_finite. -Hint NaN_not_finite,property. -Proof. -(* auto with zarith. *) -admit. -Admitted. - - - diff --git a/src/plugins/wp/tests/wp_acsl/oracle_qualif/chunk_typing_usable.res.oracle b/src/plugins/wp/tests/wp_acsl/oracle_qualif/chunk_typing_usable.res.oracle index 2c656c6f82589428c5d92e8c4a8f3218879fc66a..5569268205364aef072e778f13495cf836d3c0b8 100644 --- a/src/plugins/wp/tests/wp_acsl/oracle_qualif/chunk_typing_usable.res.oracle +++ b/src/plugins/wp/tests/wp_acsl/oracle_qualif/chunk_typing_usable.res.oracle @@ -3,19 +3,16 @@ [wp] Running WP plugin... [rte:annot] annotating function usable_axiom [rte:annot] annotating function usable_lemma -[wp] Warning: native support for coq is deprecated, use tip instead [wp] 3 goals scheduled -[wp] [Coq] Goal typed_lemma_provable_lemma : Saved script -[wp] [Coq (native)] Goal typed_lemma_provable_lemma : Valid +[wp] [Alt-Ergo] Goal typed_lemma_provable_lemma : Unsuccess [wp] [Alt-Ergo] Goal typed_usable_axiom_ensures : Valid [wp] [Alt-Ergo] Goal typed_usable_lemma_ensures : Valid -[wp] Proved goals: 3 / 3 +[wp] Proved goals: 2 / 3 Qed: 0 - Coq (native): 1 Alt-Ergo: 2 (unsuccess: 1) ------------------------------------------------------------ Axiomatics WP Alt-Ergo Total Success - Lemma - - 1 100% + Lemma - - 1 0.0% ------------------------------------------------------------ Functions WP Alt-Ergo Total Success usable_axiom - 1 1 100% diff --git a/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.res.oracle b/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.res.oracle index efbf0e0a5e995775beccb153f9ac586f1301faaf..d56892bed73e2320f69ba98f7d23a947f7420d22 100644 --- a/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.res.oracle +++ b/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.1.res.oracle @@ -1,15 +1,13 @@ -# frama-c -wp [...] +# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing classify_float.c (with preprocessing) [wp] Running WP plugin... -[wp] Warning: native support for alt-ergo is deprecated, use why3 instead [wp] 3 goals scheduled -[wp] [Alt-Ergo (native)] Goal typed_lemma_InfN_not_finite : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_InfP_not_finite : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_NaN_not_finite : Valid +[wp] [Qed] Goal typed_real_lemma_InfN_not_finite : Valid +[wp] [Qed] Goal typed_real_lemma_InfP_not_finite : Valid +[wp] [Qed] Goal typed_real_lemma_NaN_not_finite : Valid [wp] Proved goals: 3 / 3 - Qed: 0 - Alt-Ergo (native): 3 + Qed: 3 ------------------------------------------------------------ Axiomatics WP Alt-Ergo Total Success - Lemma - - 3 100% + Lemma 3 - 3 100% ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.2.res.oracle b/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.2.res.oracle index 8d89bf6103e89d700c551ea565d3cd4a814e3d35..d56892bed73e2320f69ba98f7d23a947f7420d22 100644 --- a/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.2.res.oracle +++ b/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.2.res.oracle @@ -1,18 +1,13 @@ -# frama-c -wp [...] +# frama-c -wp -wp-model 'Typed (Real)' [...] [kernel] Parsing classify_float.c (with preprocessing) [wp] Running WP plugin... -[wp] Warning: native support for coq is deprecated, use tip instead [wp] 3 goals scheduled -[wp] [Coq] Goal typed_lemma_InfN_not_finite : Saved script -[wp] [Coq (native)] Goal typed_lemma_InfN_not_finite : Valid -[wp] [Coq] Goal typed_lemma_InfP_not_finite : Saved script -[wp] [Coq (native)] Goal typed_lemma_InfP_not_finite : Valid -[wp] [Coq] Goal typed_lemma_NaN_not_finite : Saved script -[wp] [Coq (native)] Goal typed_lemma_NaN_not_finite : Valid +[wp] [Qed] Goal typed_real_lemma_InfN_not_finite : Valid +[wp] [Qed] Goal typed_real_lemma_InfP_not_finite : Valid +[wp] [Qed] Goal typed_real_lemma_NaN_not_finite : Valid [wp] Proved goals: 3 / 3 - Qed: 0 - Coq (native): 3 + Qed: 3 ------------------------------------------------------------ Axiomatics WP Alt-Ergo Total Success - Lemma - - 3 100% + Lemma 3 - 3 100% ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.3.res.oracle b/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.3.res.oracle deleted file mode 100644 index d56892bed73e2320f69ba98f7d23a947f7420d22..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_acsl/oracle_qualif/classify_float.3.res.oracle +++ /dev/null @@ -1,13 +0,0 @@ -# frama-c -wp -wp-model 'Typed (Real)' [...] -[kernel] Parsing classify_float.c (with preprocessing) -[wp] Running WP plugin... -[wp] 3 goals scheduled -[wp] [Qed] Goal typed_real_lemma_InfN_not_finite : Valid -[wp] [Qed] Goal typed_real_lemma_InfP_not_finite : Valid -[wp] [Qed] Goal typed_real_lemma_NaN_not_finite : Valid -[wp] Proved goals: 3 / 3 - Qed: 3 ------------------------------------------------------------- - Axiomatics WP Alt-Ergo Total Success - Lemma 3 - 3 100% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.res.oracle b/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.res.oracle index 678ead75a09a52d12646a33a60c522dc7c4244ba..09696132705eae973a73ded6c9ea2d4e14da184d 100644 --- a/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.res.oracle +++ b/src/plugins/wp/tests/wp_acsl/oracle_qualif/tset.res.oracle @@ -1,7 +1,6 @@ # frama-c -wp [...] [kernel] Parsing tset.i (no preprocessing) [wp] Running WP plugin... -[wp] Warning: native support for coq is deprecated, use tip instead [wp] 4 goals scheduled [wp] [Qed] Goal typed_lemma_UNION_DESCR : Valid [wp] [Alt-Ergo] Goal typed_lemma_UNION_EQ : Valid diff --git a/src/plugins/wp/tests/wp_acsl/tset.i b/src/plugins/wp/tests/wp_acsl/tset.i index 1f7b11df21bbacb99fcbf4de995db036cac04e8d..25b3086279f47a8140a381d0e01d80ba94451228 100644 --- a/src/plugins/wp/tests/wp_acsl/tset.i +++ b/src/plugins/wp/tests/wp_acsl/tset.i @@ -1,11 +1,11 @@ /* run.config_qualif - OPT: -wp -wp-prover alt-ergo,native:coq -wp-coq-script %{dep:@PTEST_DIR@/tset.s} + OPT: -wp -wp-prover alt-ergo */ /*@ lemma UNION_EQ: - \forall integer x,y ; + \forall integer x,y ; (\union(0,x) == \union(0,y)) <==> (x==y) ; lemma UNION_LIFT: diff --git a/src/plugins/wp/tests/wp_acsl/tset.s b/src/plugins/wp/tests/wp_acsl/tset.s deleted file mode 100644 index f8e5168a8acca70cb731d128acafedef528c92b8..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_acsl/tset.s +++ /dev/null @@ -1,9 +0,0 @@ -(* Generated by Frama-C WP *) - -Goal typed_lemma_UNION_DESCR. -Hint UNION_DESCR,property. -Proof. - intros. exists (i_1-i). intuition (auto with zarith). -Qed. - - diff --git a/src/plugins/wp/tests/wp_bts/bts_1174.i b/src/plugins/wp/tests/wp_bts/bts_1174.i index ce50d9189258794e8e0292d0262e3e922e763a83..48e3199393a79307d4cfb2bd8883c896c4580e3b 100644 --- a/src/plugins/wp/tests/wp_bts/bts_1174.i +++ b/src/plugins/wp/tests/wp_bts/bts_1174.i @@ -1,5 +1,5 @@ /* run.config_qualif - OPT: -wp -wp-prover native:coq -wp-coq-script %{dep:@PTEST_DIR@/bts_1174.s} -wp-model +real + OPT: -wp -wp-model +real */ /*@ requires -10. <= x && x <= 10.; */ diff --git a/src/plugins/wp/tests/wp_bts/bts_1174.s b/src/plugins/wp/tests/wp_bts/bts_1174.s deleted file mode 100644 index c1d443b3b02a23d7bd40478f0e9968e91bae2842..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_bts/bts_1174.s +++ /dev/null @@ -1,47 +0,0 @@ -(* Generated by Frama-C WP *) - -Goal store_job_assert_qed_ok. -Hint job,property,qed_ok. -Proof. - intros. - Require Import Fourier. - unfold r_1. - fourier. -Qed. - -Goal store_main_assert_qed_ok. -Hint main,property,qed_ok. -Proof. - intros. - Require Import Fourier. - unfold r_1. - fourier. -Qed. - -Goal store_main_pre. -Hint default,main,property. -Proof. - intros. - Require Import Fourier. - unfold r_1. - fourier. -Qed. - -Goal typed_job_assert_qed_ok. -Hint job,property,qed_ok. -Proof. - intros. - Require Import Fourier. - unfold r_1. - fourier. -Qed. - -Goal typed_real_job_assert_qed_ok. -Hint job,property,qed_ok. -Proof. - intros. - Require Import Fourier. - fourier. -Qed. - - diff --git a/src/plugins/wp/tests/wp_bts/bts_2471.i b/src/plugins/wp/tests/wp_bts/bts_2471.i index a25c144dafc34fea9b4067ea4e9e953d1ff1505e..813a965c35d1ea71a74e62632119a040c7b40b91 100644 --- a/src/plugins/wp/tests/wp_bts/bts_2471.i +++ b/src/plugins/wp/tests/wp_bts/bts_2471.i @@ -4,7 +4,6 @@ /* run.config_qualif OPT: -wp-timeout 1 - OPT: -wp-prover native:coq */ /*@ axiomatic maps { diff --git a/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1174.res.oracle b/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1174.res.oracle index d9a23912c0146b7c40b02c375c68271fcab0e186..288a484c71d1d73941afd4bdbced3c1992716336 100644 --- a/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1174.res.oracle +++ b/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_1174.res.oracle @@ -2,14 +2,12 @@ [kernel] Parsing bts_1174.i (no preprocessing) [wp] Running WP plugin... [wp] Warning: Missing RTE guards -[wp] Warning: native support for coq is deprecated, use tip instead [wp] 1 goal scheduled -[wp] [Coq] Goal typed_real_job_assert_qed_ok : Saved script -[wp] [Coq (native)] Goal typed_real_job_assert_qed_ok : Valid +[wp] [Alt-Ergo] Goal typed_real_job_assert_qed_ok : Valid [wp] Proved goals: 1 / 1 Qed: 0 - Coq (native): 1 + Alt-Ergo: 1 ------------------------------------------------------------ Functions WP Alt-Ergo Total Success - job - - 1 100% + job - 1 1 100% ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.1.res.oracle b/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.1.res.oracle deleted file mode 100644 index 8d031ef0aec0346a1b754a010c2e9c610ff308a1..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.1.res.oracle +++ /dev/null @@ -1,14 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing bts_2471.i (no preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] Warning: native support for coq is deprecated, use tip instead -[wp] 1 goal scheduled -[wp] [Coq] Goal typed_foo_assert_ko : Default tactic -[wp] [Coq (native)] Goal typed_foo_assert_ko : Unsuccess -[wp] Proved goals: 0 / 1 - Coq (native): 0 (unsuccess: 1) ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - foo - - 1 0.0% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.0.res.oracle b/src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.res.oracle similarity index 100% rename from src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.0.res.oracle rename to src/plugins/wp/tests/wp_bts/oracle_qualif/bts_2471.res.oracle diff --git a/src/plugins/wp/tests/wp_eva/test_config_qualif b/src/plugins/wp/tests/wp_eva/test_config_qualif index 8f8c6e5c791fd649d5d9a45b234bbf850e2b3ce6..5cc6f72566ce5f45d29d47a3ee4d208b904d271b 100644 --- a/src/plugins/wp/tests/wp_eva/test_config_qualif +++ b/src/plugins/wp/tests/wp_eva/test_config_qualif @@ -1,2 +1,2 @@ -CMD: @frama-c@ -no-autoload-plugins -load-module eva,scope,reduc,wp -eva -eva-no-print -eva-verbose 0 @PTEST_FILE@ -then -reduc -reduc-gen-annot all -then -no-reduc -then -wp -wp-par 1 -wp-share @PTEST_SHARE_DIR@ -wp-msg-key shell -wp-report tests/qualif.report -wp-session @PTEST_SUITE_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.session -wp-cache-env -wp-cache replay @PTEST_FILE@ -wp-coq-timeout 120 +CMD: @frama-c@ -no-autoload-plugins -load-module eva,scope,reduc,wp -eva -eva-no-print -eva-verbose 0 @PTEST_FILE@ -then -reduc -reduc-gen-annot all -then -no-reduc -then -wp -wp-par 1 -wp-share @PTEST_SHARE_DIR@ -wp-msg-key shell -wp-report tests/qualif.report -wp-session @PTEST_SUITE_DIR@/oracle@PTEST_CONFIG@/@PTEST_NAME@.@PTEST_NUMBER@.session -wp-cache-env -wp-cache replay @PTEST_FILE@ OPT: diff --git a/src/plugins/wp/tests/wp_plugin/Abs.v b/src/plugins/wp/tests/wp_plugin/Abs.v deleted file mode 100644 index 71280cae205e57f15051ed9ee5bb44b9cb006540..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/Abs.v +++ /dev/null @@ -1,4 +0,0 @@ -Require Import ZArith. - -Definition my_abs := Z.abs. - diff --git a/src/plugins/wp/tests/wp_plugin/abs.driver b/src/plugins/wp/tests/wp_plugin/abs.driver index 97bcd60eadc035dc88e07d7176196f32c897b3c0..1dec77f8d80595ace2f88e00a464f871953e4a0e 100644 --- a/src/plugins/wp/tests/wp_plugin/abs.driver +++ b/src/plugins/wp/tests/wp_plugin/abs.driver @@ -1,6 +1,4 @@ library "abs": logic integer ABS (integer) = "my_abs" ; -coq.file := "Abs.v"; -altergo.file := "abs.mlw"; why3.file := "abs.why"; diff --git a/src/plugins/wp/tests/wp_plugin/abs.i b/src/plugins/wp/tests/wp_plugin/abs.i index 321483c54b8ade7cb3782870de9e9a5cc49b0445..a602a11d813578ba99b10380fa702855e49c3e30 100644 --- a/src/plugins/wp/tests/wp_plugin/abs.i +++ b/src/plugins/wp/tests/wp_plugin/abs.i @@ -1,14 +1,12 @@ /* run.config COMMENT: depends from files mentionned into "abs.driver" - DEPS: abs.why abs.mlw abs.script Abs.v + DEPS: abs.why OPT: -wp-driver %{dep:@PTEST_DIR@/abs.driver} */ /* run.config_qualif COMMENT: depends from files mentionned into "abs.driver" - DEPS: abs.why abs.mlw abs.script Abs.v + DEPS: abs.why OPT: -wp -wp-driver %{dep:@PTEST_DIR@/abs.driver} -wp-prover alt-ergo - OPT: -wp -wp-driver %{dep:@PTEST_DIR@/abs.driver} -wp-prover native:coq -wp-coq-script %{dep:@PTEST_DIR@/abs.script} - OPT: -wp -wp-driver %{dep:@PTEST_DIR@/abs.driver} -wp-prover native:alt-ergo */ /*@ axiomatic Absolute { logic integer ABS(integer x) ; } */ diff --git a/src/plugins/wp/tests/wp_plugin/abs.mlw b/src/plugins/wp/tests/wp_plugin/abs.mlw deleted file mode 100644 index ad61e9bf35704fe57208a6b5301d001f007409e4..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/abs.mlw +++ /dev/null @@ -1,3 +0,0 @@ -logic my_abs : int -> int -axiom abs_pos : forall x:int. x>=0 -> my_abs(x) = x -axiom abs_neg : forall x:int. x<=0 -> my_abs(x) = -x diff --git a/src/plugins/wp/tests/wp_plugin/abs.script b/src/plugins/wp/tests/wp_plugin/abs.script deleted file mode 100644 index 9303a5e547253988ed4a35b21650bd7641569c51..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/abs.script +++ /dev/null @@ -1,13 +0,0 @@ -(* Generated by Frama-C WP *) - -Goal typed_abs_abs_ensures. -Hint abs,default,property. -Proof. - intro n. intros. subst. - unfold my_abs. - induction H1; - [ intros ; rewrite Zabs_non_eq | intros ; rewrite Z.abs_eq ] ; - auto with zarith. -Qed. - - diff --git a/src/plugins/wp/tests/wp_plugin/convert.i b/src/plugins/wp/tests/wp_plugin/convert.i index 2dce3a4622568c9e1a54a0b8e00ecf5d4b4301a6..c1cd5e0b31ebd6d52ad1a7a358b05d820fae632c 100644 --- a/src/plugins/wp/tests/wp_plugin/convert.i +++ b/src/plugins/wp/tests/wp_plugin/convert.i @@ -4,7 +4,6 @@ /* run.config_qualif OPT: - OPT: -wp-prover native:alt-ergo -wp-report=%{dep:@PTEST_SUITE_DIR@/../native.report} */ // -------------------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/flash-ergo.driver b/src/plugins/wp/tests/wp_plugin/flash-ergo.driver deleted file mode 100644 index 3a0caaa7b5aa77e404741f3fb27e0d8bd0f47609..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/flash-ergo.driver +++ /dev/null @@ -1,2 +0,0 @@ -library INDEX: const -logic index INDEX_init = {coq="dumb"; altergo="const(0)"; why3="Flash.init"; } ; diff --git a/src/plugins/wp/tests/wp_plugin/flash.c b/src/plugins/wp/tests/wp_plugin/flash.c index 957b7a677555f5350e219743644a4507973b389b..f289baa8d10249b415dec0f9db6673c39c77b7de 100644 --- a/src/plugins/wp/tests/wp_plugin/flash.c +++ b/src/plugins/wp/tests/wp_plugin/flash.c @@ -1,15 +1,11 @@ /* run.config OPT: - DEPS: flash.mlw - OPT: -wp-driver %{dep:@PTEST_DIR@/flash.driver},%{dep:@PTEST_DIR@/flash-ergo.driver} SCRIPT: flash OPT: -wp-driver %{dep:@PTEST_DIR@/flash.driver} */ /* run.config_qualif OPT: -wp-timeout 1 - DEPS: flash.mlw - OPT: -wp-driver %{dep:@PTEST_DIR@/flash.driver},%{dep:@PTEST_DIR@/flash-ergo.driver} SCRIPT: @PTEST_NAME@ OPT: -wp-driver %{dep:@PTEST_DIR@/flash.driver} */ @@ -22,7 +18,7 @@ SCRIPT: @PTEST_NAME@ /*@ axiomatic EVENT { - type event = + type event = | RdAt_int(int *) | WrAt_int(int *) ; @@ -47,7 +43,7 @@ SCRIPT: @PTEST_NAME@ //@ghost int RD_time ; -/*@ +/*@ axiomatic RD { logic index RD_current{L} reads RD_time; logic index RD_update( index idx , int *p ) reads \nothing; @@ -73,7 +69,7 @@ int RD(int *p); //@ ghost int WR_time ; -/*@ +/*@ axiomatic WR { logic index WR_current{L} reads WR_time; logic index WR_update( index idx , int *p ) reads \nothing; diff --git a/src/plugins/wp/tests/wp_plugin/flash.driver b/src/plugins/wp/tests/wp_plugin/flash.driver index 9196ec9571aacbb4e95249cd9e79a57184b829bb..d4cd3511798bccf8f84f19dd35017f81eb415d30 100644 --- a/src/plugins/wp/tests/wp_plugin/flash.driver +++ b/src/plugins/wp/tests/wp_plugin/flash.driver @@ -1,8 +1,8 @@ library INDEX: memory why3.file += "flash.mlw"; -type index = {coq="dumb"; altergo="(addr,int)farray"; why3="Flash.t"; } ; -logic integer INDEX_access( index , addr ) = {coq="dumb"; altergo="(%1)[%2]"; why3="Flash.get"; } ; -logic index INDEX_update( index , addr ) = {coq="dumb"; altergo="((%1)[(%2) <- (%1)[%2]+1])"; why3="Flash.update"}; +type index = {why3="Flash.t"; } ; +logic integer INDEX_access( index , addr ) = {why3="Flash.get"; } ; +logic index INDEX_update( index , addr ) = {why3="Flash.update"}; logic index INDEX_init := "INDEX_init" ; library RD: INDEX diff --git a/src/plugins/wp/tests/wp_plugin/flash.mlw b/src/plugins/wp/tests/wp_plugin/flash.mlw deleted file mode 100644 index 2d8a45bfb6c52f340992c99113318b4df4c8aba0..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/flash.mlw +++ /dev/null @@ -1,13 +0,0 @@ -module Flash - use map.Map - use map.Const - use int.Int - use frama_c_wp.memory.Memory - - type t = map addr int - - function get (m:t) (x:addr) : int = m[x] - function update (m:t) (x:addr) : t = m[ x <- (m[x] + 1) ] - - function init : t = const 0 -end diff --git a/src/plugins/wp/tests/wp_plugin/float_format.i b/src/plugins/wp/tests/wp_plugin/float_format.i index cdca1c6d758b266bfcef3b4a3727f19a234f8500..117574e517c0ddd4bd758787e23e77d1117ba4ff 100644 --- a/src/plugins/wp/tests/wp_plugin/float_format.i +++ b/src/plugins/wp/tests/wp_plugin/float_format.i @@ -1,6 +1,4 @@ /* run.config_qualif - OPT: -wp-prover native:coq - OPT: -wp-prover native:alt-ergo -wp-steps 5 -wp-timeout 100 OPT: -wp-prover alt-ergo -wp-steps 5 -wp-timeout 100 */ diff --git a/src/plugins/wp/tests/wp_plugin/inductive.c b/src/plugins/wp/tests/wp_plugin/inductive.c index fc52022bcb41ba6a0be668ad08de6a8d8a56406a..5fe98fae814e83f4c6533d9553266075fb930472 100644 --- a/src/plugins/wp/tests/wp_plugin/inductive.c +++ b/src/plugins/wp/tests/wp_plugin/inductive.c @@ -1,9 +1,9 @@ /* run.config - OPT: -wp-prover native:coq -wp-gen -wp-msg-key print-generated + OPT: -wp-prover why3 -wp-gen -wp-msg-key print-generated */ /* run.config_qualif - OPT: -wp-prover native:coq -wp-coq-script %{dep:@PTEST_DIR@/inductive.script} -wp-timeout 240 + DONTRUN: */ typedef struct _list { int element; struct _list* next; } list; @@ -42,11 +42,11 @@ typedef struct _list { int element; struct _list* next; } list; } */ -/*@ lemma test: - \forall list *root,*node; +/*@ lemma test: + \forall list *root,*node; reachable(root,node) ==> ( root == node || (\valid(root) && reachable(root->next, node)) ); */ -/*@ lemma offset{L1,L2} : +/*@ lemma offset{L1,L2} : \forall int *a, *b, integer begin, end, offset; same_elements{L1,L2}(a+offset,b+offset, begin, end) ==> same_elements{L1,L2}(a, b, begin+offset, end+offset); diff --git a/src/plugins/wp/tests/wp_plugin/inductive.script b/src/plugins/wp/tests/wp_plugin/inductive.script deleted file mode 100644 index d5d9adc636b9ab7cd2841f3bfdaa5c266c8770f2..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/inductive.script +++ /dev/null @@ -1,41 +0,0 @@ -(* Generated by Frama-C WP *) - -Goal typed_lemma_offset. -Hint offset,property. -Proof. - intros. remember (shift_sint32 a_1 i) as a_11. - remember (shift_sint32 a i) as a1. - revert dependent a. revert dependent a_1. - induction H; intros; subst. - - apply Q_refl. unfold P_same_array; intros. - unfold P_same_array in *. unfold shift_sint32, shift in *. - destruct a0, a_0. simpl in *. - replace i1 with (i + (i1 -i)) by omega. - rewrite 2!Z.add_assoc. - apply H; omega. - - apply Q_swap with (i_2:=i+i_2) (i_1:=i+i_1). unfold P_swap in *. - decompose [and] H; clear H. - unfold shift_sint32, shift in *. destruct a0, a_0. simpl in *. - repeat split; try omega. - + rewrite 2!Z.add_assoc. assumption. - + rewrite 2!Z.add_assoc. assumption. - + intros. - replace i_0 with (i + (i_0 - i)) by omega. - rewrite 2!Z.add_assoc. - apply H6; omega. - - apply Q_trans with (t_1:=t_1) (a_1:=shift_sint32 a_1 (-i)). - + apply IHP_same_elements1. destruct a_1; unfold shift_sint32, shift; simpl. f_equal; omega. reflexivity. - + apply IHP_same_elements2. reflexivity. destruct a_1; unfold shift_sint32, shift; simpl. f_equal; omega. -Qed. - -Goal typed_lemma_test. -Hint property,test. -Proof. -intros. -destruct H. - - left. reflexivity. - - right. split;assumption. -(* auto with zarith. *) -Qed. - - diff --git a/src/plugins/wp/tests/wp_plugin/math.i b/src/plugins/wp/tests/wp_plugin/math.i index d2a3d2ce303de8ef3b5c4f48ce0bcfa4b426570a..53a3106b4c5a605686807ae0bf937daa3a0c65db 100644 --- a/src/plugins/wp/tests/wp_plugin/math.i +++ b/src/plugins/wp/tests/wp_plugin/math.i @@ -3,10 +3,8 @@ */ /* run.config_qualif - OPT: -wp-prover alt-ergo -wp-prop=-ko -wp-timeout 100 -wp-steps 1500 - OPT: -wp-prover native:alt-ergo -wp-report=%{dep:@PTEST_SUITE_DIR@/../native.report} -wp-prop=-ko -wp-timeout 100 -wp-steps 1500 - OPT: -wp-prover alt-ergo -wp-prop=ko -wp-timeout 100 -wp-steps 10 - OPT: -wp-prover native:alt-ergo -wp-report=%{dep:@PTEST_SUITE_DIR@/../native.report} -wp-prop=ko -wp-timeout 100 -wp-steps 10 + OPT: -wp-prover alt-ergo -wp-prop=-ko -wp-timeout 100 -wp-steps 1500 + OPT: -wp-prover alt-ergo -wp-prop=ko -wp-timeout 100 -wp-steps 10 */ // -------------------------------------------------------------------------- @@ -63,7 +61,7 @@ // --- Polar // -------------------------------------------------------------------------- -//@ lemma distance: \forall real x,y; \hypot(x,y) == \sqrt( x*x + y*y ); +//@ lemma distance: \forall real x,y; \hypot(x,y) == \sqrt( x*x + y*y ); // -------------------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle/abs.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/abs.res.oracle index ff56ccd82d47ba9925f56af23dc6b638f2cea456..2bfda3e2447475511ce53a7f9cfa432ee664b45f 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/abs.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/abs.res.oracle @@ -6,7 +6,7 @@ Function abs ------------------------------------------------------------ -Goal Post-condition (file abs.i, line 15) in 'abs': +Goal Post-condition (file abs.i, line 13) in 'abs': Assume { Type: is_sint32(abs_0) /\ is_sint32(x). If x < 0 diff --git a/src/plugins/wp/tests/wp_plugin/oracle/dynamic.0.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/dynamic.0.res.oracle index 9d876e37568607a728687a7270d23c68e777088a..2f88edb1b0627c657c8fc40f61b990172364e794 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/dynamic.0.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/dynamic.0.res.oracle @@ -23,7 +23,7 @@ Assume { (* Heap *) Type: (region(closure_0.base) <= 0) /\ framed(Mptr_0). (* Pre-condition *) - Have: (a = a_1) \/ ((a = a_2) /\ (abs_int(x) <= 5)). + Have: (a = a_1) \/ ((a = a_2) /\ (IAbs.abs(x) <= 5)). } Prove: (a = a_2) \/ (a = a_1). @@ -50,7 +50,7 @@ Assume { (* Heap *) Type: (region(closure_0.base) <= 0) /\ framed(Mptr_0). (* Pre-condition *) - Have: abs_int(x) <= 5. + Have: IAbs.abs(x) <= 5. (* Instance of 'f1' *) (* Call point f1 f2 *) Have: Mptr_0[shiftfield_F1_S_f(closure_0)] = global(G_f1_22). diff --git a/src/plugins/wp/tests/wp_plugin/oracle/flash.1.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/flash.1.res.oracle index 4ec72a463c8f85457c62723f2c2d9a4002f0ab78..f8d847b6ba4862b3d75a7ae339fe60a4414f0ef7 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/flash.1.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/flash.1.res.oracle @@ -1,7 +1,6 @@ # frama-c -wp [...] [kernel] Parsing flash.c (with preprocessing) [wp] Running WP plugin... -[wp] flash-ergo.driver:2: Warning: Redefinition of logic INDEX_init [wp] Warning: Missing RTE guards ------------------------------------------------------------ Function job @@ -13,252 +12,26 @@ Prove: true. ------------------------------------------------------------ Goal Post-condition 'A_reads' in 'job': -Let x = 1 + OBSERVER_time_0. -Let a = global(G_a_64). -Let a_1 = C_RdAt_int(a). -Let a_2 = global(G_b_65). -Let a_3 = C_RdAt_int(a_2). -Let a_4 = C_WrAt_int(a_2). -Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). -Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). -Let a_7 = ((a_6)[(a) <- (a_6)[a]+1]). -Let x_1 = 1 + RD_time_0. -Let x_2 = 1 + WR_time_0. -Let x_3 = OBSERVER_time_0 - 1. -Let x_4 = RD_time_0 - 1. -Let a_8 = L_RD_current(x_4). -Let x_5 = OBSERVER_time_0 - 2. -Let x_6 = L_RD_value(a, (const(0))[a]). -Let x_7 = x_6 + L_RD_value(a_2, (a_8)[a_2]). -Let x_8 = RD_time_0 - 2. -Let x_9 = OBSERVER_time_0 - 3. -Let x_10 = L_RD_value(a_2, (a_5)[a_2]). -Let x_11 = L_RD_value(a, (a_6)[a]). -Assume { - Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ - is_sint32(WR_time_0) /\ is_sint32(x_9) /\ is_sint32(x_5) /\ - is_sint32(x_8) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x) /\ - is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_6) /\ - is_sint32(x_10) /\ is_sint32(x_11) /\ is_sint32(x_7) /\ - is_sint32(x_6 + x_10 + x_11). - (* Pre-condition *) - Have: L_OBSERVER(x_9) = nil. - (* Pre-condition *) - Have: L_RD_current(x_8) = const(0). - (* Pre-condition *) - Have: L_WR_current(WR_time_0) = const(0). - (* Call 'RD' *) - Have: (a_8 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ - (x_7 = L_WR_value(a_2, (const(0))[a_2])). - (* Call 'RD' *) - Have: (a_6 = L_RD_current(RD_time_0)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). - (* Call 'WR' *) - Have: (L_WR_current(x_2) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ - (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). - (* Call 'RD' *) - Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ - (a_7 = L_RD_current(x_1)). -} -Prove: (a_7)[a] = 2. +Prove: true. ------------------------------------------------------------ Goal Post-condition 'B_reads' in 'job': -Let x = 1 + OBSERVER_time_0. -Let a = global(G_a_64). -Let a_1 = C_RdAt_int(a). -Let a_2 = global(G_b_65). -Let a_3 = C_RdAt_int(a_2). -Let a_4 = C_WrAt_int(a_2). -Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). -Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). -Let a_7 = ((a_6)[(a) <- (a_6)[a]+1]). -Let x_1 = 1 + RD_time_0. -Let x_2 = 1 + WR_time_0. -Let x_3 = OBSERVER_time_0 - 1. -Let x_4 = RD_time_0 - 1. -Let a_8 = L_RD_current(x_4). -Let x_5 = OBSERVER_time_0 - 2. -Let x_6 = L_RD_value(a, (const(0))[a]). -Let x_7 = x_6 + L_RD_value(a_2, (a_8)[a_2]). -Let x_8 = RD_time_0 - 2. -Let x_9 = OBSERVER_time_0 - 3. -Let x_10 = L_RD_value(a_2, (a_5)[a_2]). -Let x_11 = L_RD_value(a, (a_6)[a]). -Assume { - Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ - is_sint32(WR_time_0) /\ is_sint32(x_9) /\ is_sint32(x_5) /\ - is_sint32(x_8) /\ is_sint32(x_3) /\ is_sint32(x_4) /\ is_sint32(x) /\ - is_sint32(x_1) /\ is_sint32(x_2) /\ is_sint32(x_6) /\ - is_sint32(x_10) /\ is_sint32(x_11) /\ is_sint32(x_7) /\ - is_sint32(x_6 + x_10 + x_11). - (* Pre-condition *) - Have: L_OBSERVER(x_9) = nil. - (* Pre-condition *) - Have: L_RD_current(x_8) = const(0). - (* Pre-condition *) - Have: L_WR_current(WR_time_0) = const(0). - (* Call 'RD' *) - Have: (a_8 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ - (x_7 = L_WR_value(a_2, (const(0))[a_2])). - (* Call 'RD' *) - Have: (a_6 = L_RD_current(RD_time_0)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). - (* Call 'WR' *) - Have: (L_WR_current(x_2) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ - (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). - (* Call 'RD' *) - Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ - (a_7 = L_RD_current(x_1)). -} -Prove: (a_7)[a_2] = 1. +Prove: true. ------------------------------------------------------------ Goal Post-condition 'B_writes' in 'job': -Let x = 1 + OBSERVER_time_0. -Let a = global(G_a_64). -Let a_1 = C_RdAt_int(a). -Let a_2 = global(G_b_65). -Let a_3 = C_RdAt_int(a_2). -Let a_4 = C_WrAt_int(a_2). -Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). -Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). -Let x_1 = 1 + WR_time_0. -Let a_7 = ((const(0))[(a_2) <- (const(0))[a_2]+1]). -Let x_2 = RD_time_0 - 1. -Let x_3 = OBSERVER_time_0 - 1. -Let x_4 = RD_time_0 - 2. -Let a_8 = L_RD_current(x_4). -Let x_5 = OBSERVER_time_0 - 2. -Let x_6 = L_RD_value(a, (const(0))[a]). -Let x_7 = x_6 + L_RD_value(a_2, (a_8)[a_2]). -Let x_8 = RD_time_0 - 3. -Let x_9 = OBSERVER_time_0 - 3. -Let x_10 = L_RD_value(a_2, (a_5)[a_2]). -Let x_11 = L_RD_value(a, (a_6)[a]). -Assume { - Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ - is_sint32(WR_time_0) /\ is_sint32(x_9) /\ is_sint32(x_8) /\ - is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ - is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_6) /\ is_sint32(x_10) /\ - is_sint32(x_11) /\ is_sint32(x_7) /\ is_sint32(x_6 + x_10 + x_11). - (* Pre-condition *) - Have: L_OBSERVER(x_9) = nil. - (* Pre-condition *) - Have: L_RD_current(x_8) = const(0). - (* Pre-condition *) - Have: L_WR_current(WR_time_0) = const(0). - (* Call 'RD' *) - Have: (a_8 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ - (x_7 = L_WR_value(a_2, (const(0))[a_2])). - (* Call 'RD' *) - Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). - (* Call 'WR' *) - Have: (L_WR_current(x_1) = a_7) /\ - (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). - (* Call 'RD' *) - Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ - (((a_6)[(a) <- (a_6)[a]+1]) = L_RD_current(RD_time_0)). -} -Prove: (a_7)[a_2] = 1. +Prove: true. ------------------------------------------------------------ Goal Post-condition 'ReadValues' in 'job': -Let x = 1 + OBSERVER_time_0. -Let a = global(G_a_64). -Let a_1 = C_RdAt_int(a). -Let a_2 = global(G_b_65). -Let a_3 = C_RdAt_int(a_2). -Let a_4 = C_WrAt_int(a_2). -Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). -Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). -Let x_1 = 1 + WR_time_0. -Let x_2 = RD_time_0 - 1. -Let x_3 = OBSERVER_time_0 - 1. -Let x_4 = RD_time_0 - 2. -Let a_7 = L_RD_current(x_4). -Let x_5 = OBSERVER_time_0 - 2. -Let x_6 = L_RD_value(a, (const(0))[a]). -Let x_7 = x_6 + L_RD_value(a_2, (a_7)[a_2]). -Let x_8 = RD_time_0 - 3. -Let x_9 = OBSERVER_time_0 - 3. -Let x_10 = L_RD_value(a_2, (a_5)[a_2]). -Let x_11 = L_RD_value(a, (a_6)[a]). -Let x_12 = x_6 + x_10 + x_11. -Assume { - Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ - is_sint32(WR_time_0) /\ is_sint32(x_9) /\ is_sint32(x_8) /\ - is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ - is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_6) /\ is_sint32(x_10) /\ - is_sint32(x_11) /\ is_sint32(x_7) /\ is_sint32(x_12). - (* Pre-condition *) - Have: L_OBSERVER(x_9) = nil. - (* Pre-condition *) - Have: L_RD_current(x_8) = const(0). - (* Pre-condition *) - Have: L_WR_current(WR_time_0) = const(0). - (* Call 'RD' *) - Have: (a_7 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ - (x_7 = L_WR_value(a_2, (const(0))[a_2])). - (* Call 'RD' *) - Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). - (* Call 'WR' *) - Have: (L_WR_current(x_1) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ - (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). - (* Call 'RD' *) - Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ - (((a_6)[(a) <- (a_6)[a]+1]) = L_RD_current(RD_time_0)). -} -Prove: x_12 = (L_RD_value(a, 0) + L_RD_value(a, 1) + L_RD_value(a_2, 0)). +Prove: true. ------------------------------------------------------------ Goal Post-condition 'WriteValues' in 'job': -Let x = 1 + OBSERVER_time_0. -Let a = global(G_a_64). -Let a_1 = C_RdAt_int(a). -Let a_2 = global(G_b_65). -Let a_3 = C_RdAt_int(a_2). -Let a_4 = C_WrAt_int(a_2). -Let a_5 = ((const(0))[(a) <- (const(0))[a]+1]). -Let a_6 = ((a_5)[(a_2) <- (a_5)[a_2]+1]). -Let x_1 = 1 + WR_time_0. -Let x_2 = RD_time_0 - 1. -Let x_3 = OBSERVER_time_0 - 1. -Let x_4 = RD_time_0 - 2. -Let a_7 = L_RD_current(x_4). -Let x_5 = OBSERVER_time_0 - 2. -Let x_6 = L_RD_value(a, (const(0))[a]). -Let x_7 = x_6 + L_RD_value(a_2, (a_7)[a_2]). -Let x_8 = RD_time_0 - 3. -Let x_9 = OBSERVER_time_0 - 3. -Let x_10 = L_RD_value(a_2, (a_5)[a_2]). -Let x_11 = L_RD_value(a, (a_6)[a]). -Assume { - Type: is_sint32(OBSERVER_time_0) /\ is_sint32(RD_time_0) /\ - is_sint32(WR_time_0) /\ is_sint32(x_9) /\ is_sint32(x_8) /\ - is_sint32(x_5) /\ is_sint32(x_4) /\ is_sint32(x_3) /\ is_sint32(x_2) /\ - is_sint32(x) /\ is_sint32(x_1) /\ is_sint32(x_6) /\ is_sint32(x_10) /\ - is_sint32(x_11) /\ is_sint32(x_7) /\ is_sint32(x_6 + x_10 + x_11). - (* Pre-condition *) - Have: L_OBSERVER(x_9) = nil. - (* Pre-condition *) - Have: L_RD_current(x_8) = const(0). - (* Pre-condition *) - Have: L_WR_current(WR_time_0) = const(0). - (* Call 'RD' *) - Have: (a_7 = a_5) /\ (L_OBSERVER(x_5) = [ a_1 ]) /\ - (x_7 = L_WR_value(a_2, (const(0))[a_2])). - (* Call 'RD' *) - Have: (a_6 = L_RD_current(x_2)) /\ (L_OBSERVER(x_3) = [ a_1, a_3 ]). - (* Call 'WR' *) - Have: (L_WR_current(x_1) = ((const(0))[(a_2) <- (const(0))[a_2]+1])) /\ - (L_OBSERVER(OBSERVER_time_0) = [ a_1, a_3, a_4 ]). - (* Call 'RD' *) - Have: (L_OBSERVER(x) = [ a_1, a_3, a_4, a_1 ]) /\ - (((a_6)[(a) <- (a_6)[a]+1]) = L_RD_current(RD_time_0)). -} -Prove: (L_RD_value(a, 0) + L_RD_value(a_2, 0)) = L_WR_value(a_2, 0). +Prove: true. ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_plugin/oracle/flash.2.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/flash.2.res.oracle deleted file mode 100644 index f8d847b6ba4862b3d75a7ae339fe60a4414f0ef7..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle/flash.2.res.oracle +++ /dev/null @@ -1,37 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing flash.c (with preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards ------------------------------------------------------------- - Function job ------------------------------------------------------------- - -Goal Post-condition 'Events' in 'job': -Prove: true. - ------------------------------------------------------------- - -Goal Post-condition 'A_reads' in 'job': -Prove: true. - ------------------------------------------------------------- - -Goal Post-condition 'B_reads' in 'job': -Prove: true. - ------------------------------------------------------------- - -Goal Post-condition 'B_writes' in 'job': -Prove: true. - ------------------------------------------------------------- - -Goal Post-condition 'ReadValues' in 'job': -Prove: true. - ------------------------------------------------------------- - -Goal Post-condition 'WriteValues' in 'job': -Prove: true. - ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle/float_format.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/float_format.res.oracle index de8342d87a74aa1c4d12bb1bd09b641a3bce47b3..86587426f43e2a50822707fa7feace8c84912896 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/float_format.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/float_format.res.oracle @@ -1,6 +1,6 @@ # frama-c -wp [...] [kernel] Parsing float_format.i (no preprocessing) -[kernel:parser:decimal-float] float_format.i:10: Warning: +[kernel:parser:decimal-float] float_format.i:8: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... diff --git a/src/plugins/wp/tests/wp_plugin/oracle/float_real.0.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/float_real.0.res.oracle index 588faa27370308ab4412a90f3c566f962a7bedf4..bfaa684d0565a4a2762e379b709b4779591691d1 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/float_real.0.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/float_real.0.res.oracle @@ -20,6 +20,6 @@ Assume { } Else { Have: dequal_0 = 0. } } -Prove: (abs_real(x - y) < (1.0/100000)) <-> (dequal_0 != 0). +Prove: (RAbs.abs(x - y) < (1.0/100000)) <-> (dequal_0 != 0). ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_plugin/oracle/float_real.1.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/float_real.1.res.oracle index 263fd5d0c43900e7a6d64787c9ad65b8bd993db1..03a072084a991d573a6a568978f069f865100fa3 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/float_real.1.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/float_real.1.res.oracle @@ -22,6 +22,6 @@ Assume { } Else { Have: dequal_0 = 0. } } -Prove: (abs_real(of_f64(x) - of_f64(y)) < (1.0/100000)) <-> (dequal_0 != 0). +Prove: (RAbs.abs(of_f64(x) - of_f64(y)) < (1.0/100000)) <-> (dequal_0 != 0). ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_plugin/oracle/inductive.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/inductive.res.oracle index 682a46a629d55a852430add96b479063d9d0821c..973a39e45fa5af1ba55ed02d29a1bfe1666b0a7a 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/inductive.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/inductive.res.oracle @@ -1,176 +1,149 @@ # frama-c -wp [...] [kernel] Parsing inductive.c (with preprocessing) [wp] Running WP plugin... -[wp] Warning: native support for coq is deprecated, use tip instead [wp] 2 goals scheduled -[wp:print-generated] - "WPOUT/typed/Compound.v" - (* ---------------------------------------------------------- *) - (* --- Memory Compound Loader --- *) - (* ---------------------------------------------------------- *) - - Require Import ZArith. - Require Import Reals. - Require Import BuiltIn. - Require Import bool.Bool. - Require Import HighOrd. - Require Import int.Int. - Require Import int.Abs. - Require Import int.ComputerDivision. - Require Import int.EuclideanDivision. - Require Import int.ComputerOfEuclideanDivision. - Require Import real.Real. - Require Import real.RealInfix. - Require Import real.FromInt. - Require Import map.Map. - Require Import bool.Bool. - Require Import Qedlib. - Require Import Qed. - Require Import Memory. +--------------------------------------------- +--- Context 'typed' Cluster 'Compound' +--------------------------------------------- +theory Compound + (* use why3.BuiltIn.BuiltIn *) - Definition shift_sint32 (p : addr) (k : Z) : addr := (shift p k%Z). - - Definition shiftfield_F1__list_next (p : addr) : addr := (shift p 1%Z). -[wp:print-generated] - "WPOUT/typed/lemma_test_Coq.v" - (* ---------------------------------------------------------- *) - (* --- Lemma 'test' --- *) - (* ---------------------------------------------------------- *) - Require Import ZArith. - Require Import Reals. - Require Import BuiltIn. - Require Import bool.Bool. - Require Import HighOrd. - Require Import int.Int. - Require Import int.Abs. - Require Import int.ComputerDivision. - Require Import int.EuclideanDivision. - Require Import int.ComputerOfEuclideanDivision. - Require Import real.Real. - Require Import real.RealInfix. - Require Import real.FromInt. - Require Import map.Map. - Require Import bool.Bool. - Require Import Qedlib. - Require Import Qed. + (* use bool.Bool *) - (* --- Global Definitions --- *) - Require Import Memory. + (* use int.Int *) - Require Import Compound. + (* use int.ComputerDivision *) - Inductive P_reachable : array Z -> farray addr addr -> addr -> addr -> - Prop := - | Q_root_reachable: forall (t : array Z), - forall (t_1 : farray addr addr), forall (a : addr), - (P_reachable t t_1 a a) - | Q_next_reachable: forall (t : array Z), - forall (t_1 : farray addr addr), forall (a_1 a : addr), - ((valid_rw t a_1 2%Z)) -> - ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)) -> - ((P_reachable t t_1 a_1 a)). - - Goal - forall (t : array Z), - forall (t_1 : farray addr addr), - forall (a_1 a : addr), - ((P_reachable t t_1 a_1 a)) -> - ((a_1 = a) \/ - (((valid_rw t a_1 2%Z)) /\ - ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)))). - - Proof. - ... - Qed. -[wp:print-generated] - "WPOUT/typed/lemma_offset_Coq.v" - (* ---------------------------------------------------------- *) - (* --- Lemma 'offset' --- *) - (* ---------------------------------------------------------- *) - Require Import ZArith. - Require Import Reals. - Require Import BuiltIn. - Require Import bool.Bool. - Require Import HighOrd. - Require Import int.Int. - Require Import int.Abs. - Require Import int.ComputerDivision. - Require Import int.EuclideanDivision. - Require Import int.ComputerOfEuclideanDivision. - Require Import real.Real. - Require Import real.RealInfix. - Require Import real.FromInt. - Require Import map.Map. - Require Import bool.Bool. - Require Import Qedlib. - Require Import Qed. + (* use real.RealInfix *) - (* --- Global Definitions --- *) - Require Import Memory. + (* use frama_c_wp.qed.Qed *) - Require Import Compound. + (* use map.Map *) - Inductive P_reachable : array Z -> farray addr addr -> addr -> addr -> - Prop := - | Q_root_reachable: forall (t : array Z), - forall (t_1 : farray addr addr), forall (a : addr), - (P_reachable t t_1 a a) - | Q_next_reachable: forall (t : array Z), - forall (t_1 : farray addr addr), forall (a_1 a : addr), - ((valid_rw t a_1 2%Z)) -> - ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)) -> - ((P_reachable t t_1 a_1 a)). + (* use frama_c_wp.memory.Memory *) - Hypothesis Q_test: forall (t : array Z), forall (t_1 : farray addr addr), - forall (a_1 a : addr), ((P_reachable t t_1 a_1 a)) -> - ((a_1 = a) \/ - (((valid_rw t a_1 2%Z)) /\ - ((P_reachable t t_1 (t_1.[ (shiftfield_F1__list_next a_1) ]) a)))). + function shift_sint32 (p:addr) (k:int) : addr = shift p k - Definition P_same_array (Mint_0 : farray addr Z) (Mint_1 : farray addr Z) - (a : addr) (b : addr) (begin_0 : Z) (end_0 : Z) : Prop := - forall (i : Z), ((begin_0 <= i)%Z) -> ((i < end_0)%Z) -> - (((Mint_1.[ (shift_sint32 a i%Z) ]) - = (Mint_0.[ (shift_sint32 b i%Z) ]))%Z). - - Definition P_swap (Mint_0 : farray addr Z) (Mint_1 : farray addr Z) - (a : addr) (b : addr) (begin_0 : Z) (i : Z) (j : Z) (end_0 : Z) : Prop := - (((Mint_1.[ (shift_sint32 a i%Z) ]) - = (Mint_0.[ (shift_sint32 b j%Z) ]))%Z) /\ - (((Mint_1.[ (shift_sint32 a j%Z) ]) - = (Mint_0.[ (shift_sint32 b i%Z) ]))%Z) /\ ((begin_0 <= i)%Z) /\ - ((i < j)%Z) /\ ((j < end_0)%Z) /\ - (forall (i_1 : Z), ((i_1 <> i)%Z) -> ((i_1 <> j)%Z) -> - ((begin_0 <= i_1)%Z) -> ((i_1 < end_0)%Z) -> - (((Mint_1.[ (shift_sint32 a i_1%Z) ]) - = (Mint_0.[ (shift_sint32 b i_1%Z) ]))%Z)). - - Inductive P_same_elements : farray addr Z -> farray addr Z -> addr -> addr -> - Z -> Z -> Prop := - | Q_refl: forall (i_1 i : Z), forall (t_1 t : farray addr Z), - forall (a_1 a : addr), ((P_same_array t_1 t a_1 a i_1%Z i%Z)) -> - ((P_same_elements t_1 t a_1 a i_1%Z i%Z)) - | Q_swap: forall (i_3 i_2 i_1 i : Z), forall (t_1 t : farray addr Z), - forall (a_1 a : addr), - ((P_swap t_1 t a_1 a i_3%Z i_2%Z i_1%Z i%Z)) -> - ((P_same_elements t_1 t a_1 a i_3%Z i%Z)) - | Q_trans: forall (i_1 i : Z), forall (t_2 t_1 t : farray addr Z), - forall (a_2 a_1 a : addr), - ((P_same_elements t_2 t_1 a_1 a i_1%Z i%Z)) -> - ((P_same_elements t_1 t a_2 a_1 i_1%Z i%Z)) -> - ((P_same_elements t_2 t a_2 a i_1%Z i%Z)). - - Goal - forall (i_2 i_1 i : Z), - forall (t_1 t : farray addr Z), - forall (a_1 a : addr), - ((P_same_elements t_1 t ((shift_sint32 a_1 i%Z)) ((shift_sint32 a i%Z)) - i_2%Z i_1%Z)) -> - ((P_same_elements t_1 t a_1 a (i%Z + i_2%Z)%Z (i%Z + i_1%Z)%Z)). - - Proof. - ... - Qed. + function shiftfield_F1__list_next (p:addr) : addr = shift p 1 +end +[wp:print-generated] + theory WP + (* use why3.BuiltIn.BuiltIn *) + + (* use bool.Bool *) + + (* use int.Int *) + + (* use int.ComputerDivision *) + + (* use real.RealInfix *) + + (* use frama_c_wp.qed.Qed *) + + (* use map.Map *) + + (* use frama_c_wp.memory.Memory *) + + (* use Compound *) + + inductive P_reachable (int -> int) (addr -> addr) addr addr = + | Q_root_reachable : + forall malloc:int -> int, mptr:addr -> addr, root:addr. + P_reachable malloc mptr root root + | Q_next_reachable : + forall malloc:int -> int, mptr:addr -> addr, root:addr, node:addr. + valid_rw malloc root 2 -> + P_reachable malloc mptr (get mptr (shiftfield_F1__list_next root)) + node -> P_reachable malloc mptr root node + + goal wp_goal : + forall t:int -> int, t1:addr -> addr, a:addr, a1:addr. + P_reachable t t1 a a1 -> + a1 = a \/ + valid_rw t a 2 /\ + P_reachable t t1 (get t1 (shiftfield_F1__list_next a)) a1 + end +[wp:print-generated] + theory WP1 + (* use why3.BuiltIn.BuiltIn *) + + (* use bool.Bool *) + + (* use int.Int *) + + (* use int.ComputerDivision *) + + (* use real.RealInfix *) + + (* use frama_c_wp.qed.Qed *) + + (* use map.Map *) + + (* use frama_c_wp.memory.Memory *) + + (* use Compound *) + + inductive P_reachable1 (int -> int) (addr -> addr) addr addr = + | Q_root_reachable1 : + forall malloc:int -> int, mptr:addr -> addr, root:addr. + P_reachable1 malloc mptr root root + | Q_next_reachable1 : + forall malloc:int -> int, mptr:addr -> addr, root:addr, node:addr. + valid_rw malloc root 2 -> + P_reachable1 malloc mptr (get mptr (shiftfield_F1__list_next root)) + node -> P_reachable1 malloc mptr root node + + lemma Q_test : + forall malloc:int -> int, mptr:addr -> addr, root:addr, node:addr. + P_reachable1 malloc mptr root node -> + root = node \/ + valid_rw malloc root 2 /\ + P_reachable1 malloc mptr (get mptr (shiftfield_F1__list_next root)) node + + predicate P_same_array (mint:addr -> int) (mint1:addr -> int) (a:addr) (b: + addr) (begin:int) (end1:int) = + forall i:int. + begin <= i -> + i < end1 -> get mint1 (shift_sint32 a i) = get mint (shift_sint32 b i) + + predicate P_swap (mint:addr -> int) (mint1:addr -> int) (a:addr) (b:addr) + (begin:int) (i:int) (j:int) (end1:int) = + ((((get mint1 (shift_sint32 a i) = get mint (shift_sint32 b j) /\ + get mint1 (shift_sint32 a j) = get mint (shift_sint32 b i)) /\ + begin <= i) /\ + i < j) /\ + j < end1) /\ + (forall i1:int. + not i1 = i -> + not j = i1 -> + begin <= i1 -> + i1 < end1 -> + get mint1 (shift_sint32 a i1) = get mint (shift_sint32 b i1)) + + inductive P_same_elements (addr -> int) (addr -> int) addr addr int int = + | Q_refl : + forall mint:addr -> int, mint1:addr -> int, a:addr, b:addr, begin: + int, end1:int. + P_same_array mint mint1 a b begin end1 -> + P_same_elements mint mint1 a b begin end1 + | Q_swap : + forall mint:addr -> int, mint1:addr -> int, a:addr, b:addr, begin: + int, i:int, j:int, end1:int. + P_swap mint mint1 a b begin i j end1 -> + P_same_elements mint mint1 a b begin end1 + | Q_trans : + forall mint:addr -> int, mint1:addr -> int, mint2:addr -> int, a: + addr, b:addr, c:addr, begin:int, end1:int. + P_same_elements mint mint1 b c begin end1 -> + P_same_elements mint1 mint2 a b begin end1 -> + P_same_elements mint mint2 a c begin end1 + + goal wp_goal : + forall t:addr -> int, t1:addr -> int, a:addr, a1:addr, i:int, i1:int, i2: + int. + P_same_elements t t1 (shift_sint32 a i2) (shift_sint32 a1 i2) i i1 -> + P_same_elements t t1 a a1 (i + i2) (i1 + i2) + end [wp] 2 goals generated ------------------------------------------------------------ Global diff --git a/src/plugins/wp/tests/wp_plugin/oracle/math.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle/math.res.oracle index cdc664a97caad3fc04bd56c4474c1c7ebdd2d6fd..a6ca689bc81b26f3ccaf9aaa4ea1e23f0a15e627 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle/math.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle/math.res.oracle @@ -231,7 +231,7 @@ Prove: exp(log(r)) = r. ------------------------------------------------------------ Goal Post-condition 'min_plus_distrib' in 'ok': -Prove: (r + min_real(r_1, r_2)) = min_real(r_1 + r, r_2 + r). +Prove: (r + Rg.min(r_1, r_2)) = Rg.min(r_1 + r, r_2 + r). ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.1.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.1.res.oracle deleted file mode 100644 index 146552b7f55e6cec0927dd4ce0cc23678597b4dc..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.1.res.oracle +++ /dev/null @@ -1,15 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing abs.i (no preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] Warning: native support for coq is deprecated, use tip instead -[wp] 1 goal scheduled -[wp] [Coq] Goal typed_abs_abs_ensures : Saved script -[wp] [Coq (native)] Goal typed_abs_abs_ensures : Valid -[wp] Proved goals: 1 / 1 - Qed: 0 - Coq (native): 1 ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - abs - - 1 100% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.res.oracle deleted file mode 100644 index 34c366ca1cffba4cf705fc0c994faccac7529d81..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.2.res.oracle +++ /dev/null @@ -1,14 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing abs.i (no preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] Warning: native support for alt-ergo is deprecated, use why3 instead -[wp] 1 goal scheduled -[wp] [Alt-Ergo (native)] Goal typed_abs_abs_ensures : Valid -[wp] Proved goals: 1 / 1 - Qed: 0 - Alt-Ergo (native): 1 ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - abs - - 1 100% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.0.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.res.oracle similarity index 100% rename from src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.0.res.oracle rename to src/plugins/wp/tests/wp_plugin/oracle_qualif/abs.res.oracle diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.1.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.1.res.oracle deleted file mode 100644 index 7bd9172a0194f3c00e9b0a7735d563aa01a970fd..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.1.res.oracle +++ /dev/null @@ -1,18 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing convert.i (no preprocessing) -[wp] Running WP plugin... -[wp] Warning: native support for alt-ergo is deprecated, use why3 instead -[wp] 2 goals scheduled -[wp] [Alt-Ergo (native)] Goal typed_lemma_ceil : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_floor : Valid -[wp] Proved goals: 2 / 2 - Qed: 0 - Alt-Ergo (native): 2 ------------------------------------------------------------- - Axiomatics WP Alt-Ergo Total Success - Lemma - - 2 100% ------------------------------------------------------------- -------------------------------------------------------------- -Axiomatics WP Alt-Ergo (Native) Total Success -Lemma - 2 2 100% -------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.res.oracle similarity index 100% rename from src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.0.res.oracle rename to src/plugins/wp/tests/wp_plugin/oracle_qualif/convert.res.oracle diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.res.oracle index 8419319f579d41c559a2b1a06ca94882a297dbeb..09997a7fac3dfc41bd52eb294988b1d2bdc12825 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.1.res.oracle @@ -1,19 +1,17 @@ # frama-c -wp [...] [kernel] Parsing flash.c (with preprocessing) [wp] Running WP plugin... -[wp] flash-ergo.driver:2: Warning: Redefinition of logic INDEX_init [wp] Warning: Missing RTE guards [wp] 6 goals scheduled -[wp] [Qed] Goal typed_flash_flash-ergo_job_ensures_Events : Valid -[wp] [Alt-Ergo] Goal typed_flash_flash-ergo_job_ensures_A_reads : Valid -[wp] [Alt-Ergo] Goal typed_flash_flash-ergo_job_ensures_B_reads : Valid -[wp] [Alt-Ergo] Goal typed_flash_flash-ergo_job_ensures_B_writes : Valid -[wp] [Alt-Ergo] Goal typed_flash_flash-ergo_job_ensures_ReadValues : Valid -[wp] [Alt-Ergo] Goal typed_flash_flash-ergo_job_ensures_WriteValues : Valid +[wp] [Qed] Goal typed_flash_job_ensures_Events : Valid +[wp] [Qed] Goal typed_flash_job_ensures_A_reads : Valid +[wp] [Qed] Goal typed_flash_job_ensures_B_reads : Valid +[wp] [Qed] Goal typed_flash_job_ensures_B_writes : Valid +[wp] [Qed] Goal typed_flash_job_ensures_ReadValues : Valid +[wp] [Qed] Goal typed_flash_job_ensures_WriteValues : Valid [wp] Proved goals: 6 / 6 - Qed: 1 - Alt-Ergo: 5 + Qed: 6 ------------------------------------------------------------ Functions WP Alt-Ergo Total Success - job 1 5 6 100% + job 6 - 6 100% ------------------------------------------------------------ diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.2.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.2.res.oracle deleted file mode 100644 index 09997a7fac3dfc41bd52eb294988b1d2bdc12825..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/flash.2.res.oracle +++ /dev/null @@ -1,17 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing flash.c (with preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] 6 goals scheduled -[wp] [Qed] Goal typed_flash_job_ensures_Events : Valid -[wp] [Qed] Goal typed_flash_job_ensures_A_reads : Valid -[wp] [Qed] Goal typed_flash_job_ensures_B_reads : Valid -[wp] [Qed] Goal typed_flash_job_ensures_B_writes : Valid -[wp] [Qed] Goal typed_flash_job_ensures_ReadValues : Valid -[wp] [Qed] Goal typed_flash_job_ensures_WriteValues : Valid -[wp] Proved goals: 6 / 6 - Qed: 6 ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - job 6 - 6 100% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.0.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.0.res.oracle deleted file mode 100644 index 035a7253a8796855be87d1e57b2c7182febefb46..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.0.res.oracle +++ /dev/null @@ -1,17 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing float_format.i (no preprocessing) -[kernel:parser:decimal-float] float_format.i:10: Warning: - Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. - (warn-once: no further messages from category 'parser:decimal-float' will be emitted) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] Warning: native support for coq is deprecated, use tip instead -[wp] 1 goal scheduled -[wp] [Coq] Goal typed_output_ensures_KO : Default tactic -[wp] [Coq (native)] Goal typed_output_ensures_KO : Unsuccess -[wp] Proved goals: 0 / 1 - Coq (native): 0 (unsuccess: 1) ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - output - - 1 0.0% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.res.oracle deleted file mode 100644 index 0b38dce72acbbe0166038cebb9c17e7bb744cfdb..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.1.res.oracle +++ /dev/null @@ -1,16 +0,0 @@ -# frama-c -wp -wp-timeout 100 -wp-steps 5 [...] -[kernel] Parsing float_format.i (no preprocessing) -[kernel:parser:decimal-float] float_format.i:10: Warning: - Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. - (warn-once: no further messages from category 'parser:decimal-float' will be emitted) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] Warning: native support for alt-ergo is deprecated, use why3 instead -[wp] 1 goal scheduled -[wp] [Alt-Ergo (native)] Goal typed_output_ensures_KO : Unsuccess -[wp] Proved goals: 0 / 1 - Alt-Ergo (native): 0 (unsuccess: 1) ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - output - - 1 0.0% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.res.oracle similarity index 92% rename from src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.res.oracle rename to src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.res.oracle index 876b56b73ef0f3a6041262e3113ca6d40502a1f5..cb9d081888bd4d94a305be62ff79c2f550a58ce1 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.2.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle_qualif/float_format.res.oracle @@ -1,6 +1,6 @@ # frama-c -wp -wp-timeout 100 -wp-steps 5 [...] [kernel] Parsing float_format.i (no preprocessing) -[kernel:parser:decimal-float] float_format.i:10: Warning: +[kernel:parser:decimal-float] float_format.i:8: Warning: Floating-point constant 0.2 is not represented exactly. Will use 0x1.999999999999ap-3. (warn-once: no further messages from category 'parser:decimal-float' will be emitted) [wp] Running WP plugin... diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/inductive.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/inductive.res.oracle deleted file mode 100644 index 6ba6b85a7b863238c853add006c0bbf2c5705c78..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/inductive.res.oracle +++ /dev/null @@ -1,16 +0,0 @@ -# frama-c -wp -wp-timeout 240 [...] -[kernel] Parsing inductive.c (with preprocessing) -[wp] Running WP plugin... -[wp] Warning: native support for coq is deprecated, use tip instead -[wp] 2 goals scheduled -[wp] [Coq] Goal typed_lemma_offset : Saved script -[wp] [Coq (native)] Goal typed_lemma_offset : Valid -[wp] [Coq] Goal typed_lemma_test : Saved script -[wp] [Coq (native)] Goal typed_lemma_test : Valid -[wp] Proved goals: 2 / 2 - Qed: 0 - Coq (native): 2 ------------------------------------------------------------- - Axiomatics WP Alt-Ergo Total Success - Lemma - - 2 100% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.1.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.1.res.oracle index 773a5245836281bda1c4734cac463b776176e985..69ac94a86894ed67b60991613cedc80023e2b4ad 100644 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.1.res.oracle +++ b/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.1.res.oracle @@ -1,53 +1,20 @@ -# frama-c -wp -wp-timeout 100 -wp-steps 1500 [...] +# frama-c -wp -wp-timeout 100 -wp-steps 10 [...] [kernel] Parsing math.i (no preprocessing) [wp] Running WP plugin... [wp] Warning: Missing RTE guards -[wp] Warning: native support for alt-ergo is deprecated, use why3 instead -[wp] 30 goals scheduled -[wp] [Alt-Ergo (native)] Goal typed_lemma_abs_neg : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_abs_pos : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_atan_sin_cos : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_cosh_opp : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_distance : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_exp_log_add_mul : Valid -[wp] [Qed] Goal typed_lemma_exp_pos : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_log_exp_mul_add : Valid -[wp] [Qed] Goal typed_lemma_max_ac : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_max_inf : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_max_or : Valid -[wp] [Qed] Goal typed_lemma_min_ac : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_min_inf : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_min_or : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_pow_2 : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_sinh_opp : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_sqrt_mono : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_sqrt_pos : Valid -[wp] [Alt-Ergo (native)] Goal typed_lemma_tanh_opp : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_sin_asin : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_sin_asin_in_range : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_cos_acos : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_cos_acos_in_range : Valid -[wp] [Qed] Goal typed_ok_ensures_tan_atan : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_log_pow : Valid -[wp] [Qed] Goal typed_ok_ensures_log_exp : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_exp_log : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_min_plus_distrib : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_sqrt_pos : Valid -[wp] [Alt-Ergo (native)] Goal typed_ok_ensures_sqrt_pos0 : Valid -[wp] Proved goals: 30 / 30 - Qed: 5 - Alt-Ergo (native): 25 ------------------------------------------------------------- - Axiomatics WP Alt-Ergo Total Success - Lemma 3 - 19 100% +[wp] 9 goals scheduled +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_sin_asin : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_cos_acos : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_asin_sin : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_acos_cos : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_atan_tan : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_log_pow : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_exp_log : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_exp_log_add_mul : Unsuccess +[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_sqrt_pos : Unsuccess +[wp] Proved goals: 0 / 9 + Alt-Ergo: 0 (unsuccess: 9) ------------------------------------------------------------ Functions WP Alt-Ergo Total Success - ok 2 - 11 100% + ko - - 9 0.0% ------------------------------------------------------------ -------------------------------------------------------------- -Axiomatics WP Alt-Ergo (Native) Total Success -Lemma 3 16 19 100% -------------------------------------------------------------- -Functions WP Alt-Ergo (Native) Total Success -ok 2 9 11 100% -------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.res.oracle deleted file mode 100644 index 69ac94a86894ed67b60991613cedc80023e2b4ad..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.2.res.oracle +++ /dev/null @@ -1,20 +0,0 @@ -# frama-c -wp -wp-timeout 100 -wp-steps 10 [...] -[kernel] Parsing math.i (no preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] 9 goals scheduled -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_sin_asin : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_cos_acos : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_asin_sin : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_acos_cos : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_atan_tan : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_log_pow : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_exp_log : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_exp_log_add_mul : Unsuccess -[wp] [Alt-Ergo] Goal typed_ko_ensures_ko_sqrt_pos : Unsuccess -[wp] Proved goals: 0 / 9 - Alt-Ergo: 0 (unsuccess: 9) ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - ko - - 9 0.0% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.3.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.3.res.oracle deleted file mode 100644 index d0872807ed58e412921ecbda4ffd377fb27c85eb..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/math.3.res.oracle +++ /dev/null @@ -1,25 +0,0 @@ -# frama-c -wp -wp-timeout 100 -wp-steps 10 [...] -[kernel] Parsing math.i (no preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] Warning: native support for alt-ergo is deprecated, use why3 instead -[wp] 9 goals scheduled -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_sin_asin : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_cos_acos : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_asin_sin : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_acos_cos : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_atan_tan : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_log_pow : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_exp_log : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_exp_log_add_mul : Unsuccess -[wp] [Alt-Ergo (native)] Goal typed_ko_ensures_ko_sqrt_pos : Unsuccess -[wp] Proved goals: 0 / 9 - Alt-Ergo (native): 0 (unsuccess: 9) ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - ko - - 9 0.0% ------------------------------------------------------------- -------------------------------------------------------------- -Functions WP Alt-Ergo (Native) Total Success -ko - - 9 0.0% -------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/oracle_qualif/region_to_coq.res.oracle b/src/plugins/wp/tests/wp_plugin/oracle_qualif/region_to_coq.res.oracle deleted file mode 100644 index 724f423702b11d463ff5957c6ae6f936e1558ca3..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/oracle_qualif/region_to_coq.res.oracle +++ /dev/null @@ -1,20 +0,0 @@ -# frama-c -wp [...] -[kernel] Parsing region_to_coq.i (no preprocessing) -[wp] Running WP plugin... -[wp] Warning: Missing RTE guards -[wp] Warning: native support for coq is deprecated, use tip instead -[wp] 4 goals scheduled -[wp] [Coq] Goal typed_copy_loop_invariant_preserved : Saved script -[wp] [Coq (native)] Goal typed_copy_loop_invariant_preserved : Valid -[wp] [Coq] Goal typed_copy_loop_invariant_established : Saved script -[wp] [Coq (native)] Goal typed_copy_loop_invariant_established : Valid -[wp] [Qed] Goal typed_copy_loop_assigns_part1 : Valid -[wp] [Coq] Goal typed_copy_loop_assigns_part2 : Saved script -[wp] [Coq (native)] Goal typed_copy_loop_assigns_part2 : Valid -[wp] Proved goals: 4 / 4 - Qed: 1 - Coq (native): 3 ------------------------------------------------------------- - Functions WP Alt-Ergo Total Success - copy 1 - 4 100% ------------------------------------------------------------- diff --git a/src/plugins/wp/tests/wp_plugin/region_to_coq.i b/src/plugins/wp/tests/wp_plugin/region_to_coq.i deleted file mode 100644 index 24ca4a86019fb5939ae553d2d1b18396e78c6a47..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/region_to_coq.i +++ /dev/null @@ -1,14 +0,0 @@ -/* run.config - DONTRUN: -*/ -/* run.config_qualif - OPT: -wp-prover native:coq -wp-coq-script %{dep:@PTEST_DIR@/region_to_coq.script} -*/ - -void copy(int* a, unsigned int n, int* b) -{ - /*@ loop invariant 0 <= i <= n ; - loop assigns i, b[0..n-1]; */ - for(unsigned int i = 0; i < n; ++i) - b[i] = a[i]; -} diff --git a/src/plugins/wp/tests/wp_plugin/region_to_coq.script b/src/plugins/wp/tests/wp_plugin/region_to_coq.script deleted file mode 100644 index ec805f70b549129917db4df73cf1b8a5a297c2f2..0000000000000000000000000000000000000000 --- a/src/plugins/wp/tests/wp_plugin/region_to_coq.script +++ /dev/null @@ -1,36 +0,0 @@ -(* Generated by Frama-C WP *) - -Goal typed_copy_loop_assigns_part2. -Hint *,b,copy,i,loop-assigns,part-1. -Proof. - intros. - unfold included, shift_sint32. - unfold base, offset, shift ; simpl. - omega. -Qed. - -Goal typed_copy_loop_invariant_established. -Hint copy,established. -Proof. - unfold is_uint32 ; intros ; omega. -Qed. - -Goal typed_copy_loop_invariant_preserved. -Hint copy,preserved. -Proof. - intros i n Li Ui Ln _ Hi Hn. - Require Import Lia. - assert (Hi_1: (1+i <= n)%Z) by lia. - unfold is_uint32, to_uint32. - unfold to_range. - rewrite Z.add_0_l. - repeat rewrite Z.sub_0_r. - unfold is_uint32 in Hi. - assert (Bs: (1 + i = 4294967296)%Z \/ (1 + i < 4294967296)%Z) by lia. - inversion_clear Bs as [ Eq | Lower ]. - - rewrite <- Eq. - rewrite Z_mod_same ; lia. - - rewrite Z.mod_small ; lia. -Qed. - - diff --git a/src/plugins/wp/wp_parameters.ml b/src/plugins/wp/wp_parameters.ml index c19cacce8093b68ed2bd084884c2be79c404a9ab..56f0e0a3e6d676db2e5a28960f18fda513676512 100644 --- a/src/plugins/wp/wp_parameters.ml +++ b/src/plugins/wp/wp_parameters.ml @@ -885,105 +885,6 @@ module BackTrack = Int Limits backtracking when applying strategies." end) -let () = Parameter_customize.set_group wp_prover_options -module Script = - String(struct - let option_name = "-wp-coq-script" - let arg_name = "f.script" - let default = "" - let help = "Set user's file for Coq proofs." - end) - -let () = Parameter_customize.set_group wp_prover_options -module UpdateScript = - True(struct - let option_name = "-wp-update-coq-script" - let help = "If turned off, do not save or modify user's proofs." - end) - -let () = Parameter_customize.set_group wp_prover_options -module CoqTimeout = - Int(struct - let option_name = "-wp-coq-timeout" - let default = 30 - let arg_name = "n" - let help = - Printf.sprintf - "Set the timeout (in seconds) for Coq (default: %d)." default - end) - -let () = Parameter_customize.set_group wp_prover_options -module CoqCompiler = - String(struct - let option_name = "-wp-coqc" - let default = "coqc" - let arg_name = "cmd" - let help = - Printf.sprintf - "Set the command line to run Coq Compiler (default 'coqc')." - end) - -let () = Parameter_customize.set_group wp_prover_options -module CoqIde = - String(struct - let option_name = "-wp-coqide" - let default = "coqide" - let arg_name = "cmd" - let help = - Printf.sprintf - "Set the command line to run CoqIde (default 'coqide')\n\ - If the command-line contains 'emacs' (case insentive),\n\ - a coq-project file is used instead of coq options." - end) - -let () = Parameter_customize.set_group wp_prover_options -module CoqProject = - String(struct - let option_name = "-wp-coq-project" - let default = "_CoqProject" - let arg_name = "file" - let help = - Printf.sprintf - "Set the Coq-Project file to used with Proof General (default '_CoqProject')" - end) - -let () = Parameter_customize.set_group wp_prover_options -module CoqTactic = - String - (struct - let option_name = "-wp-coq-tactic" - let arg_name = "proof" - let default = "auto with zarith" - let help = "Default tactic for Coq" - end) - -let () = Parameter_customize.set_group wp_prover_options -module TryHints = - False - (struct - let option_name = "-wp-coq-tryhints" - let help = "Try scripts from other goals (see also -wp-hints)" - end) - -let () = Parameter_customize.set_group wp_prover_options -module Hints = - Int - (struct - let option_name = "-wp-coq-hints" - let arg_name = "n" - let default = 3 - let help = "Maximum number of proposed Coq scripts (default 3)" - end) - -let () = Parameter_customize.set_group wp_prover_options -module CoqLibs = - String_list - (struct - let option_name = "-wp-coq-lib" - let arg_name = "*.v,*.vo" - let help = "Additional libraries for Coq" - end) - let () = Parameter_customize.set_group wp_prover_options let () = Parameter_customize.no_category () module Why3Flags = @@ -994,43 +895,6 @@ module Why3Flags = let help = "Additional options for Why3" end) -let () = Parameter_customize.set_group wp_prover_options -module AltErgo = - String(struct - let option_name = "-wp-alt-ergo" - let default = "alt-ergo" - let arg_name = "<cmd>" - let help = "Command to run alt-ergo (default: 'alt-ergo')" - end) - -let () = Parameter_customize.set_group wp_prover_options -module AltGrErgo = - String(struct - let option_name = "-wp-altgr-ergo" - let default = "altgr-ergo" - let arg_name = "<cmd>" - let help = "Command to run alt-ergo user interface (default: 'altgr-ergo')" - end) - -let () = Parameter_customize.set_group wp_prover_options -module AltErgoLibs = - String_list - (struct - let option_name = "-wp-alt-ergo-lib" - let arg_name = "*.mlw" - let help = "Additional library file for Alt-Ergo" - end) - -let () = Parameter_customize.set_group wp_prover_options -let () = Parameter_customize.no_category () -module AltErgoFlags = - String_list - (struct - let option_name = "-wp-alt-ergo-opt" - let arg_name = "option,..." - let help = "Additional options for Alt-Ergo" - end) - (* ------------------------------------------------------------------------ *) (* --- PO Management --- *) (* ------------------------------------------------------------------------ *) diff --git a/src/plugins/wp/wp_parameters.mli b/src/plugins/wp/wp_parameters.mli index 85685c47192e179fd4cace0b5c0f1029e6406335..e1b72778280ab32247250c2c94c2bdc4746cb71d 100644 --- a/src/plugins/wp/wp_parameters.mli +++ b/src/plugins/wp/wp_parameters.mli @@ -118,29 +118,15 @@ module CacheEnv: Parameter_sig.Bool module CacheDir: Parameter_sig.String module CachePrint: Parameter_sig.Bool module Drivers: Parameter_sig.String_list -module Script: Parameter_sig.String -module UpdateScript: Parameter_sig.Bool module Timeout: Parameter_sig.Int module SmokeTimeout: Parameter_sig.Int module InteractiveTimeout: Parameter_sig.Int module TimeExtra: Parameter_sig.Int module TimeMargin: Parameter_sig.Int -module CoqTimeout: Parameter_sig.Int -module CoqCompiler : Parameter_sig.String -module CoqIde : Parameter_sig.String -module CoqProject : Parameter_sig.String module Steps: Parameter_sig.Int module Procs: Parameter_sig.Int module ProofTrace: Parameter_sig.Bool -module CoqLibs: Parameter_sig.String_list -module CoqTactic: Parameter_sig.String -module Hints: Parameter_sig.Int -module TryHints: Parameter_sig.Bool module Why3Flags: Parameter_sig.String_list -module AltErgo: Parameter_sig.String -module AltGrErgo: Parameter_sig.String -module AltErgoLibs: Parameter_sig.String_list -module AltErgoFlags: Parameter_sig.String_list module Auto: Parameter_sig.String_list module AutoDepth: Parameter_sig.Int diff --git a/src/plugins/wp/wpo.ml b/src/plugins/wp/wpo.ml index 699646cfaa8ba4a6d89e4dc6fab44c12549037ea..a309ee7ed01ee5101ff5e455e720ff4298f7056f 100644 --- a/src/plugins/wp/wpo.ml +++ b/src/plugins/wp/wpo.ml @@ -106,9 +106,7 @@ struct let file_goal ~pid ~model ~prover = let ext = match prover with | Qed -> "qed" - | NativeAltErgo -> "mlw" | Why3 _ -> "why" - | NativeCoq -> "v" | Tactical -> "tac" in let id = WpPropId.get_propid pid in @@ -117,9 +115,7 @@ struct let file_kf ~kf ~model ~prover = let ext = match prover with | Qed -> "qed" - | NativeAltErgo -> "mlw" | Why3 _ -> "why" - | NativeCoq -> "v" | Tactical -> "tac" in let id = (Kf.vi kf).vname in @@ -470,7 +466,7 @@ module ProverType = type t = prover include Datatype.Undefined let name = "Wpo.prover" - let reprs = [ NativeAltErgo; NativeCoq; Qed ] + let reprs = [ Qed ] end) (* to get a "reasonable" API doc: *) let () = Type.set_ml_name ProverType.ty (Some "Wpo.prover")