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
62c0a0a3
Commit
62c0a0a3
authored
9 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
CEGIS should find replaced functions in program
parent
88b1e440
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/synthesis/rules/CEGISLike.scala
+12
-14
12 additions, 14 deletions
src/main/scala/leon/synthesis/rules/CEGISLike.scala
with
12 additions
and
14 deletions
src/main/scala/leon/synthesis/rules/CEGISLike.scala
+
12
−
14
View file @
62c0a0a3
...
...
@@ -268,28 +268,26 @@ abstract class CEGISLike(name: String) extends Rule(name) {
}
}
// The function which calls the synthesized expression within programCTree
private
val
cTreeFd
=
new
FunDef
(
FreshIdentifier
(
"cTree"
,
alwaysShowUniqueID
=
true
),
Seq
(),
p
.
as
.
map
(
id
=>
ValDef
(
id
)),
p
.
outType
)
// The spec of the problem
private
val
phiFd
=
new
FunDef
(
FreshIdentifier
(
"phiFd"
,
alwaysShowUniqueID
=
true
),
Seq
(),
p
.
as
.
map
(
id
=>
ValDef
(
id
)),
BooleanType
)
private
val
cTreeFd0
=
new
FunDef
(
FreshIdentifier
(
"cTree"
,
alwaysShowUniqueID
=
true
),
Seq
(),
p
.
as
.
map
(
id
=>
ValDef
(
id
)),
p
.
outType
)
private
val
phiFd
0
=
new
FunDef
(
FreshIdentifier
(
"phiFd"
,
alwaysShowUniqueID
=
true
),
Seq
(),
p
.
as
.
map
(
id
=>
ValDef
(
id
)),
BooleanType
)
// The program with the body of the current function replaced by the current partial solution
private
val
(
innerProgram
,
origIdMap
,
origFdMap
,
origCdMap
)
=
{
val
outerSolution
=
{
new
PartialSolution
(
hctx
.
search
.
strat
,
true
)
.
solutionAround
(
hctx
.
currentNode
)(
FunctionInvocation
(
cTreeFd
.
typed
,
p
.
as
.
map
(
_
.
toVariable
)))
.
solutionAround
(
hctx
.
currentNode
)(
FunctionInvocation
(
cTreeFd
0
.
typed
,
p
.
as
.
map
(
_
.
toVariable
)))
.
getOrElse
(
fatalError
(
"Unable to get outer solution"
))
}
val
program0
=
addFunDefs
(
hctx
.
program
,
Seq
(
cTreeFd
,
phiFd
)
++
outerSolution
.
defs
,
hctx
.
functionContext
)
val
program0
=
addFunDefs
(
hctx
.
program
,
Seq
(
cTreeFd
0
,
phiFd
0
)
++
outerSolution
.
defs
,
hctx
.
functionContext
)
cTreeFd
.
body
=
None
cTreeFd
0
.
body
=
None
phiFd
.
body
=
Some
(
phiFd
0
.
body
=
Some
(
letTuple
(
p
.
xs
,
FunctionInvocation
(
cTreeFd
.
typed
,
p
.
as
.
map
(
_
.
toVariable
)),
FunctionInvocation
(
cTreeFd
0
.
typed
,
p
.
as
.
map
(
_
.
toVariable
)),
p
.
phi
)
)
...
...
@@ -306,16 +304,16 @@ abstract class CEGISLike(name: String) extends Rule(name) {
Some
(
nfd
)
// We freshen/duplicate every functions, except these two as they are
// fresh anyway and we refer to them directly.
case
`cTreeFd`
|
`phiFd`
=>
None
case
fd
=>
Some
(
fd
.
duplicate
())
}
}
// The function which calls the synthesized expression within programCTree
private
val
cTreeFd
=
origFdMap
.
getOrElse
(
cTreeFd0
,
cTreeFd0
)
// The spec of the problem
private
val
phiFd
=
origFdMap
.
getOrElse
(
phiFd0
,
phiFd0
)
private
val
outerToInner
=
new
purescala
.
TreeTransformer
{
override
def
transform
(
id
:
Identifier
)
:
Identifier
=
origIdMap
.
getOrElse
(
id
,
id
)
override
def
transform
(
cd
:
ClassDef
)
:
ClassDef
=
origCdMap
.
getOrElse
(
cd
,
cd
)
...
...
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