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
cduce
cduce
Commits
cbc5ac98
Commit
cbc5ac98
authored
Oct 16, 2013
by
Pietro Abate
Browse files
Remove quite a bit of old commented code
parent
2e8e5b6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
types/types.ml
View file @
cbc5ac98
...
...
@@ -289,21 +289,6 @@ let make () =
incr
count
;
Node
.
mk
!
count
empty
(*
let hash_cons = DescrHash.create 17000
let define n d =
DescrHash.add hash_cons d n;
n.Node.descr <- d
let cons d =
try DescrHash.find hash_cons d
with Not_found ->
incr count;
let n = Node.mk !count d in
DescrHash.add hash_cons d n; n
*)
let
define
n
d
=
n
.
Node
.
descr
<-
d
...
...
@@ -903,66 +888,17 @@ let getwit t = match (slot t).status with NEmpty w -> w | _ -> assert false
let
witness
t
=
if
is_empty
t
then
raise
Not_found
else
getwit
t
(*
let is_empty d =
(* let b1 = ClearlyEmpty.is_empty d in
let b2 = is_empty d in
assert (b2 || not b1);
Printf.eprintf "b1 = %b; b2 = %b\n" b1 b2;
b2 *)
if ClearlyEmpty.is_empty d then (Printf.eprintf "!\n"; true) else is_empty d
*)
(*
let is_empty d =
(* Format.fprintf Format.std_formatter "complex=%i@."
!complex; *)
if !complex = 0 then
(let r = is_empty d in
if !complex > 100 then
(let c = !complex in
Format.fprintf Format.std_formatter "is_empty (%i)@." c
(*Descr.dump (*!forward_print*) d*));
complex := 0; r)
else is_empty d
*)
let
non_empty
d
=
not
(
is_empty
d
)
let
disjoint
d1
d2
=
(* try match (DescrHash.find memo d1).status with
| Empty -> true
| NEmpty w when Witness.type_has d2 w -> false
| _ -> raise Not_found
with Not_found ->
try match (DescrHash.find memo d2).status with
| Empty -> true
| NEmpty w when Witness.type_has d1 w -> false
| _ -> raise Not_found
with Not_found -> *)
is_empty
(
cap
d1
d2
)
let
subtype
d1
d2
=
(* try match (DescrHash.find memo d1).status with
| Empty -> true
| NEmpty w when not (Witness.type_has d2 w) -> false
| _ -> raise Not_found
with Not_found -> *)
is_empty
(
diff
d1
d2
)
let
disjoint
d1
d2
=
is_empty
(
cap
d1
d2
)
let
subtype
d1
d2
=
is_empty
(
diff
d1
d2
)
let
equiv
d1
d2
=
(
subtype
d1
d2
)
&&
(
subtype
d2
d1
)
module
Cache
=
struct
(*
let type_has_witness t w =
Format.fprintf Format.std_formatter
"check wit:%a@." print_witness w;
let r = type_has_witness t w in
Format.fprintf Format.std_formatter "Done@.";
r
*)
type
'
a
cache
=
|
Empty
...
...
@@ -2088,18 +2024,6 @@ struct
let
check_strenghten
t
s
=
(*
let left = match (BoolPair.get t.arrow) with [ (p,[]) ] -> p | _ -> assert false in
let rec aux = function
| [] -> raise Not_found
| (p,n) :: rem ->
if (List.for_all (fun (a,b) -> check_simple left a b) p) &&
(List.for_all (fun (a,b) -> not (check_simple left a b)) n) then
{ empty with arrow = Obj.magic [ (SortedList.cup left p, n) ] } (* rework this ! *)
else aux rem
in
aux (BoolPair.get s.arrow)
*)
if
subtype
t
s
then
t
else
raise
Not_found
let
check_simple_iface
left
s1
s2
=
...
...
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