Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plcopen
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
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
Per Lindgren
plcopen
Commits
1197c0bb
Commit
1197c0bb
authored
6 years ago
by
Nils Fitinghoff
Browse files
Options
Downloads
Patches
Plain Diff
rustfmt
parent
296a8323
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/eq_paper.rs
+24
-9
24 additions, 9 deletions
examples/eq_paper.rs
with
24 additions
and
9 deletions
examples/eq_paper.rs
+
24
−
9
View file @
1197c0bb
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
#![no_main]
#![no_main]
#![no_std]
#![no_std]
extern
crate
panic_abort
;
extern
crate
klee
;
extern
crate
klee
;
extern
crate
panic_abort
;
use
klee
::{
kassert
,
kassume
,
ksymbol
};
use
klee
::{
kassert
,
kassume
,
ksymbol
};
#[derive(Debug,
Copy,
Clone)]
#[derive(Debug,
Copy,
Clone)]
...
@@ -33,14 +33,18 @@ const F: bool = false;
...
@@ -33,14 +33,18 @@ const F: bool = false;
#[no_mangle]
#[no_mangle]
fn
main
()
{
fn
main
()
{
let
mut
DATA
:
[
Data
;
HORIZON
]
=
unsafe
{
core
::
mem
::
uninitialized
()
};
let
mut
DATA
:
[
Data
;
HORIZON
]
=
unsafe
{
core
::
mem
::
uninitialized
()
};
ksymbol!
(
&
mut
DATA
,
"DATA"
);
ksymbol!
(
&
mut
DATA
,
"DATA"
);
let
mut
STATE_H
:
[
State
;
HORIZON
]
=
unsafe
{
core
::
mem
::
uninitialized
()
};
let
mut
STATE_H
:
[
State
;
HORIZON
]
=
unsafe
{
core
::
mem
::
uninitialized
()
};
let
mut
CNTR_H
:
[
u32
;
HORIZON
]
=
unsafe
{
core
::
mem
::
uninitialized
()
};
let
mut
CNTR_H
:
[
u32
;
HORIZON
]
=
unsafe
{
core
::
mem
::
uninitialized
()
};
let
mut
TIMEOUT_CNTR
:
u32
=
unsafe
{
core
::
mem
::
uninitialized
()
};
let
mut
TIMEOUT_CNTR
:
u32
=
unsafe
{
core
::
mem
::
uninitialized
()
};
let
mut
STATE
=
S8001
;
let
mut
STATE
=
S8001
;
for
i
in
0
..
HORIZON
{
for
i
in
0
..
HORIZON
{
...
@@ -79,11 +83,18 @@ fn main() {
...
@@ -79,11 +83,18 @@ fn main() {
C001
|
C002
|
C003
=>
{
C001
|
C002
|
C003
=>
{
// (3)
// (3)
// transitions from error
// transitions from error
kassert!
((
STATE_H
[
i
]
==
S8001
)
|
(
STATE
==
STATE_H
[
i
-
1
]));
kassert!
(
(
STATE_H
[
i
]
==
S8001
)
|
(
STATE
==
STATE_H
[
i
-
1
])
);
}
}
S8005
=>
{
S8005
=>
{
// (4)
// (4)
kassert!
((
STATE_H
[
i
]
==
S8001
)
|
(
STATE
==
C003
)
|
(
STATE
==
STATE_H
[
i
-
1
]));
kassert!
(
(
STATE_H
[
i
]
==
S8001
)
|
(
STATE
==
C003
)
|
(
STATE
==
STATE_H
[
i
-
1
])
);
}
}
_
=>
(),
_
=>
(),
}
}
...
@@ -111,7 +122,11 @@ fn main() {
...
@@ -111,7 +122,11 @@ fn main() {
}
}
}
}
fn
eq
(
STATE
:
&
mut
State
,
TIMEOUT_CNTR
:
&
mut
u32
,
data
:
&
Data
)
{
fn
eq
(
STATE
:
&
mut
State
,
TIMEOUT_CNTR
:
&
mut
u32
,
data
:
&
Data
,
)
{
*
STATE
=
match
STATE
{
*
STATE
=
match
STATE
{
S8000
=>
match
(
data
.a
,
data
.b
)
{
S8000
=>
match
(
data
.a
,
data
.b
)
{
(
F
,
F
)
=>
S8001
,
(
F
,
F
)
=>
S8001
,
...
...
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