Commit 6baa20c7 authored by MARCHE Claude's avatar MARCHE Claude

preliminary support for counter-example generated by Alt-Ergo 0.95

parent d2ce8b08
This diff is collapsed.
theory T1
use import int.Int
goal G : forall x "0":int. ("cond" (x >= 42)) -> x + 3 <= 50
end
theory T2
use import int.Int
constant x : int
goal g : forall y:int. x >= y
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE why3session SYSTEM "/home/marche/why3/share/why3session.dtd">
<why3session
name="alt-ergo-models/why3session.xml">
<prover
id="0"
name="Alt-Ergo"
version="0.95-dev"/>
<file
name="../alt-ergo-models.why"
verified="false"
expanded="true">
<theory
name="T"
locfile="alt-ergo-models/../alt-ergo-models.why"
loclnum="2" loccnumb="7" loccnume="8"
verified="false"
expanded="true">
<goal
name="G"
locfile="alt-ergo-models/../alt-ergo-models.why"
loclnum="6" loccnumb="7" loccnume="8"
sum="0a4bc6d339e5bafbbd8680953a519128"
proved="false"
expanded="true"
shape="ainfix &lt;=ainfix +V0c3c50Iainfix &gt;=V0c42F">
<proof
prover="0"
timelimit="5"
memlimit="0"
edited="altmnergomnmodels-T-G_4.why"
obsolete="false"
archived="false">
<result status="unknown" time="0.00"/>
</proof>
</goal>
</theory>
</file>
</why3session>
[ATP alt-ergo-0.95]
name = "Alt-Ergo"
exec = "alt-ergo"
exec = "alt-ergo-0.95-dev"
version_switch = "-version"
version_regexp = "\\([0-9.]+-dev\\)"
version_ok = "0.95-dev"
version_bad = "0.94"
version_bad = "0.93.1"
version_bad = "0.93"
version_bad = "0.92.3"
version_bad = "0.92.2"
version_bad = "0.92.1"
version_bad = "0.92"
version_bad = "0.91"
version_bad = "0.9"
version_bad = "0.8"
command = "'@LOCALBIN@why3-cpulimit' %t %m -s %e -model %f"
driver = "drivers/alt_ergo.drv"
editor = "altgr-ergo"
[ATP alt-ergo]
name = "Alt-Ergo"
exec = "alt-ergo"
......@@ -16,6 +37,7 @@ version_bad = "0.9"
version_bad = "0.8"
command = "'@LOCALBIN@why3-cpulimit' %t %m -s %e %f"
driver = "drivers/alt_ergo.drv"
editor = "altgr-ergo"
[ATP alt-ergo]
name = "Alt-Ergo"
......@@ -291,3 +313,6 @@ command = "coqide -I %l/coq-tactic -R %l/coq Why3 %f"
[editor proofgeneral-coq]
command = "emacs23 --eval \"(setq coq-load-path '((\\\"%l/coq\\\" \\\"Why3\\\")))\" %f"
[editor altgr-ergo]
command = "altgr-ergo %f"
......@@ -46,6 +46,19 @@ let ident_printer =
let print_ident fmt id =
fprintf fmt "%s" (id_unique ident_printer id)
let print_label fmt l =
fprintf fmt "\"%s\"" l.lab_string
let version_0_95 = false (* TODO *)
let print_ident_label fmt id =
if version_0_95 then
fprintf fmt "%s %a"
(id_unique ident_printer id)
(print_list space print_label) (Slab.elements id.id_label)
else
print_ident fmt id
let forget_var v = forget_id ident_printer v.vs_name
let tv_printer =
......@@ -121,7 +134,18 @@ and print_tapp info fmt = function
| [] -> ()
| tl -> fprintf fmt "(%a)" (print_list comma (print_term info)) tl
let rec print_fmla info fmt f = match f.t_node with
let rec print_fmla info fmt f =
if version_0_95 then
match Slab.elements f.t_label with
| [] -> print_fmla_node info fmt f
| l ->
fprintf fmt "(%a : %a)"
(print_list colon print_label) l
(print_fmla_node info) f
else
print_fmla_node info fmt f
and print_fmla_node info fmt f = match f.t_node with
| Tapp ({ ls_name = id }, []) ->
print_ident fmt id
| Tapp (ls, tl) -> begin match query_syntax info.info_syn ls.ls_name with
......@@ -136,7 +160,7 @@ let rec print_fmla info fmt f = match f.t_node with
| Texists -> "exists", [] (* Alt-ergo has no triggers for exists *)
in
let forall fmt v =
fprintf fmt "%s %a:%a" q print_ident v.vs_name (print_type info) v.vs_ty
fprintf fmt "%s %a:%a" q print_ident_label v.vs_name (print_type info) v.vs_ty
in
fprintf fmt "@[(%a%a.@ %a)@]" (print_list dot forall) vl
(print_triggers info) tl (print_fmla info) f;
......
......@@ -84,6 +84,7 @@ let star fmt () = fprintf fmt "*@ "
let simple_comma fmt () = fprintf fmt ", "
let underscore fmt () = fprintf fmt "_"
let semi fmt () = fprintf fmt ";@ "
let colon fmt () = fprintf fmt ":@ "
let space fmt () = fprintf fmt "@ "
let alt fmt () = fprintf fmt "|@ "
let alt2 fmt () = fprintf fmt "@ | "
......
......@@ -89,6 +89,7 @@ val comma : formatter -> unit -> unit
val star : formatter -> unit -> unit
val simple_comma : formatter -> unit -> unit
val semi : formatter -> unit -> unit
val colon : formatter -> unit -> unit
val underscore : formatter -> unit -> unit
val equal : formatter -> unit -> unit
val arrow : formatter -> unit -> unit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment