Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
35c0d32e
Commit
35c0d32e
authored
Jun 03, 2011
by
Andrei Paskevich
Browse files
separate symbol discrimination from polymorphism encoding
parent
82362868
Changes
27
Hide whitespace changes
Inline
Side-by-side
Makefile.in
View file @
35c0d32e
...
...
@@ -125,9 +125,8 @@ LIB_TRANSFORM = simplify_recursive_definition simplify_formula \
inlining split_goal
\
eliminate_definition eliminate_algebraic
\
eliminate_inductive eliminate_let eliminate_if
\
encoding_distinction
\
encoding_enumeration encoding
\
libencoding encoding_select
\
encoding_enumeration encoding libencoding
\
encoding_distinction encoding_select
\
encoding_decorate encoding_bridge
\
encoding_explicit encoding_guard encoding_sort
\
encoding_instantiate simplify_array filter_trigger
\
...
...
bench/encoding/create_bench.sh
View file @
35c0d32e
...
...
@@ -2,13 +2,13 @@
PROVER
=
$1
SELECT_INST
=
Inst_
$2
SELECT_KEPT
=
K
ept_
$3
SELECT_LS
KEP
T
=
Ls
kep
t_
$4
PRODUCT_MODE
=
Produc
t_
$5
SELECT_
LS
KEPT
=
Lsk
ept_
$3
SELECT_LS
INS
T
=
Ls
ins
t_
$4
SELECT_KEPT
=
Kep
t_
$5
ENCO_KEPT
=
Kept_
$6
ENCO_POLY
=
Poly_
$7
BENCH_NAME
=
"
${
PROVER
}
_
${
SELECT_INST
}
_
${
SELECT_KEPT
}
_
${
SELECT_LS
KEP
T
}
_
${
PRODUCT_MODE
}
_
${
ENCO_KEPT
}
_
${
ENCO_POLY
}
"
BENCH_NAME
=
"
${
PROVER
}
_
${
SELECT_INST
}
_
${
SELECT_
LS
KEPT
}
_
${
SELECT_LS
INS
T
}
_
${
SELECT_KEPT
}
_
${
ENCO_KEPT
}
_
${
ENCO_POLY
}
"
FILE
=
${
BENCH_NAME
}
.rc
...
...
@@ -17,9 +17,9 @@ sed template_rc \
-e
"s/@BENCH_NAME@/
$BENCH_NAME
/"
\
-e
"s/@PROVER@/
$PROVER
/"
\
-e
"s/@SELECT_INST@/
$SELECT_INST
/"
\
-e
"s/@SELECT_KEPT@/
$SELECT_KEPT
/"
\
-e
"s/@SELECT_LSKEPT@/
$SELECT_LSKEPT
/"
\
-e
"s/@PRODUCT_MODE@/
$PRODUCT_MODE
/"
\
-e
"s/@SELECT_LSINST@/
$SELECT_LSINST
/"
\
-e
"s/@SELECT_KEPT@/
$SELECT_KEPT
/"
\
-e
"s/@ENCO_KEPT@/
$ENCO_KEPT
/"
\
-e
"s/@ENCO_POLY@/
$ENCO_POLY
/"
\
>
$FILE
...
...
@@ -38,4 +38,4 @@ sed template_rc \
# *\) *)
# echo "Unknown error"; *)
# exit 2 *)
# esac *)
\ No newline at end of file
# esac *)
bench/encoding/gen_allbench.sh
View file @
35c0d32e
#!/bin/dash
PROVER
=
"z3 cvc3 yices"
SELECT_INST
=
"no
thing
goal
context
"
SELECT_KEPT
=
"no
thing
goal
context
"
SELECT_LS
KEP
T
=
"no
thing
goal
context
"
PRODUCT_MODE
=
"nothing only_kept some_kept
"
SELECT_INST
=
"no
ne
goal
all
"
SELECT_
LS
KEPT
=
"no
ne
goal
all
"
SELECT_LS
INS
T
=
"no
ne
goal
all
"
SELECT_KEPT
=
"none goal all
"
ENCO_KEPT
=
"twin partial"
ENCO_POLY
=
"deco explicit guard"
...
...
@@ -12,10 +12,10 @@ dirname=$(dirname $0)
for
P
in
$PROVER
;
do
for
SI
in
$SELECT_INST
;
do
for
SLK
in
$SELECT_LSKEPT
;
do
for
SLI
in
$SELECT_LSINST
;
do
for
SK
in
$SELECT_KEPT
;
do
for
SL
in
$SELECT_LSKEPT
;
do
for
PM
in
$PRODUCT_MODE
;
do
for
EK
in
$ENCO_KEPT
;
do
for
EP
in
$ENCO_POLY
;
do
$dirname
/create_bench.sh
$P
$SI
$SK
$SL
$PM
$EK
$EP
done done done done done done done
\ No newline at end of file
$dirname
/create_bench.sh
$P
$SI
$SLK
$SLI
$SK
$EK
$EP
done done done done done done done
bench/encoding/meta.why
View file @
35c0d32e
...
...
@@ -23,52 +23,52 @@ theory Poly_deco
meta "enco_poly" "decorate"
end
theory Inst_no
thing
meta "select_inst" "no
thing
"
theory Inst_no
ne
meta "select_inst" "no
ne
"
end
theory Inst_goal
meta "select_inst" "goal"
end
theory Inst_
context
theory Inst_
all
meta "select_inst" "all"
end
theory
K
ept_no
thing
meta "select_kept" "no
thing
"
theory
Lsk
ept_no
ne
meta "select_
ls
kept" "no
ne
"
end
theory
K
ept_goal
meta "select_kept" "goal"
theory
Lsk
ept_goal
meta "select_
ls
kept" "goal"
end
theory
K
ept_
context
meta "select_kept" "all"
theory
Lsk
ept_
all
meta "select_
ls
kept" "all"
end
theory Ls
kep
t_no
thing
meta "select_ls
kep
t" "no
thing
"
theory Ls
ins
t_no
ne
meta "select_ls
ins
t" "no
ne
"
end
theory Ls
kep
t_goal
meta "select_ls
kep
t" "goal"
theory Ls
ins
t_goal
meta "select_ls
ins
t" "goal"
end
theory Ls
kept_context
meta "select_ls
kep
t" "all"
theory Ls
inst_all
meta "select_ls
ins
t" "all"
end
theory
Product_nothing
meta "
completion_mode" "nothing
"
theory
Kept_none
meta "
select_kept" "none
"
end
theory
Product_only_kept
meta "
completion_mode" "only_kept
"
theory
Kept_goal
meta "
select_kept" "goal
"
end
theory
Product_some_kept
meta "
completion_mode" "some_kept
"
theory
Kept_all
meta "
select_kept" "all
"
end
theory KeptIntReal
...
...
@@ -76,4 +76,4 @@ theory KeptIntReal
use real.Real
meta "encoding : kept" type Int.int
meta "encoding : kept" type Real.real
end
\ No newline at end of file
end
bench/encoding/template_rc
View file @
35c0d32e
...
...
@@ -2,9 +2,9 @@
prover = "@PROVER@"
loadpath = "."
use = "meta.@SELECT_INST@"
use = "meta.@SELECT_KEPT@"
use = "meta.@SELECT_LSKEPT@"
use = "meta.@PRODUCT_MODE@"
use = "meta.@SELECT_LSINST@"
use = "meta.@SELECT_KEPT@"
use = "meta.@ENCO_KEPT@"
use = "meta.@ENCO_POLY@"
...
...
drivers/alt_ergo.drv
View file @
35c0d32e
...
...
@@ -13,7 +13,7 @@ time "Valid (%s)"
time "why3cpulimit time : %s s"
(* À discuter *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
drivers/alt_ergo_smt2.drv
View file @
35c0d32e
...
...
@@ -9,7 +9,7 @@ valid "^unsat"
unknown "^\\(unknown\\|sat\\|Fail\\)" "Unknown"
time "why3cpulimit time : %s s"
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
drivers/coq.drv
View file @
35c0d32e
...
...
@@ -11,7 +11,7 @@ prelude "(* This file is generated by Why3's Coq driver *)"
prelude "(* Beware! Only edit allowed sections below *)"
(* À discuter *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
drivers/cvc3_bare.drv
View file @
35c0d32e
...
...
@@ -10,7 +10,7 @@ unknown "Unknown." ""
time "why3cpulimit time : %s s"
(* À discuter *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
@@ -21,6 +21,7 @@ transformation "eliminate_algebraic_smt"
transformation "simplify_formula"
(*transformation "simplify_trivial_quantification"*)
transformation "discriminate"
transformation "encoding_smt"
theory BuiltIn
...
...
drivers/discrimination.gen
View file @
35c0d32e
theory BuiltIn
meta "select_inst" "goal"
meta "select_kept" "
goal
"
meta "select_ls
kep
t" "
nothing
"
meta "
completion_mode
" "on
ly_kept
"
meta "select_
ls
kept" "
none
"
meta "select_ls
ins
t" "
goal
"
meta "
select_kept
" "
n
on
e
"
end
drivers/gappa.drv
View file @
35c0d32e
...
...
@@ -11,7 +11,7 @@ unknown "no contradiction was found\\|some enclosures were not satisfied" "Unkno
time "why3cpulimit time : %s s"
fail "Error: \\(.*\\)" "\\1"
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
transformation "inline_all"
...
...
drivers/simplify.drv
View file @
35c0d32e
...
...
@@ -9,7 +9,7 @@ valid "\\bValid\\b"
unknown "\\bInvalid\\b" "Unknown"
time "why3cpulimit time : %s s"
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
drivers/tptp.drv
View file @
35c0d32e
...
...
@@ -18,7 +18,7 @@ time "why3cpulimit time : %s s"
(* to be improved *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
drivers/vampire.drv
View file @
35c0d32e
...
...
@@ -18,7 +18,7 @@ time "why3cpulimit time : %s s"
(* to be improved *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
drivers/verit.drv
View file @
35c0d32e
...
...
@@ -10,7 +10,7 @@ unknown "^\\(unknown\\|sat\\)" "Unknown"
time "why3cpulimit time : %s s"
(* À discuter *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
drivers/yices_bare.drv
View file @
35c0d32e
...
...
@@ -10,7 +10,7 @@ unknown "\\bunknown\\b\\|\\bsat\\b\\|feature not supported: non linear problem"
time "why3cpulimit time : %s s"
(* À discuter *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
@@ -21,6 +21,7 @@ transformation "eliminate_algebraic_smt"
transformation "simplify_formula"
(*transformation "simplify_trivial_quantification"*)
transformation "discriminate"
transformation "encoding_smt"
transformation "encoding_sort"
...
...
drivers/z3_bare.drv
View file @
35c0d32e
...
...
@@ -12,7 +12,7 @@ time "why3cpulimit time : %s s"
(* À discuter *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
@@ -22,6 +22,8 @@ transformation "eliminate_algebraic_smt"
transformation "simplify_formula"
(*transformation "simplify_trivial_quantification"*)
transformation "discriminate"
transformation "encoding_smt"
theory BuiltIn
...
...
drivers/z3_smtv1.drv
View file @
35c0d32e
...
...
@@ -11,7 +11,7 @@ time "why3cpulimit time : %s s"
(* À discuter *)
transformation "simplify_recursive_definition"
(*
transformation "simplify_recursive_definition"
*)
transformation "inline_trivial"
transformation "eliminate_builtin"
...
...
src/core/trans.ml
View file @
35c0d32e
...
...
@@ -38,7 +38,6 @@ let identity x = x
let
identity_l
x
=
[
x
]
let
return
x
=
fun
_
->
x
let
bind
f
g
task
=
g
(
f
task
)
task
let
conv_res
c
f
x
=
c
(
f
x
)
...
...
@@ -57,6 +56,8 @@ end)
let
store
fn
=
Wtask
.
memoize_option
63
fn
let
bind
f
g
=
store
(
fun
task
->
g
(
f
task
)
task
)
let
fold
fn
v
=
let
h
=
Wtask
.
create
63
in
let
rewind
acc
task
=
...
...
@@ -85,9 +86,8 @@ let fold fn v =
let
fold_l
fn
v
=
fold
(
fun
task
->
list_apply
(
fn
task
))
[
v
]
let
fold_map
fn
v
t
=
conv_res
snd
(
fold
fn
(
v
,
t
))
(* We keep the order is important for the user. So we use
List.map is instead of List.map_rev *)
let
fold_map_l
fn
v
t
=
conv_res
(
List
.
map
snd
)
(
fold_l
fn
(
v
,
t
))
(* we use List.map instead of List.map_rev to preserve the order *)
let
gen_decl
add
fn
=
let
fn
=
Wdecl
.
memoize
63
fn
in
...
...
@@ -136,7 +136,7 @@ let rewriteTF fnT fnF = rewrite (TermTF.t_select fnT fnF)
let
gen_add_decl
add
decls
=
function
|
Some
{
task_decl
=
{
td_node
=
Decl
d
};
task_prev
=
prev
}
->
add_decl
(
List
.
fold_left
add
prev
decls
)
d
add_decl
(
List
.
fold_left
add
prev
decls
)
d
|
_
->
assert
false
let
add_decls
=
gen_add_decl
add_decl
...
...
src/core/trans.mli
View file @
35c0d32e
...
...
@@ -49,14 +49,11 @@ val seq_l : task tlist list -> task tlist
val
fold
:
(
task_hd
->
'
a
->
'
a
)
->
'
a
->
'
a
trans
val
fold_l
:
(
task_hd
->
'
a
->
'
a
list
)
->
'
a
->
'
a
tlist
val
fold_map
:
(
task_hd
->
'
a
*
task
->
(
'
a
*
task
))
->
'
a
->
task
->
task
trans
val
fold_map
:
(
task_hd
->
'
a
*
'
b
->
(
'
a
*
'
b
)
)
->
'
a
->
'
b
->
'
b
trans
val
fold_map_l
:
(
task_hd
->
'
a
*
'
b
->
(
'
a
*
'
b
)
list
)
->
'
a
->
'
b
->
'
b
tlist
val
fold_map_l
:
(
task_hd
->
'
a
*
task
->
(
'
a
*
task
)
list
)
->
'
a
->
task
->
task
tlist
val
decl
:
(
decl
->
decl
list
)
->
task
->
task
trans
(** [decl f acc [d1;..;dn]] returns acc@f d1@..@f dn *)
val
decl
:
(
decl
->
decl
list
)
->
task
->
task
trans
val
decl_l
:
(
decl
->
decl
list
list
)
->
task
->
task
tlist
val
tdecl
:
(
decl
->
tdecl
list
)
->
task
->
task
trans
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment