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
880ea5e9
Commit
880ea5e9
authored
May 22, 2014
by
Pietro Abate
Browse files
Add clean_type to tallying algorithm
parent
e18e076b
Changes
1
Hide whitespace changes
Inline
Side-by-side
types/types.ml
View file @
880ea5e9
...
...
@@ -3260,32 +3260,23 @@ let apply_raw s t =
(* cell i of ai contains /\k<=i s_k, cell j of aj contains /\k<=j t_k *)
let
ai
=
ref
[
|
|
]
and
aj
=
ref
[
|
|
]
in
(* let result = ref any in *)
let
tallying
i
j
=
try
let
s
=
get
ai
i
in
let
t
=
arrow
(
cons
(
get
aj
j
))
cgamma
in
let
sl
=
Tallying
.
tallying
[
(
s
,
t
)
]
in
let
new_res
=
List
.
fold_left
(
fun
tacc
e
->
let
res
=
Tallying
.
CS
.
E
.
fold
(
fun
var
subst
acc
->
Positive
.
substitute
acc
(
var
,
subst
)
)
e
gamma
in
cap
tacc
res
)
any
sl
Positive
.
clean_type
(
List
.
fold_left
(
fun
tacc
e
->
let
res
=
Tallying
.
CS
.
E
.
fold
(
fun
var
subst
acc
->
Positive
.
substitute
acc
(
var
,
subst
)
)
e
gamma
in
cap
tacc
res
)
any
sl
)
in
(* Uncomment only if we are looking for the most-precise solution *)
(* if subtype new_res !result && not (subtype !result new_res)
then begin
(* strictly improved the result, continue *)
Format.printf "Found a partial solution at %i, %i: %a@\n@."
i j Print.print new_res;
result := new_res
end
else
*)
raise
(
Found
(
new_res
,
i
,
j
,
sl
))
with
Tallying
.
Step1Fail
->
(
assert
(
i
==
0
&&
j
==
0
);
raise
(
Tallying
.
UnSatConstr
"apply_raw step1"
))
...
...
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