Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
120
Issues
120
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
d548d517
Commit
d548d517
authored
Apr 01, 2017
by
Mário Pereira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record types refinement (wip)
Code refactoring.
parent
1e8147c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
src/mlw/pmodule.ml
src/mlw/pmodule.ml
+13
-13
No files found.
src/mlw/pmodule.ml
View file @
d548d517
...
...
@@ -575,34 +575,34 @@ let cl_save_rs cl s s' =
|
RLnone
,
RLnone
->
()
|
_
->
assert
false
(*
(*
Mário: recovered this commented function *)
let
ls_of_rs
rs
=
match
rs
.
rs_logic
with
|
RLls
ls
->
ls
|
_
->
assert
false
*)
exception
PreStop
of
rsymbol
(* Remove after migration to OCaml 4.04+ *)
let
in_set_exn
exn
p
srs
=
(* let exception PreStop of rsymbol in -> after migration to OCaml 4.04+ *)
try
Srs
.
iter
(
fun
rs
->
if
p
rs
then
raise
(
PreStop
rs
))
srs
;
raise
exn
with
PreStop
rs
->
rs
let
clone_type_record
cl
s
d
s'
d'
=
let
id
=
s
.
its_ts
.
ts_name
in
(* check if fields from former type are also declared in the new type *)
let
s_plj'
=
Srs
.
of_list
d'
.
itd_fields
in
(* check if fields from former type are also declared in the new type *)
let
match_pj
({
rs_field
=
pj
}
as
rs
)
=
let
pj
=
Opt
.
get
pj
in
let
pj_str
=
pj
.
pv_vs
.
vs_name
.
id_string
in
let
pj_ity
=
pj
.
pv_ity
in
let
pj_ght
=
pj
.
pv_ghost
in
let
in_set
({
rs_field
=
pj'
}
as
rs'
)
=
let
pj'
=
Opt
.
get
pj'
in
let
in_set
{
rs_field
=
pj'
}
=
let
pj'
=
Opt
.
get
pj'
in
let
pj'_str
=
pj'
.
pv_vs
.
vs_name
.
id_string
in
let
pj'_ity
=
pj'
.
pv_ity
in
let
pj'_ght
=
pj'
.
pv_ghost
in
let
ls
,
ls'
=
match
rs
.
rs_logic
,
rs'
.
rs_logic
with
|
RLls
ls
,
RLls
ls'
->
ls
,
ls'
|
_
->
assert
false
in
(* FIXME: refractor this code. I am not happy with its organization *)
cl
.
ls_table
<-
Mls
.
add
ls
ls'
cl
.
ls_table
;
(* TODO? : populate rs_table *)
pj_str
=
pj'_str
&&
ity_equal
pj_ity
pj'_ity
&&
pj_ght
=
pj'_ght
in
Srs
.
exists
in_set
s_plj'
in
let
contains_all
=
List
.
for_all
match_pj
d
.
itd_fields
in
if
not
contains_all
then
raise
(
BadInstance
id
);
let
rs'
=
in_set_exn
(
BadInstance
id
)
in_set
s_plj'
in
let
ls
,
ls'
=
ls_of_rs
rs
,
ls_of_rs
rs'
in
cl
.
ls_table
<-
Mls
.
add
ls
ls'
cl
.
ls_table
in
(* TODO? : populate rs_table *)
List
.
iter
match_pj
d
.
itd_fields
;
cl
.
ts_table
<-
Mts
.
add
s
.
its_ts
s'
cl
.
ts_table
let
clone_type_decl
inst
cl
tdl
kn
=
...
...
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