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
d4e15b64
Commit
d4e15b64
authored
16 years ago
by
Erwan Jahier
Browse files
Options
Downloads
Patches
Plain Diff
Translate diese and nor into boolred in the Inline module.
parent
9cb4aa09
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/inline.ml
+33
-1
33 additions, 1 deletion
src/inline.ml
src/licDump.ml
+4
-4
4 additions, 4 deletions
src/licDump.ml
src/split.ml
+3
-3
3 additions, 3 deletions
src/split.ml
with
40 additions
and
8 deletions
src/inline.ml
+
33
−
1
View file @
d4e15b64
(** Time-stamp: <modified the 28/11/2008 (at 1
0:28
) by Erwan Jahier> *)
(** Time-stamp: <modified the 28/11/2008 (at 1
5:51
) by Erwan Jahier> *)
open
Lxm
...
...
@@ -208,6 +208,38 @@ let rec (inline_eq: Eff.local_env ->
in
(
List
.
rev_append
neqs
eqs
,
List
.
append
acc_vars
locs
)
|
CallByPosEff
({
src
=
lxm_ve
;
it
=
Eff
.
Predef
(
Predef
.
DIESE_n
,_
)}
,
OperEff
args
)
->
(* a diese is a particular kind of boolred:
#(A,...,an) = boolred(1,1,n)([a1,...,an])
*)
let
n
=
List
.
length
args
in
let
sargs
=
[
ConstStaticArgEff
(
Ident
.
of_string
"i"
,
Int_const_eff
1
);
ConstStaticArgEff
(
Ident
.
of_string
"j"
,
Int_const_eff
1
);
ConstStaticArgEff
(
Ident
.
of_string
"k"
,
Int_const_eff
n
)
]
in
let
boolred_op
=
Eff
.
Predef
(
Predef
.
BoolRed
,
sargs
)
in
let
arg
=
CallByPosEff
({
src
=
lxm_ve
;
it
=
ARRAY
args
}
,
OperEff
[]
)
in
let
rhs
=
CallByPosEff
({
src
=
lxm_ve
;
it
=
boolred_op
}
,
OperEff
[
arg
])
in
let
eq
=
{
src
=
lxm_eq
;
it
=
(
lhs
,
rhs
)
}
in
inline_eq
node_env
id_solver
(
eqs
,
locs
)
eq
|
CallByPosEff
({
src
=
lxm_ve
;
it
=
Eff
.
Predef
(
Predef
.
NOR_n
,_
)}
,
OperEff
args
)
->
(* a nor is a particular kind of boolred too:
#(A,...,an) = boolred(0,0,n)([a1,...,an])
*)
let
n
=
List
.
length
args
in
let
sargs
=
[
ConstStaticArgEff
(
Ident
.
of_string
"i"
,
Int_const_eff
0
);
ConstStaticArgEff
(
Ident
.
of_string
"j"
,
Int_const_eff
0
);
ConstStaticArgEff
(
Ident
.
of_string
"k"
,
Int_const_eff
n
)
]
in
let
boolred_op
=
Eff
.
Predef
(
Predef
.
BoolRed
,
sargs
)
in
let
arg
=
CallByPosEff
({
src
=
lxm_ve
;
it
=
ARRAY
args
}
,
OperEff
[]
)
in
let
rhs
=
CallByPosEff
({
src
=
lxm_ve
;
it
=
boolred_op
}
,
OperEff
[
arg
])
in
let
eq
=
{
src
=
lxm_eq
;
it
=
(
lhs
,
rhs
)
}
in
inline_eq
node_env
id_solver
(
eqs
,
locs
)
eq
|
CallByPosEff
({
src
=
lxm_ve
;
it
=
Eff
.
Predef
(
Predef
.
BoolRed
,
sargs
)}
,
OperEff
args
)
->
(* Given
- 3 integers i, j, k
...
...
This diff is collapsed.
Click to expand it.
src/licDump.ml
+
4
−
4
View file @
d4e15b64
(** Time-stamp: <modified the 2
6
/11/2008 (at 1
1
:1
5
) by Erwan Jahier> *)
(** Time-stamp: <modified the 2
8
/11/2008 (at 1
5
:1
7
) by Erwan Jahier> *)
open
Printf
open
Lxm
...
...
@@ -171,12 +171,12 @@ and string_of_type_eff = function
Indeed instead of printing:
node toto(x: int ^ 4) ...
node toto(x: int ^ 4) ...
we want to print something like :
type int4 = int ^ 4;
node toto(x: int4) ...
type int4 = int ^ 4;
node toto(x: int4) ...
That may occur only for array actually.
...
...
This diff is collapsed.
Click to expand it.
src/split.ml
+
3
−
3
View file @
d4e15b64
(** Time-stamp: <modified the 2
7
/11/2008 (at 1
0:16
) by Erwan Jahier> *)
(** Time-stamp: <modified the 2
8
/11/2008 (at 1
5:20
) by Erwan Jahier> *)
open
Lxm
...
...
@@ -195,7 +195,7 @@ and (split_val_exp : bool -> Eff.local_env -> Eff.val_exp -> Eff.val_exp * split
let
rhs
=
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
in
rhs
,
(
eql
,
vl
)
|
Eff
.
ARRAY
vel
->
|
Eff
.
ARRAY
vel
->
let
vel
,
(
eql
,
vl
)
=
split_val_exp_list
false
node_env
vel
in
let
by_pos_op_eff
=
Lxm
.
flagit
(
Eff
.
ARRAY
(
vel
))
lxm
in
let
rhs
=
CallByPosEff
(
by_pos_op_eff
,
OperEff
[]
)
in
...
...
@@ -205,7 +205,7 @@ and (split_val_exp : bool -> Eff.local_env -> Eff.val_exp -> Eff.val_exp * split
let
rhs
=
CallByPosEff
(
by_pos_op_eff
,
OperEff
vel
)
in
rhs
,
(
eql
,
vl
)
in
if
top_level
||
by_pos_op_eff
.
it
=
TUPLE
then
if
top_level
||
by_pos_op_eff
.
it
=
TUPLE
then
rhs
,
(
eql
,
vl
)
else
(* create the var for the current call *)
...
...
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