Commit 683e162e authored by François Bobot's avatar François Bobot

cvc3 native syntax allows to use built-in arrays

parent faa4876c
......@@ -133,7 +133,7 @@ LIB_TRANSFORM = simplify_recursive_definition simplify_formula \
encoding_arrays \
introduction abstraction close_epsilon lift_epsilon
LIB_PRINTER = print_real alt_ergo why3 smt smt2 coq tptp simplify gappa
LIB_PRINTER = print_real alt_ergo why3 smt smt2 coq tptp simplify gappa cvc3
LIBMODULES = src/config \
$(addprefix src/util/, $(LIB_UTIL)) \
......
(* Why driver for SMT syntax *)
prelude ";;; this is a prelude for CVC3 "
prelude "%%% this is a prelude for CVC3 "
printer "smtv1"
filename "%f-%t-%g.smt"
printer "cvc3"
filename "%f-%t-%g.cvc"
valid "unsat"
unknown "\\bunknown\\b\\|\\bsat\\b" "Unknown"
valid "Valid."
unknown "Unknown." ""
time "why3cpulimit time : %s s"
(* À discuter *)
......@@ -21,33 +21,34 @@ transformation "eliminate_algebraic_smt"
transformation "simplify_formula"
(*transformation "simplify_trivial_quantification"*)
transformation "select_array_symbol_in_goal"
transformation "instantiate_lsymbol"
transformation "encoding_smt"
transformation "encoding_sort"
theory BuiltIn
syntax type int "Int"
syntax type real "Real"
syntax logic (=) "(= %1 %2)"
syntax type int "INT"
syntax type real "REAL"
syntax logic (=) "(%1 = %2)"
meta "encoding : kept" type int
end
theory int.Int
prelude ";;; this is a prelude for CVC3 integer arithmetic"
prelude "%%% this is a prelude for CVC3 integer arithmetic"
syntax logic zero "0"
syntax logic one "1"
syntax logic (+) "(+ %1 %2)"
syntax logic (-) "(- %1 %2)"
syntax logic (*) "(* %1 %2)"
syntax logic (+) "(%1 + %2)"
syntax logic (-) "(%1 - %2)"
syntax logic (*) "(%1 * %2)"
syntax logic (-_) "(- %1)"
syntax logic (<=) "(<= %1 %2)"
syntax logic (<) "(< %1 %2)"
syntax logic (>=) "(>= %1 %2)"
syntax logic (>) "(> %1 %2)"
syntax logic (<=) "(%1 <= %2)"
syntax logic (<) "(%1 < %2)"
syntax logic (>=) "(%1 >= %2)"
syntax logic (>) "(%1 > %2)"
remove prop CommutativeGroup.Comm.Comm
remove prop CommutativeGroup.Assoc.Assoc
......@@ -69,22 +70,23 @@ end
theory real.Real
prelude ";;; this is a prelude for CVC3 real arithmetic"
prelude "%%% this is a prelude for CVC3 real arithmetic"
syntax logic zero "0.0"
syntax logic one "1.0"
syntax logic zero "0"
syntax logic one "1"
syntax logic (+) "(+ %1 %2)"
syntax logic (-) "(- %1 %2)"
syntax logic (*) "(* %1 %2)"
syntax logic (/) "(/ %1 %2)"
syntax logic (+) "(%1 + %2)"
syntax logic (-) "(%1 - %2)"
syntax logic (*) "(%1 * %2)"
syntax logic (/) "(%1 / %2)"
syntax logic (-_) "(- %1)"
syntax logic inv "(/ 1.0 %1)"
syntax logic inv "(1 / %1)"
syntax logic (<=) "(<= %1 %2)"
syntax logic (<) "(< %1 %2)"
syntax logic (>=) "(>= %1 %2)"
syntax logic (>) "(> %1 %2)"
syntax logic (<=) "(%1 <= %2)"
syntax logic (<) "(%1 < %2)"
syntax logic (>=) "(%1 >= %2)"
syntax logic (>) "(%1 > %2)"
remove prop CommutativeGroup.Comm.Comm
remove prop CommutativeGroup.Assoc.Assoc
......@@ -109,13 +111,13 @@ end
(*
(* L'encodage des types sommes bloquent cette théorie builtin *)
theory bool.Bool
syntax type bool "bool"
syntax logic True "true"
syntax logic False "false"
syntax logic andb "(and %1 %2)"
syntax logic orb "(or %1 %2)"
syntax logic xorb "(xor %1 %2)"
syntax logic notb "(not %1)"
syntax type bool "BITVECTOR(1)"
syntax logic True "0bin1"
syntax logic False "0bin0"
syntax logic andb "(%1 & %2)"
syntax logic orb "(%1 | %2)"
syntax logic xorb "(BVXOR(%1,%2))"
syntax logic notb "(~ %1)"
meta cloned "encoding_decorate : kept" type bool
end
*)
......@@ -130,6 +132,17 @@ theory int.EuclideanDivision
remove prop Div_1
end
*)
theory array.Array
syntax type t "(ARRAY %1 OF %2)"
meta "encoding : lskept" logic get
meta "encoding : lskept" logic set
meta "smt_dist_syntax" logic get, "(%1[%2])"
meta "smt_dist_syntax" logic set, "(%1 WITH [%2] := %3)"
end
(*
Local Variables:
mode: why
......
......@@ -37,7 +37,7 @@ version_switch = "-version"
version_regexp = "This is CVC3 version \\([^ \n]+\\)"
version_ok = "2.2"
version_old = "2.1"
command = "@LOCALBIN@why3-cpulimit 0 %m -s %e -timeout %t -lang smt %f"
command = "@LOCALBIN@why3-cpulimit 0 %m -s %e -timeout %t %f"
driver = "drivers/cvc3.drv"
[ATP yices]
......
......@@ -24,11 +24,12 @@ open Rc
(* magicnumber for the configuration :
- 0 before the magic number
- 1 when no loadpath meant default loadpath
- 2 current
- 2
- 5 cvc3 native
If a configuration doesn't contain the actual magic number we don't use it.*)
let magicnumber = 4
let magicnumber = 5
exception WrongMagicNumber
......
This diff is collapsed.
......@@ -83,8 +83,7 @@ let rec print_type info fmt ty = match ty.ty_node with
(print_list space (print_type info)) l
end
let find_complex_type info fmt f =
let iter () ty =
let iter_complex_type info fmt () ty =
match ty.ty_node with
| Tyapp (_,_::_) when not (Hty.mem info.complex_type ty) ->
let id = id_fresh (Pp.string_of_wnl Pretty.print_ty ty) in
......@@ -95,8 +94,16 @@ let find_complex_type info fmt f =
(print_type info) ty;
Hty.add info.complex_type ty cty
| _ -> ()
in
f_ty_fold iter () f
let find_complex_type info fmt f =
f_ty_fold (iter_complex_type info fmt) () f
let find_complex_type_expr info fmt f =
e_fold
(t_ty_fold (iter_complex_type info fmt))
(f_ty_fold (iter_complex_type info fmt))
() f
let print_type info fmt ty =
print_type info fmt
......@@ -255,6 +262,7 @@ let print_logic_decl info fmt (ls,ld) =
(print_type_value info) ls.ls_value
| Some def ->
let vsl,expr = Decl.open_ls_defn def in
find_complex_type_expr info fmt expr;
fprintf fmt "@[<hov 2>(declare-fun %a (%a) %a %a)@]@\n"
print_ident ls.ls_name
(print_var_list info) vsl
......
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