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
2adb72ff
Commit
2adb72ff
authored
9 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Correct bug with invalid simplification in IntroduceRecCalls and simplify
parent
b97c7e5e
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
src/main/scala/leon/synthesis/rules/IntroduceRecCalls.scala
+15
-31
15 additions, 31 deletions
src/main/scala/leon/synthesis/rules/IntroduceRecCalls.scala
with
15 additions
and
31 deletions
src/main/scala/leon/synthesis/rules/IntroduceRecCalls.scala
+
15
−
31
View file @
2adb72ff
...
...
@@ -51,38 +51,22 @@ case object IntroduceRecCalls extends NormalizingRule("Introduce rec. calls") {
(
rec
,
path
)
}
val
onSuccess
=
forwardMap
(
letTuple
(
recs
.
map
(
_
.
_1
),
tupleWrap
(
calls
),
_
))
List
(
new
RuleInstantiation
(
s
"Introduce calls ${calls mkString "
,
"}"
,
SolutionBuilderDecomp
(
List
(
p
.
outType
),
onSuccess
))
{
def
apply
(
nohctx
:
SearchContext
)
:
RuleApplication
=
{
val
psol
=
new
PartialSolution
(
hctx
.
search
.
strat
,
true
)
.
solutionAround
(
hctx
.
currentNode
)(
Error
(
p
.
outType
,
"Encountered choose!"
))
.
getOrElse
(
hctx
.
reporter
.
fatalError
(
"Unable to get outer solution"
))
.
term
val
origImpl
=
hctx
.
functionContext
.
fullBody
hctx
.
functionContext
.
fullBody
=
psol
//val evaluator = new NoChooseEvaluator(hctx, hctx.program)
val
newWs
=
calls
map
Terminating
val
TopLevelAnds
(
ws
)
=
p
.
ws
try
{
val
newProblem
=
p
.
copy
(
as
=
p
.
as
++
(
if
(
specifyCalls
)
Nil
else
recs
.
map
(
_
.
_1
)),
pc
=
recs
.
map
(
_
.
_2
).
foldLeft
(
p
.
pc
)(
_
merge
_
),
ws
=
andJoin
(
ws
++
newWs
),
eb
=
p
.
eb
)
RuleExpanded
(
List
(
newProblem
))
}
finally
{
hctx
.
functionContext
.
fullBody
=
origImpl
}
val
newWs
=
calls
map
Terminating
val
TopLevelAnds
(
ws
)
=
p
.
ws
val
newProblem
=
p
.
copy
(
as
=
p
.
as
++
(
if
(
specifyCalls
)
Nil
else
recs
.
map
(
_
.
_1
)),
pc
=
recs
.
map
(
_
.
_2
).
foldLeft
(
p
.
pc
)(
_
merge
_
),
ws
=
andJoin
(
ws
++
newWs
),
eb
=
p
.
eb
)
val
onSuccess
=
forwardMap
{
e
=>
recs
.
map
(
_
.
_1
).
zip
(
calls
).
foldRight
(
e
)
{
case
(
(
id
,
call
),
e
)
=>
Let
(
id
,
call
,
e
)
}
}
)
}
List
(
decomp
(
List
(
newProblem
),
onSuccess
,
s
"Introduce calls ${calls mkString "
,
"}"
))
}
}
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