Skip to content
GitLab
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
03adebf0
Commit
03adebf0
authored
Sep 06, 2010
by
Francois Bobot
Browse files
Ajout de memo pour la distinction de fonction
parent
92c47f87
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/transform/encoding_instantiate.ml
View file @
03adebf0
...
...
@@ -46,6 +46,7 @@ module OHTyl = OrderedHashList(struct
end
)
module
Mtyl
=
Map
.
Make
(
OHTyl
)
module
Htyl
=
Hashtbl
.
Make
(
OHTyl
)
type
tenv_aux
=
{
deco
:
ty
;
...
...
@@ -191,6 +192,20 @@ let reduce_to_default menv tvar d ty =
|
Tyty
_
->
(*keep the term unfolded *)
ty_inst
tvar
ty
|
Tyterm
_
->
ty_var
d
(* Weakmemo only on the symbols *)
let
clone_lsymbol_memo
=
let
clone_lsymbol
p
=
let
h
=
Htyl
.
create
7
in
fun
arg
result
->
let
key
=
(
option_apply
arg
(
fun
r
->
r
::
arg
)
result
)
in
try
Htyl
.
find
h
key
with
Not_found
->
let
p
=
create_lsymbol
(
id_clone
p
.
ls_name
)
arg
result
in
Htyl
.
add
h
key
p
;
p
in
Wls
.
memoize
7
clone_lsymbol
let
find_logic
menv
tvar
p
tyl
ret
=
if
ls_equal
p
ps_equ
then
p
else
begin
let
inst
=
ls_app_inst
p
tyl
ret
in
...
...
@@ -225,7 +240,7 @@ let find_logic menv tvar p tyl ret =
(* (Pp.print_option Pretty.print_ty) result; *)
let
ls
=
if
List
.
for_all2
ty_equal
arg
p
.
ls_args
&&
option_eq
ty_equal
result
p
.
ls_value
then
p
else
c
reat
e_lsymbol
(
id_clone
p
.
ls_name
)
arg
result
in
then
p
else
c
lon
e_lsymbol
_memo
p
arg
result
in
let
insts
=
Mtyl
.
add
inst_l
ls
insts
in
menv
.
defined_lsymbol
<-
Mls
.
add
p
insts
menv
.
defined_lsymbol
;
menv
.
undef_lsymbol
<-
Sls
.
add
ls
menv
.
undef_lsymbol
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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