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
380a8d33
Commit
380a8d33
authored
7 years ago
by
Pierre Loic Garoche
Browse files
Options
Downloads
Patches
Plain Diff
Solved bug in machine code generation for asserts that contain memories
parent
1b683c9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/machine_code.ml
+11
-4
11 additions, 4 deletions
src/machine_code.ml
with
11 additions
and
4 deletions
src/machine_code.ml
+
11
−
4
View file @
380a8d33
...
...
@@ -304,11 +304,18 @@ let new_instance =
(* d : local variables *)
(* s : step instructions *)
let
translate_ident
node
(
m
,
si
,
j
,
d
,
s
)
id
=
(* Format.eprintf "trnaslating ident: %s@." id; *)
try
(* id is a node var *)
let
var_id
=
get_node_var
id
node
in
if
ISet
.
exists
(
fun
v
->
v
.
var_id
=
id
)
m
then
mk_val
(
StateVar
var_id
)
var_id
.
var_type
else
mk_val
(
LocalVar
var_id
)
var_id
.
var_type
then
(
(* Format.eprintf "a STATE VAR@."; *)
mk_val
(
StateVar
var_id
)
var_id
.
var_type
)
else
(
(* Format.eprintf "a LOCAL VAR@."; *)
mk_val
(
LocalVar
var_id
)
var_id
.
var_type
)
with
Not_found
->
try
(* id is a constant *)
let
vdecl
=
(
Corelang
.
var_decl_of_const
(
const_of_top
(
Hashtbl
.
find
Corelang
.
consts_table
id
)))
in
...
...
@@ -623,7 +630,7 @@ let translate_decl nd sch =
assert
(
ISet
.
is_empty
m0
);
assert
(
init0
=
[]
);
assert
(
Utils
.
IMap
.
is_empty
j0
);
let
m
,
init
,
j
,
locals
,
s
=
translate_eqs
nd
(
m0
,
init0
,
j0
,
locals0
,
[]
)
(
assert_instrs
@
sorted_eqs
)
in
let
m
,
init
,
j
,
locals
,
s
as
context_with_asserts
=
translate_eqs
nd
(
m0
,
init0
,
j0
,
locals0
,
[]
)
(
assert_instrs
@
sorted_eqs
)
in
let
mmap
=
Utils
.
IMap
.
fold
(
fun
i
n
res
->
(
i
,
n
)
::
res
)
j
[]
in
{
mname
=
nd
;
...
...
@@ -650,7 +657,7 @@ let translate_decl nd sch =
else
s
);
step_asserts
=
List
.
map
(
translate_expr
nd
in
it_a
rg
s
)
nd_node_asserts
;
step_asserts
=
List
.
map
(
translate_expr
nd
context_w
it
h
_a
ssert
s
)
nd_node_asserts
;
};
mspec
=
nd
.
node_spec
;
mannot
=
nd
.
node_annot
;
...
...
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