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
b97c7e5e
Commit
b97c7e5e
authored
9 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Focus removes input variables to not depend on EquivalentInputs"
This reverts commit
4da35a7a
.
parent
632397c0
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/main/scala/leon/repair/rules/Focus.scala
+20
-51
20 additions, 51 deletions
src/main/scala/leon/repair/rules/Focus.scala
with
20 additions
and
51 deletions
src/main/scala/leon/repair/rules/Focus.scala
+
20
−
51
View file @
b97c7e5e
...
...
@@ -4,6 +4,9 @@ package leon
package
repair
package
rules
import
synthesis._
import
leon.evaluators._
import
purescala.Path
import
purescala.Expressions._
import
purescala.Common._
...
...
@@ -12,11 +15,8 @@ import purescala.ExprOps._
import
purescala.Constructors._
import
purescala.Extractors._
import
utils.fixpoint
import
evaluators._
import
synthesis._
import
Witnesses._
import
graph.AndNode
case
object
Focus
extends
PreprocessingRule
(
"Focus"
)
{
...
...
@@ -146,64 +146,33 @@ case object Focus extends PreprocessingRule("Focus") {
val
map
=
mapForPattern
(
scrut
,
c
.
pattern
)
val
thisCond
=
matchCaseCondition
(
scrut
,
c
)
val
prevPCSoFar
=
pcSoFar
val
cond
=
pcSoFar
merge
thisCond
pcSoFar
=
pcSoFar
merge
thisCond
.
negate
val
subP
=
if
(
existsFailing
(
cond
.
toClause
,
map
,
evaluator
))
{
val
vars
=
map
.
toSeq
.
map
(
_
.
_1
)
val
(
p2e
,
_
)
=
patternToExpression
(
c
.
pattern
,
scrut
.
getType
)
val
substAs
=
((
scrut
,
p2e
)
match
{
case
(
Variable
(
i
),
_
)
if
p
.
as
.
contains
(
i
)
=>
Seq
(
i
->
p2e
)
case
(
Tuple
(
as
),
Tuple
(
tos
))
=>
val
res
=
as
.
zip
(
tos
)
collect
{
case
(
Variable
(
i
),
to
)
if
p
.
as
.
contains
(
i
)
=>
i
->
to
}
if
(
res
.
size
==
as
.
size
)
res
else
Nil
}).
toMap
if
(
substAs
.
nonEmpty
)
{
val
subst
:
Expr
=>
Expr
=
{
e
=>
replaceFromIDs
(
substAs
,
e
)
}
// FIXME intermediate binders??
val
newAs
=
(
p
.
as
diff
substAs
.
keys
.
toSeq
)
++
vars
val
newPc
=
(
p
.
pc
merge
prevPCSoFar
)
map
subst
val
newWs
=
subst
(
ws
(
c
.
rhs
))
val
newPhi
=
subst
(
p
.
phi
)
val
eb2
=
qeb
.
filterIns
(
cond
.
toClause
).
removeIns
(
substAs
.
keySet
)
val
ebF
:
Seq
[
Expr
]
=>
List
[
Seq
[
Expr
]]
=
{
(
ins
:
Seq
[
Expr
])
=>
val
eval
=
evaluator
.
eval
(
tupleWrap
(
vars
map
Variable
),
p
.
as
.
zip
(
ins
).
toMap
++
map
)
eval
.
result
.
map
(
r
=>
ins
++
unwrapTuple
(
r
,
vars
.
size
)).
toList
}
val
newEb
=
eb2
flatMapIns
ebF
Some
(
Problem
(
newAs
,
newWs
,
newPc
,
newPhi
,
p
.
xs
,
newEb
))
}
else
{
// Filter tests by the path-condition
val
eb2
=
qeb
.
filterIns
(
cond
.
toClause
)
// Filter tests by the path-condition
val
eb2
=
qeb
.
filterIns
(
cond
.
toClause
)
// Augment test with the additional variables and their valuations
val
ebF
:
(
Seq
[
Expr
]
=>
List
[
Seq
[
Expr
]])
=
{
(
e
:
Seq
[
Expr
])
=>
val
emap
=
(
p
.
as
zip
e
).
toMap
// Augment test with the additional variables and their valuations
val
ebF
:
(
Seq
[
Expr
]
=>
List
[
Seq
[
Expr
]])
=
{
(
e
:
Seq
[
Expr
])
=>
val
emap
=
(
p
.
as
zip
e
).
toMap
evaluator
.
eval
(
tupleWrap
(
vars
.
map
(
map
)),
emap
).
result
.
map
{
r
=>
e
++
unwrapTuple
(
r
,
vars
.
size
)
}.
toList
}
evaluator
.
eval
(
tupleWrap
(
vars
.
map
(
map
)),
emap
).
result
.
map
{
r
=>
e
++
unwrapTuple
(
r
,
vars
.
size
)
}.
toList
}
val
eb3
=
if
(
vars
.
nonEmpty
)
{
eb2
.
flatMapIns
(
ebF
)
}
else
{
eb2
.
eb
}
val
eb3
=
if
(
vars
.
nonEmpty
)
{
eb2
.
flatMapIns
(
ebF
)
}
else
{
eb2
.
eb
}
val
newPc
=
cond
withBindings
vars
.
map
(
id
=>
id
->
map
(
id
))
val
newPc
=
cond
withBindings
vars
.
map
(
id
=>
id
->
map
(
id
))
Some
(
Problem
(
p
.
as
,
ws
(
c
.
rhs
),
p
.
pc
merge
newPc
,
p
.
phi
,
p
.
xs
,
eb3
))
}
Some
(
Problem
(
p
.
as
,
ws
(
c
.
rhs
),
p
.
pc
merge
newPc
,
p
.
phi
,
p
.
xs
,
eb3
))
}
else
{
None
}
...
...
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