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
6345bf1d
Commit
6345bf1d
authored
9 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Remove phiFd from CEGIS
parent
8eb42928
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/CEGISLike.scala
+11
-14
11 additions, 14 deletions
src/main/scala/leon/synthesis/rules/CEGISLike.scala
with
11 additions
and
14 deletions
src/main/scala/leon/synthesis/rules/CEGISLike.scala
+
11
−
14
View file @
6345bf1d
...
...
@@ -270,7 +270,6 @@ abstract class CEGISLike(name: String) extends Rule(name) {
private
val
cTreeFd0
=
new
FunDef
(
FreshIdentifier
(
"cTree"
,
alwaysShowUniqueID
=
true
),
Seq
(),
p
.
as
.
map
(
id
=>
ValDef
(
id
)),
p
.
outType
)
private
val
phiFd0
=
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
)
=
{
...
...
@@ -281,16 +280,10 @@ abstract class CEGISLike(name: String) extends Rule(name) {
.
getOrElse
(
fatalError
(
"Unable to get outer solution"
))
}
val
program0
=
addFunDefs
(
hctx
.
program
,
Seq
(
cTreeFd0
,
phiFd0
)
++
outerSolution
.
defs
,
hctx
.
functionContext
)
val
program0
=
addFunDefs
(
hctx
.
program
,
Seq
(
cTreeFd0
)
++
outerSolution
.
defs
,
hctx
.
functionContext
)
cTreeFd0
.
body
=
None
phiFd0
.
body
=
Some
(
letTuple
(
p
.
xs
,
FunctionInvocation
(
cTreeFd0
.
typed
,
p
.
as
.
map
(
_
.
toVariable
)),
p
.
phi
)
)
replaceFunDefs
(
program0
){
case
fd
if
fd
==
hctx
.
functionContext
=>
val
nfd
=
fd
.
duplicate
()
...
...
@@ -311,8 +304,6 @@ abstract class CEGISLike(name: String) extends Rule(name) {
// 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
)
...
...
@@ -330,6 +321,14 @@ abstract class CEGISLike(name: String) extends Rule(name) {
private
val
innerPc
=
p
.
pc
map
outerExprToInnerExpr
private
val
innerPhi
=
outerExprToInnerExpr
(
p
.
phi
)
private
val
innerSpec
=
outerExprToInnerExpr
(
letTuple
(
p
.
xs
,
FunctionInvocation
(
cTreeFd0
.
typed
,
p
.
as
.
map
(
_
.
toVariable
)),
p
.
phi
)
)
// The program with the c-tree functions
private
var
programCTree
:
Program
=
_
...
...
@@ -620,13 +619,12 @@ abstract class CEGISLike(name: String) extends Rule(name) {
timers
.
tentative
.
start
()
val
solverf
=
SolverFactory
.
getFromSettings
(
hctx
,
programCTree
).
withTimeout
(
exSolverTo
)
val
solver
=
solverf
.
getNewSolver
()
val
cnstr
=
phiFd
.
applied
//println("Program: ")
//println("-"*80)
//println(programCTree.asString)
val
toFind
=
innerPc
and
cnstr
val
toFind
=
innerPc
and
innerSpec
//println(" --- Constraints ---")
//println(" - "+toFind.asString)
try
{
...
...
@@ -696,11 +694,10 @@ abstract class CEGISLike(name: String) extends Rule(name) {
timers
.
cex
.
start
()
val
solverf
=
SolverFactory
.
getFromSettings
(
hctx
,
programCTree
).
withTimeout
(
cexSolverTo
)
val
solver
=
solverf
.
getNewSolver
()
val
cnstr
=
FunctionInvocation
(
phiFd
.
typed
,
phiFd
.
params
.
map
(
_
.
id
.
toVariable
))
try
{
solver
.
assertCnstr
(
andJoin
(
bsOrdered
.
map
(
b
=>
if
(
bs
(
b
))
b
.
toVariable
else
Not
(
b
.
toVariable
))))
solver
.
assertCnstr
(
innerPc
and
not
(
cnstr
))
solver
.
assertCnstr
(
innerPc
and
not
(
innerSpec
))
//println("*"*80)
//println(Not(cnstr))
...
...
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