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
28632c2c
Commit
28632c2c
authored
13 years ago
by
Régis Blanc
Browse files
Options
Downloads
Patches
Plain Diff
adding TimeoutSolver and adapting Analysis to wrap solvers into TimeoutSolver when needed
parent
82dec5d7
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/purescala/Analysis.scala
+12
-1
12 additions, 1 deletion
src/purescala/Analysis.scala
src/purescala/TimeoutSolver.scala
+32
-0
32 additions, 0 deletions
src/purescala/TimeoutSolver.scala
with
44 additions
and
1 deletion
src/purescala/Analysis.scala
+
12
−
1
View file @
28632c2c
...
@@ -13,7 +13,18 @@ class Analysis(val program: Program, val reporter: Reporter = Settings.reporter)
...
@@ -13,7 +13,18 @@ class Analysis(val program: Program, val reporter: Reporter = Settings.reporter)
val
analysisExtensions
:
Seq
[
Analyser
]
=
loadedAnalysisExtensions
val
analysisExtensions
:
Seq
[
Analyser
]
=
loadedAnalysisExtensions
val
trivialSolver
=
new
TrivialSolver
(
reporter
)
// This one you can't disable :D
val
trivialSolver
=
new
TrivialSolver
(
reporter
)
// This one you can't disable :D
val
solverExtensions
:
Seq
[
Solver
]
=
trivialSolver
+:
loadedSolverExtensions
val
solverExtensions1
:
Seq
[
Solver
]
=
trivialSolver
+:
loadedSolverExtensions
//TODO: is it really correct?
val
solverExtensions
=
if
(
Settings
.
solverTimeout
==
None
)
{
solverExtensions1
}
else
{
val
t
=
Settings
.
solverTimeout
.
get
solverExtensions1
.
map
(
s
=>
new
TimeoutSolver
(
reporter
,
s
,
t
))
}
solverExtensions
.
foreach
(
_
.
setProgram
(
program
))
solverExtensions
.
foreach
(
_
.
setProgram
(
program
))
val
defaultTactic
=
new
DefaultTactic
(
reporter
)
val
defaultTactic
=
new
DefaultTactic
(
reporter
)
...
...
This diff is collapsed.
Click to expand it.
src/purescala/TimeoutSolver.scala
0 → 100644
+
32
−
0
View file @
28632c2c
package
purescala
import
Common._
import
Definitions._
import
Extensions._
import
Trees._
import
TypeTrees._
import
scala.sys.error
class
TimeoutSolver
(
reporter
:
Reporter
,
solver
:
Solver
,
timeout
:
Int
)
extends
Solver
(
reporter
)
{
val
description
=
solver
.
description
+
", with timeout"
override
val
shortDescription
=
solver
.
shortDescription
+
"+timeout"
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
}
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