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
0681b87d
Commit
0681b87d
authored
12 years ago
by
Philippe Suter
Browse files
Options
Downloads
Patches
Plain Diff
Removing legacy code.
parent
00d90a46
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/Timer.scala
+0
-27
0 additions, 27 deletions
src/main/scala/leon/Timer.scala
src/main/scala/leon/solvers/TimeoutSolver.scala
+0
-35
0 additions, 35 deletions
src/main/scala/leon/solvers/TimeoutSolver.scala
with
0 additions
and
62 deletions
src/main/scala/leon/Timer.scala
deleted
100644 → 0
+
0
−
27
View file @
00d90a46
package
leon
/** Creates a thread that, when started, counts for maxsecs seconds and then
* calls the callback, unless the timer was halted first. */
class
Timer
(
callback
:
()
=>
Unit
,
maxSecs
:
Int
)
extends
Thread
{
private
var
keepRunning
=
true
private
val
asMillis
:
Long
=
1000L
*
maxSecs
override
def
run
:
Unit
=
{
val
startTime
:
Long
=
System
.
currentTimeMillis
var
exceeded
:
Boolean
=
false
while
(!
exceeded
&&
keepRunning
)
{
if
(
asMillis
<
(
System
.
currentTimeMillis
-
startTime
))
{
exceeded
=
true
}
Thread
.
sleep
(
100
)
//is needed on my (regis) machine, if not here, the loop does not stop when halt is called.
}
if
(
exceeded
&&
keepRunning
)
{
callback
()
}
}
def
halt
:
Unit
=
{
keepRunning
=
false
}
}
This diff is collapsed.
Click to expand it.
src/main/scala/leon/solvers/TimeoutSolver.scala
deleted
100644 → 0
+
0
−
35
View file @
00d90a46
package
leon
package
solvers
import
purescala.Common._
import
purescala.Definitions._
import
purescala.Trees._
import
purescala.TypeTrees._
import
scala.sys.error
class
TimeoutSolver
(
solver
:
Solver
,
timeout
:
Int
)
extends
Solver
(
solver
.
context
)
with
NaiveIncrementalSolver
{
val
description
=
solver
.
description
+
", with timeout"
override
val
shortDescription
=
solver
.
shortDescription
+
"+t"
override
def
setProgram
(
prog
:
Program
)
:
Unit
=
{
solver
.
setProgram
(
prog
)
}
def
solve
(
expression
:
Expr
)
:
Option
[
Boolean
]
=
{
val
timer
=
new
Timer
(()
=>
solver
.
halt
,
timeout
)
timer
.
start
val
res
=
solver
.
solve
(
expression
)
timer
.
halt
res
}
override
def
init
()
{
solver
.
init
}
override
def
halt
()
{
solver
.
halt
}
}
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