Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
LARA
inox
Commits
4d4a3ff1
Commit
4d4a3ff1
authored
9 years ago
by
Regis Blanc
Committed by
Régis Blanc
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
leon finds data racing counter-example
parent
b1fcc592
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/main/scala/leon/xlang/IntroduceGlobalStatePhase.scala
+1
-1
1 addition, 1 deletion
src/main/scala/leon/xlang/IntroduceGlobalStatePhase.scala
testcases/verification/xlang/DataRacing.scala
+5
-3
5 additions, 3 deletions
testcases/verification/xlang/DataRacing.scala
with
6 additions
and
4 deletions
src/main/scala/leon/xlang/IntroduceGlobalStatePhase.scala
+
1
−
1
View file @
4d4a3ff1
...
@@ -54,7 +54,7 @@ object IntroduceGlobalStatePhase extends TransformationPhase {
...
@@ -54,7 +54,7 @@ object IntroduceGlobalStatePhase extends TransformationPhase {
}
}
private
def
extendFunDefWithState
(
fd
:
FunDef
,
stateCCD
:
CaseClassDef
)(
ctx
:
LeonContext
)
:
FunDef
=
{
private
def
extendFunDefWithState
(
fd
:
FunDef
,
stateCCD
:
CaseClassDef
)(
ctx
:
LeonContext
)
:
FunDef
=
{
val
newParams
=
fd
.
params
:+
ValDef
(
FreshIdentifier
(
"
s
tate"
,
stateCCD
.
typed
))
val
newParams
=
fd
.
params
:+
ValDef
(
FreshIdentifier
(
"
globalS
tate"
,
stateCCD
.
typed
))
val
newFunDef
=
new
FunDef
(
fd
.
id
.
freshen
,
fd
.
tparams
,
newParams
,
fd
.
returnType
)
val
newFunDef
=
new
FunDef
(
fd
.
id
.
freshen
,
fd
.
tparams
,
newParams
,
fd
.
returnType
)
newFunDef
.
addFlags
(
fd
.
flags
)
newFunDef
.
addFlags
(
fd
.
flags
)
newFunDef
.
setPos
(
fd
)
newFunDef
.
setPos
(
fd
)
...
...
This diff is collapsed.
Click to expand it.
testcases/verification/xlang/DataRacing.scala
+
5
−
3
View file @
4d4a3ff1
...
@@ -34,12 +34,14 @@ object DataRacing {
...
@@ -34,12 +34,14 @@ object DataRacing {
case
(
RunnableNil
(),
RunnableNil
())
=>
()
case
(
RunnableNil
(),
RunnableNil
())
=>
()
}
}
def
main
()
:
Unit
=
{
//z3 finds counterexample in 0.5
//cvc4 needs 130 seconds
def
main
()
:
Int
=
{
val
state
=
SharedState
(
0
)
val
state
=
SharedState
(
0
)
val
t1
=
RunnableCons
((
s
:
SharedState
)
=>
s
.
i
=
s
.
i
+
1
,
RunnableNil
())
val
t1
=
RunnableCons
((
s
:
SharedState
)
=>
s
.
i
=
s
.
i
+
1
,
RunnableNil
())
val
t2
=
RunnableCons
((
s
:
SharedState
)
=>
s
.
i
=
s
.
i
*
2
,
RunnableNil
())
val
t2
=
RunnableCons
((
s
:
SharedState
)
=>
s
.
i
=
s
.
i
*
2
,
RunnableNil
())
execute
(
t1
,
t2
,
state
)
execute
(
t1
,
t2
,
state
)
assert
(
state
.
i
==
2
)
state
.
i
}
}
ensuring
(
_
==
2
)
}
}
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