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
82e42e61
Commit
82e42e61
authored
10 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
then is deprecated as identifier
parent
40b591a0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testcases/verification/pldi2011-testcases/ForElimination.scala
+6
-6
6 additions, 6 deletions
...ases/verification/pldi2011-testcases/ForElimination.scala
with
6 additions
and
6 deletions
testcases/verification/pldi2011-testcases/ForElimination.scala
+
6
−
6
View file @
82e42e61
...
...
@@ -12,7 +12,7 @@ object ForElimination {
case
class
Assign
(
varID
:
Int
,
expr
:
Expression
)
extends
Statement
case
class
Skip
()
extends
Statement
case
class
Block
(
body
:
List
)
extends
Statement
case
class
IfThenElse
(
expr
:
Expression
,
then
:
Statement
,
elze
:
Statement
)
extends
Statement
case
class
IfThenElse
(
expr
:
Expression
,
then
n
:
Statement
,
elze
:
Statement
)
extends
Statement
case
class
While
(
expr
:
Expression
,
body
:
Statement
)
extends
Statement
case
class
For
(
init
:
Statement
,
expr
:
Expression
,
step
:
Statement
,
body
:
Statement
)
extends
Statement
...
...
@@ -39,7 +39,7 @@ object ForElimination {
def
forLoopsWellFormed
(
stat
:
Statement
)
:
Boolean
=
(
stat
match
{
case
Block
(
body
)
=>
forLoopsWellFormedList
(
body
)
case
IfThenElse
(
_
,
then
,
elze
)
=>
forLoopsWellFormed
(
then
)
&&
forLoopsWellFormed
(
elze
)
case
IfThenElse
(
_
,
then
n
,
elze
)
=>
forLoopsWellFormed
(
then
n
)
&&
forLoopsWellFormed
(
elze
)
case
While
(
_
,
body
)
=>
forLoopsWellFormed
(
body
)
case
For
(
init
,
_
,
step
,
body
)
=>
isForFree
(
init
)
&&
isForFree
(
step
)
&&
forLoopsWellFormed
(
body
)
case
_
=>
true
...
...
@@ -54,7 +54,7 @@ object ForElimination {
def
eliminateWhileLoops
(
stat
:
Statement
)
:
Statement
=
(
stat
match
{
case
Block
(
body
)
=>
Block
(
eliminateWhileLoopsList
(
body
))
case
IfThenElse
(
expr
,
then
,
elze
)
=>
IfThenElse
(
expr
,
eliminateWhileLoops
(
then
),
eliminateWhileLoops
(
elze
))
case
IfThenElse
(
expr
,
then
n
,
elze
)
=>
IfThenElse
(
expr
,
eliminateWhileLoops
(
then
n
),
eliminateWhileLoops
(
elze
))
case
While
(
expr
,
body
)
=>
For
(
Skip
(),
expr
,
Skip
(),
eliminateWhileLoops
(
body
))
case
For
(
init
,
expr
,
step
,
body
)
=>
For
(
eliminateWhileLoops
(
init
),
expr
,
eliminateWhileLoops
(
step
),
eliminateWhileLoops
(
body
))
case
other
=>
other
...
...
@@ -73,7 +73,7 @@ object ForElimination {
// require(forLoopsWellFormed(stat))
stat
match
{
case
Block
(
body
)
=>
Block
(
eliminateForLoopsList
(
body
))
case
IfThenElse
(
expr
,
then
,
elze
)
=>
IfThenElse
(
expr
,
eliminateForLoops
(
then
),
eliminateForLoops
(
elze
))
case
IfThenElse
(
expr
,
then
n
,
elze
)
=>
IfThenElse
(
expr
,
eliminateForLoops
(
then
n
),
eliminateForLoops
(
elze
))
case
While
(
expr
,
body
)
=>
While
(
expr
,
eliminateForLoops
(
body
))
case
For
(
init
,
expr
,
step
,
body
)
=>
Block
(
Cons
(
eliminateForLoops
(
init
),
Cons
(
While
(
expr
,
Block
(
Cons
(
eliminateForLoops
(
body
),
Cons
(
eliminateForLoops
(
step
),
Nil
())))),
Nil
())))
case
other
=>
other
...
...
@@ -87,7 +87,7 @@ object ForElimination {
def
isWhileFree
(
stat
:
Statement
)
:
Boolean
=
stat
match
{
case
Block
(
body
)
=>
isWhileFreeList
(
body
)
case
IfThenElse
(
_
,
then
,
elze
)
=>
isWhileFree
(
then
)
&&
isWhileFree
(
elze
)
case
IfThenElse
(
_
,
then
n
,
elze
)
=>
isWhileFree
(
then
n
)
&&
isWhileFree
(
elze
)
case
While
(
_
,
body
)
=>
false
case
For
(
init
,
_
,
step
,
body
)
=>
isWhileFree
(
init
)
&&
isWhileFree
(
step
)
&&
isWhileFree
(
body
)
case
_
=>
true
...
...
@@ -100,7 +100,7 @@ object ForElimination {
def
isForFree
(
stat
:
Statement
)
:
Boolean
=
stat
match
{
case
Block
(
body
)
=>
isForFreeList
(
body
)
case
IfThenElse
(
_
,
then
,
elze
)
=>
isForFree
(
then
)
&&
isForFree
(
elze
)
case
IfThenElse
(
_
,
then
n
,
elze
)
=>
isForFree
(
then
n
)
&&
isForFree
(
elze
)
case
While
(
_
,
body
)
=>
isForFree
(
body
)
case
For
(
_
,
_
,
_
,
_
)
=>
false
case
_
=>
true
...
...
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