Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lustre-v6
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
verimag
synchrone
lustre-v6
Commits
3021ae78
Commit
3021ae78
authored
16 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
Simplify a little bit the code in split.ml
parent
096e4e36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/split.ml
+18
-18
18 additions, 18 deletions
src/split.ml
with
18 additions
and
18 deletions
src/split.ml
+
18
−
18
View file @
3021ae78
(** Time-stamp: <modified the 20/08/2008 (at
09:48
) by Erwan Jahier> *)
(** Time-stamp: <modified the 20/08/2008 (at
11:37
) by Erwan Jahier> *)
open
Lxm
open
Lxm
...
@@ -52,14 +52,25 @@ and (split_val_exp : bool -> val_exp_eff -> val_exp_eff * split_acc) =
...
@@ -52,14 +52,25 @@ and (split_val_exp : bool -> val_exp_eff -> val_exp_eff * split_acc) =
|
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
->
|
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
->
(* recursively split the arguments *)
(* recursively split the arguments *)
let
(
vel
,
(
eql
,
vl
))
=
let
lxm
=
by_pos_op_eff
.
src
in
let
(
rhs
,
vel
,
(
eql
,
vl
))
=
match
by_pos_op_eff
.
it
with
match
by_pos_op_eff
.
it
with
|
WITH_eff
(
ve
)
|
WITH_eff
(
ve
)
->
|
HAT_eff
(
_
,
ve
)
->
let
ve
,
(
eql
,
vl
)
=
split_val_exp
false
ve
in
let
ve
,
(
eql
,
vl
)
=
split_val_exp
false
ve
in
[
ve
]
,
(
eql
,
vl
)
let
by_pos_op_eff
=
Lxm
.
flagit
(
WITH_eff
(
ve
))
lxm
in
let
rhs
=
CallByPosEff
(
by_pos_op_eff
,
OperEff
[]
)
in
rhs
,
[
ve
]
,
(
eql
,
vl
)
|
HAT_eff
(
i
,
ve
)
->
let
ve
,
(
eql
,
vl
)
=
split_val_exp
false
ve
in
let
by_pos_op_eff
=
Lxm
.
flagit
(
HAT_eff
(
i
,
ve
))
lxm
in
let
rhs
=
CallByPosEff
(
by_pos_op_eff
,
OperEff
[]
)
in
rhs
,
[
ve
]
,
(
eql
,
vl
)
|
_
->
|
_
->
split_val_exp_list
false
vel
let
vel
,
(
eql
,
vl
)
=
split_val_exp_list
false
vel
in
let
rhs
=
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
in
rhs
,
vel
,
(
eql
,
vl
)
in
in
if
top_level
then
if
top_level
then
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
,
(
eql
,
vl
)
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
,
(
eql
,
vl
)
...
@@ -69,7 +80,6 @@ and (split_val_exp : bool -> val_exp_eff -> val_exp_eff * split_acc) =
...
@@ -69,7 +80,6 @@ and (split_val_exp : bool -> val_exp_eff -> val_exp_eff * split_acc) =
let
typ_l
=
EvalType
.
val_exp_eff
ve
in
let
typ_l
=
EvalType
.
val_exp_eff
ve
in
let
nv_l
=
List
.
map2
new_var
typ_l
clk_l
in
let
nv_l
=
List
.
map2
new_var
typ_l
clk_l
in
let
lxm
=
by_pos_op_eff
.
src
in
let
nve
=
match
nv_l
with
let
nve
=
match
nv_l
with
|
[
nv
]
->
CallByPosEff
(
|
[
nv
]
->
CallByPosEff
(
Lxm
.
flagit
(
IDENT_eff
(
Ident
.
to_idref
nv
.
var_name_eff
))
lxm
,
Lxm
.
flagit
(
IDENT_eff
(
Ident
.
to_idref
nv
.
var_name_eff
))
lxm
,
...
@@ -90,17 +100,7 @@ and (split_val_exp : bool -> val_exp_eff -> val_exp_eff * split_acc) =
...
@@ -90,17 +100,7 @@ and (split_val_exp : bool -> val_exp_eff -> val_exp_eff * split_acc) =
)
)
in
in
let
lpl
=
List
.
map
(
fun
nv
->
LeftVarEff
(
nv
,
lxm
))
nv_l
in
let
lpl
=
List
.
map
(
fun
nv
->
LeftVarEff
(
nv
,
lxm
))
nv_l
in
let
rhs
=
match
by_pos_op_eff
.
it
with
|
WITH_eff
ve
->
let
by_pos_op_eff
=
Lxm
.
flagit
(
WITH_eff
(
List
.
hd
vel
))
lxm
in
CallByPosEff
(
by_pos_op_eff
,
OperEff
[]
)
|
HAT_eff
(
i
,
ve
)
->
let
by_pos_op_eff
=
Lxm
.
flagit
(
HAT_eff
(
i
,
List
.
hd
vel
))
lxm
in
CallByPosEff
(
by_pos_op_eff
,
OperEff
[]
)
|
_
->
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
in
let
eq
=
Lxm
.
flagit
(
lpl
,
rhs
)
lxm
in
let
eq
=
Lxm
.
flagit
(
lpl
,
rhs
)
lxm
in
nve
,
(
eql
@
[
eq
]
,
vl
@
nv_l
)
nve
,
(
eql
@
[
eq
]
,
vl
@
nv_l
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment