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
bb557715
Commit
bb557715
authored
Jul 10, 2007
by
Pietro Abate
Browse files
[r2004-12-27 17:11:30 by afrisch] Small opt
Original author: afrisch Date: 2004-12-27 17:11:30+00:00
parent
fc948e3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
types/patterns.ml
View file @
bb557715
...
...
@@ -465,9 +465,8 @@ x=(1,2)
if
(
IdSet
.
is_empty
xs
)
||
(
Types
.
is_empty
t
)
then
xs
else
match
d
with
|
Cup
((
a1
,_,_
)
as
p1
,
p2
)
->
IdSet
.
cap
approx_var
seen
p2
(
Types
.
diff
t
a1
)
(
approx_var
seen
p1
(
Types
.
cap
t
a1
)
xs
)
(
approx_var
seen
p2
(
Types
.
diff
t
a1
)
xs
)
|
Cap
((
_
,
fv1
,_
)
as
p1
,
((
_
,
fv2
,_
)
as
p2
))
->
IdSet
.
cup
(
approx_var
seen
p1
t
(
IdSet
.
cap
fv1
xs
))
...
...
@@ -494,16 +493,16 @@ x=(1,2)
then
xs
else
approx_var
(
NodeSet
.
add
q
seen
)
q
.
descr
t
xs
(* Obviously not complete ! *)
let
rec
approx_nil
seen
((
a
,
fv
,
d
)
as
p
)
t
xs
=
(* assert (Types.subtype t a);
assert (IdSet.subset xs fv); *)
if
(
IdSet
.
is_empty
xs
)
||
(
Types
.
is_empty
t
)
then
xs
else
match
d
with
|
Cup
((
a1
,_,_
)
as
p1
,
p2
)
->
IdSet
.
cap
approx_nil
seen
p2
(
Types
.
diff
t
a1
)
(
approx_nil
seen
p1
(
Types
.
cap
t
a1
)
xs
)
(
approx_nil
seen
p2
(
Types
.
diff
t
a1
)
xs
)
|
Cap
((
_
,
fv1
,_
)
as
p1
,
((
_
,
fv2
,_
)
as
p2
))
->
IdSet
.
cup
(
approx_nil
seen
p1
t
(
IdSet
.
cap
fv1
xs
))
...
...
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