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
c0214950
Commit
c0214950
authored
12 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Handle SIGINT, produce solution on abort.
parent
572cc5a4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/leon/synthesis/Synthesizer.scala
+14
-1
14 additions, 1 deletion
src/main/scala/leon/synthesis/Synthesizer.scala
src/main/scala/leon/synthesis/rules/Cegis.scala
+2
-2
2 additions, 2 deletions
src/main/scala/leon/synthesis/rules/Cegis.scala
with
16 additions
and
3 deletions
src/main/scala/leon/synthesis/Synthesizer.scala
+
14
−
1
View file @
c0214950
...
...
@@ -6,6 +6,7 @@ import purescala.Definitions.{Program, FunDef}
import
purescala.TreeOps._
import
purescala.Trees.
{
Expr
,
Not
}
import
purescala.ScalaPrinter
import
sun.misc.
{
Signal
,
SignalHandler
}
import
solvers.Solver
import
java.io.File
...
...
@@ -36,7 +37,10 @@ class Synthesizer(val reporter: Reporter,
val
worstSolution
=
Solution
.
choose
(
problem
)
var
continue
=
true
def
synthesize
()
:
Solution
=
{
continue
=
true
workList
.
clear
()
workList
+=
rootTask
...
...
@@ -51,7 +55,16 @@ class Synthesizer(val reporter: Reporter,
}
}
var
continue
=
true
val
sigINT
=
new
Signal
(
"INT"
)
var
oldHandler
:
SignalHandler
=
null
oldHandler
=
Signal
.
handle
(
sigINT
,
new
SignalHandler
{
def
handle
(
sig
:
Signal
)
{
reporter
.
info
(
"Aborting..."
)
continue
=
false
;
Signal
.
handle
(
sigINT
,
oldHandler
)
}
})
while
(!
workList
.
isEmpty
&&
continue
)
{
val
task
=
workList
.
dequeue
()
...
...
This diff is collapsed.
Click to expand it.
src/main/scala/leon/synthesis/rules/Cegis.scala
+
2
−
2
View file @
c0214950
...
...
@@ -130,7 +130,7 @@ class CEGIS(synth: Synthesizer) extends Rule("CEGIS", synth, 150) {
var
predicates
:
Seq
[
Expr
]
=
Seq
()
var
continue
=
true
while
(
result
.
isEmpty
&&
continue
)
{
while
(
result
.
isEmpty
&&
continue
&&
synth
.
continue
)
{
val
basePhi
=
currentF
.
entireFormula
val
constrainedPhi
=
And
(
basePhi
+:
predicates
)
//println("-"*80)
...
...
@@ -211,7 +211,7 @@ class CEGIS(synth: Synthesizer) extends Rule("CEGIS", synth, 150) {
lastF
=
currentF
currentF
=
currentF
.
unroll
unrolings
+=
1
}
while
(
unrolings
<
maxUnrolings
&&
lastF
!=
currentF
&&
result
.
isEmpty
)
}
while
(
unrolings
<
maxUnrolings
&&
lastF
!=
currentF
&&
result
.
isEmpty
&&
synth
.
continue
)
result
.
getOrElse
(
RuleInapplicable
)
}
...
...
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