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
5bcd5da0
Commit
5bcd5da0
authored
Aug 19, 2014
by
Pietro Abate
Browse files
Filter gamma out from substitution list in squareapply
parent
1b09a292
Changes
2
Hide whitespace changes
Inline
Side-by-side
types/types.ml
View file @
5bcd5da0
...
...
@@ -3537,6 +3537,15 @@ module Tallying = struct
)
Var
.
Set
.
empty
ll
let
is_identity
=
List
.
for_all
(
CS
.
E
.
is_empty
)
let
identity
=
[
CS
.
E
.
empty
]
let
filter
f
sl
=
if
is_identity
sl
then
sl
else
List
.
fold_left
(
fun
acc
si
->
let
e
=
CS
.
E
.
filter
(
fun
v
_
->
f
v
)
si
in
if
CS
.
E
.
is_empty
e
then
acc
else
e
::
acc
)
[]
sl
end
...
...
@@ -3587,7 +3596,8 @@ exception FoundApply of t * int * int * Tallying.CS.sl
s @@ sigma_i < t @@ sigma_j for all i \in I, j \in J *)
let
apply_raw
delta
s
t
=
Tallying
.
NormMemoHash
.
clear
Tallying
.
memo_norm
;
let
gamma
=
var
(
Var
.
mk
"Gamma"
)
in
let
vgamma
=
Var
.
mk
"Gamma"
in
let
gamma
=
var
vgamma
in
let
cgamma
=
cons
gamma
in
(* cell i of ai contains /\k<=i s_k, cell j of aj contains /\k<=j t_k *)
let
ai
=
ref
[
|
|
]
...
...
@@ -3625,7 +3635,11 @@ let apply_raw delta s t =
done
;
tallying
i
i
;
loop
(
i
+
1
)
with
FoundApply
(
res
,
i
,
j
,
sl
)
->
sl
,
get
ai
i
,
get
aj
j
,
res
with
FoundApply
(
res
,
i
,
j
,
sl
)
->
(* we remove gamma from the substitution list as it is only used
here by the algorithm *)
let
sl
=
(
Tallying
.
filter
(
fun
v
->
not
(
Var
.
equal
v
vgamma
))
sl
)
in
(
sl
,
get
ai
i
,
get
aj
j
,
res
)
in
loop
0
...
...
types/types.mli
View file @
5bcd5da0
...
...
@@ -451,6 +451,8 @@ module Tallying : sig
val
domain
:
CS
.
sl
->
Var
.
Set
.
t
val
codomain
:
CS
.
sl
->
Var
.
Set
.
t
val
is_identity
:
CS
.
sl
->
bool
val
identity
:
CS
.
sl
val
filter
:
(
Var
.
t
->
bool
)
->
CS
.
sl
->
CS
.
sl
end
...
...
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