Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
5b56b45d
Commit
5b56b45d
authored
Mar 18, 2010
by
Andrei Paskevich
Browse files
accumulate the cloning history in split_theory
parent
cba5e2df
Changes
2
Show whitespace changes
Inline
Side-by-side
src/core/task.ml
View file @
5b56b45d
...
@@ -40,11 +40,19 @@ let cloned_from cl i1 i2 =
...
@@ -40,11 +40,19 @@ let cloned_from cl i1 i2 =
try
i1
=
i2
||
Sid
.
mem
i2
(
Mid
.
find
i1
cl
.
cl_map
)
try
i1
=
i2
||
Sid
.
mem
i2
(
Mid
.
find
i1
cl
.
cl_map
)
with
Not_found
->
false
with
Not_found
->
false
let
add_clone
=
let
merge_clone
=
let
add
m
id
s
acc
=
let
s
=
try
Sid
.
union
s
(
Mid
.
find
id
m
)
with
Not_found
->
s
in
Mid
.
add
id
s
acc
in
let
r
=
ref
0
in
let
r
=
ref
0
in
fun
cl
th
sl
->
fun
cl
th
->
incr
r
;
if
Mid
.
is_empty
th
.
th_clone
then
cl
else
{
cl_map
=
merge_clone
cl
.
cl_map
th
sl
;
cl_tag
=
!
r
}
{
cl_map
=
Mid
.
fold
(
add
cl
.
cl_map
)
th
.
th_clone
cl
.
cl_map
;
cl_tag
=
(
incr
r
;
!
r
)
}
(** Known identifiers *)
(** Known identifiers *)
...
@@ -207,9 +215,10 @@ let rec use_export names acc td =
...
@@ -207,9 +215,10 @@ let rec use_export names acc td =
|
Use
th
when
Sid
.
mem
th
.
th_name
used
->
|
Use
th
when
Sid
.
mem
th
.
th_name
used
->
acc
acc
|
Use
th
->
|
Use
th
->
let
names
=
Some
Spr
.
empty
in
let
used
=
Sid
.
add
th
.
th_name
used
in
let
used
=
Sid
.
add
th
.
th_name
used
in
let
cl
=
merge_clone
cl
th
in
let
acc
=
used
,
cl
,
res
,
task
in
let
acc
=
used
,
cl
,
res
,
task
in
let
names
=
Some
Spr
.
empty
in
List
.
fold_left
(
use_export
names
)
acc
th
.
th_decls
List
.
fold_left
(
use_export
names
)
acc
th
.
th_decls
|
Decl
d
->
|
Decl
d
->
begin
match
d
.
d_node
with
begin
match
d
.
d_node
with
...
...
src/core/theory.mli
View file @
5b56b45d
...
@@ -90,8 +90,6 @@ val clone_export : theory_uc -> theory -> th_inst -> theory_uc
...
@@ -90,8 +90,6 @@ val clone_export : theory_uc -> theory -> th_inst -> theory_uc
val
clone_fold
:
((
'
a
*
clone_map
)
->
tdecl
->
(
'
a
*
clone_map
))
->
val
clone_fold
:
((
'
a
*
clone_map
)
->
tdecl
->
(
'
a
*
clone_map
))
->
(
'
a
*
clone_map
)
->
theory
->
th_inst
->
(
'
a
*
clone_map
)
(
'
a
*
clone_map
)
->
theory
->
th_inst
->
(
'
a
*
clone_map
)
val
merge_clone
:
clone_map
->
theory
->
(
ident
*
ident
)
list
->
clone_map
(* exceptions *)
(* exceptions *)
exception
NonLocal
of
ident
exception
NonLocal
of
ident
...
...
Write
Preview
Markdown
is supported
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