Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Lustrec - public version
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LustreC
Lustrec - public version
Commits
ddb4f358
Commit
ddb4f358
authored
3 years ago
by
BRUN Lelio
Browse files
Options
Downloads
Patches
Plain Diff
missing files
parent
9d779097
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/arrow_taint.ml
+48
-0
48 additions, 0 deletions
src/arrow_taint.ml
src/arrow_taint.mli
+3
-0
3 additions, 0 deletions
src/arrow_taint.mli
with
51 additions
and
0 deletions
src/arrow_taint.ml
0 → 100644
+
48
−
0
View file @
ddb4f358
open
Lustre_types
open
Corelang
let
find_taint_arrow
eqs
locals
(
x
,
_
)
=
let
ck_x
=
x
.
var_clock
in
x
,
List
.
find_map
(
fun
eq
->
match
eq
.
eq_lhs
,
eq
.
eq_rhs
.
expr_desc
with
|
[
y
]
,
Expr_arrow
_
->
let
o_ck_y
=
List
.
find_map
(
fun
(
v
,
_
)
->
if
v
.
var_id
=
y
then
Some
v
.
var_clock
else
None
)
locals
in
begin
match
o_ck_y
with
|
Some
ck_y
->
(* if (x.var_id = "__if_multi_test_9") then *)
(* Format.printf "%s :: %a (%d) - %s :: %a (%d)\n" x.var_id Clocks.pp ck_x ck_x.cid y Clocks.pp ck_y ck_y.cid; *)
if
Clocks
.
equal
ck_y
ck_x
then
Some
y
else
None
|
_
->
None
end
|
_
->
None
)
eqs
let
arrow_taint_node
node
=
let
eqs
,
auts
=
get_node_eqs
node
in
if
auts
!=
[]
then
assert
false
;
(* Automata should be expanded by now. *)
let
node_locals
=
List
.
map
(
find_taint_arrow
eqs
node
.
node_locals
)
node
.
node_locals
in
{
node
with
node_locals
}
let
arrow_taint_inode
nd
=
match
nd
.
nodei_spec
with
|
None
|
Some
(
NodeSpec
_
)
->
nd
|
Some
(
Contract
_
)
->
assert
false
let
arrow_taint_decl
decl
=
match
decl
.
top_decl_desc
with
|
Node
nd
->
let
decl'
=
{
decl
with
top_decl_desc
=
Node
(
arrow_taint_node
nd
)
}
in
update_node
nd
.
node_id
decl'
;
decl'
|
ImportedNode
nd
->
let
decl'
=
{
decl
with
top_decl_desc
=
ImportedNode
(
arrow_taint_inode
nd
)
}
in
update_node
nd
.
nodei_id
decl'
;
decl'
|
Include
_
|
Open
_
|
Const
_
|
TypeDef
_
->
decl
let
arrow_taint_prog
decls
=
List
.
map
arrow_taint_decl
decls
This diff is collapsed.
Click to expand it.
src/arrow_taint.mli
0 → 100644
+
3
−
0
View file @
ddb4f358
open
Lustre_types
val
arrow_taint_prog
:
program_t
->
program_t
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