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
6caf0353
Commit
6caf0353
authored
Feb 18, 2014
by
Pietro Abate
Browse files
Fix problems in the function norm
parent
7a785c90
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/libtest/tallyingTest.ml
View file @
6caf0353
...
@@ -197,6 +197,8 @@ let norm_tests = [
...
@@ -197,6 +197,8 @@ let norm_tests = [
[P(V "A","Empty")]
[P(V "A","Empty")]
];
];
*)
*)
"Bool -> Bool"
,
"Int -> `$A"
,
mk_s
[]
;
]
]
let
test_norm
=
let
test_norm
=
...
@@ -286,6 +288,8 @@ let tallying_tests = [
...
@@ -286,6 +288,8 @@ let tallying_tests = [
[(
"((`$A , Int) | (`$B , Bool))"
,
"(Int , (Int | Bool))"
)]
,
mk_e
[
[(
"((`$A , Int) | (`$B , Bool))"
,
"(Int , (Int | Bool))"
)]
,
mk_e
[
[(
V
"A"
,
"Int"
);(
V
"B"
,
"Int"
)]
[(
V
"A"
,
"Int"
);(
V
"B"
,
"Int"
)]
];
];
[(
"[] -> []"
,
"Int -> `$A"
)]
,
[[]];
[(
"Bool -> Bool"
,
"Int -> `$A"
)]
,
[[]];
]
]
let
test_tallying
=
let
test_tallying
=
...
...
types/types.ml
View file @
6caf0353
...
@@ -2531,8 +2531,8 @@ module Tallying = struct
...
@@ -2531,8 +2531,8 @@ module Tallying = struct
let
prod
x
y
=
let
prod
x
y
=
match
S
.
is_empty
x
,
S
.
is_empty
y
with
match
S
.
is_empty
x
,
S
.
is_empty
y
with
|
true
,
true
->
S
.
empty
|
true
,
true
->
S
.
empty
|
false
,
true
->
x
|
false
,
true
->
S
.
empty
|
true
,
false
->
y
|
true
,
false
->
S
.
empt
y
|
false
,
false
->
|
false
,
false
->
S
.
fold
(
fun
m1
acc
->
S
.
fold
(
fun
m1
acc
->
S
.
fold
(
fun
m2
acc1
->
union
(
S
.
singleton
(
merge
m1
m2
))
acc1
)
y
acc
S
.
fold
(
fun
m2
acc1
->
union
(
S
.
singleton
(
merge
m1
m2
))
acc1
)
y
acc
...
@@ -2612,7 +2612,7 @@ module Tallying = struct
...
@@ -2612,7 +2612,7 @@ module Tallying = struct
CS
.
prod
acc
(
toplevel
single
norm_aux
m
(
pos
,
neg
))
CS
.
prod
acc
(
toplevel
single
norm_aux
m
(
pos
,
neg
))
)
acc
l
)
acc
l
in
in
let
accu
=
CS
.
un
sat
in
let
accu
=
CS
.
sat
in
let
accu
=
aux_base
single_atoms
normatoms
accu
(
BoolAtoms
.
get
t
.
atoms
)
in
let
accu
=
aux_base
single_atoms
normatoms
accu
(
BoolAtoms
.
get
t
.
atoms
)
in
let
accu
=
aux_base
single_chars
normchars
accu
(
BoolChars
.
get
t
.
chars
)
in
let
accu
=
aux_base
single_chars
normchars
accu
(
BoolChars
.
get
t
.
chars
)
in
let
accu
=
aux_base
single_ints
normints
accu
(
BoolIntervals
.
get
t
.
ints
)
in
let
accu
=
aux_base
single_ints
normints
accu
(
BoolIntervals
.
get
t
.
ints
)
in
...
@@ -2786,7 +2786,7 @@ module Tallying = struct
...
@@ -2786,7 +2786,7 @@ module Tallying = struct
(* remove from E \ { (alpha,t) } every occurrences of alpha
(* remove from E \ { (alpha,t) } every occurrences of alpha
* by mu X . (t{X/alpha}) with X fresh . X is a recursion variale *)
* by mu X . (t{X/alpha}) with X fresh . X is a recursion variale *)
(* XXX : substvariance remove all previously introduced fresh variables *)
(* XXX : substvariance remove all previously introduced fresh variables *)
let
x
=
substvariance
(
Positive
.
substitute
t
alpha
)
in
let
x
=
(*
substvariance
*)
(
Positive
.
substitute
t
alpha
)
in
let
es
=
CS
.
E
.
fold
(
fun
beta
s
acc
->
CS
.
E
.
add
beta
(
subst
s
(
alpha
,
x
))
acc
)
e1
CS
.
E
.
empty
in
let
es
=
CS
.
E
.
fold
(
fun
beta
s
acc
->
CS
.
E
.
add
beta
(
subst
s
(
alpha
,
x
))
acc
)
e1
CS
.
E
.
empty
in
aux
((
CS
.
E
.
add
alpha
x
sol
)
,
(
CS
.
E
.
add
alpha
x
acc
))
es
aux
((
CS
.
E
.
add
alpha
x
sol
)
,
(
CS
.
E
.
add
alpha
x
acc
))
es
in
in
...
...
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