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
fc3b9930
Commit
fc3b9930
authored
9 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
ble
parent
d920a174
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/solvers/SolverFactory.scala
+31
-31
31 additions, 31 deletions
src/main/scala/leon/solvers/SolverFactory.scala
with
31 additions
and
31 deletions
src/main/scala/leon/solvers/SolverFactory.scala
+
31
−
31
View file @
fc3b9930
...
...
@@ -67,55 +67,55 @@ object SolverFactory {
ctx
.
reporter
.
fatalError
(
"No SMT solver available: native Z3 api could not load and 'cvc4' or 'z3' binaries were not found in PATH."
)
}
}
else
{
getFromName
(
ctx
,
program
)(
names
.
toSeq
:
_
*
)
getFromName
s
(
ctx
,
program
)(
names
.
toSeq
:
_
*
)
}
}
private
def
getFromName
(
ctx
:
LeonContext
,
program
:
Program
)(
names
:
String*
)
:
SolverFactory
[
TimeoutSolver
]
=
{
private
def
showSolvers
(
ctx
:
LeonContext
)
=
{
ctx
.
reporter
.
error
(
availableSolversPretty
)
ctx
.
reporter
.
fatalError
(
"Aborting Leon..."
)
}
def
get
Solver
(
name
:
String
)
:
SolverFactory
[
TimeoutSolver
]
=
name
match
{
case
"fairz3"
=>
SolverFactory
(()
=>
new
FairZ3Solver
(
ctx
,
program
)
with
TimeoutSolver
)
def
get
FromName
(
ctx
:
LeonContext
,
program
:
Program
)
(
name
:
String
)
:
SolverFactory
[
IncrementalSolver
with
TimeoutSolver
]
=
name
match
{
case
"fairz3"
=>
SolverFactory
(()
=>
new
FairZ3Solver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"unrollz3"
=>
SolverFactory
(()
=>
new
UnrollingSolver
(
ctx
,
program
,
new
UninterpretedZ3Solver
(
ctx
,
program
))
with
TimeoutSolver
)
case
"unrollz3"
=>
SolverFactory
(()
=>
new
UnrollingSolver
(
ctx
,
program
,
new
UninterpretedZ3Solver
(
ctx
,
program
))
with
TimeoutSolver
)
case
"enum"
=>
SolverFactory
(()
=>
new
EnumerationSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"enum"
=>
SolverFactory
(()
=>
new
EnumerationSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"ground"
=>
SolverFactory
(()
=>
new
GroundSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"ground"
=>
SolverFactory
(()
=>
new
GroundSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"smt-z3"
=>
SolverFactory
(()
=>
new
UnrollingSolver
(
ctx
,
program
,
new
SMTLIBZ3Solver
(
ctx
,
program
))
with
TimeoutSolver
)
case
"smt-z3"
=>
SolverFactory
(()
=>
new
UnrollingSolver
(
ctx
,
program
,
new
SMTLIBZ3Solver
(
ctx
,
program
))
with
TimeoutSolver
)
case
"smt-z3-q"
=>
SolverFactory
(()
=>
new
SMTLIBZ3QuantifiedSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"smt-z3-q"
=>
SolverFactory
(()
=>
new
SMTLIBZ3QuantifiedSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"smt-cvc4"
=>
SolverFactory
(()
=>
new
UnrollingSolver
(
ctx
,
program
,
new
SMTLIBCVC4Solver
(
ctx
,
program
))
with
TimeoutSolver
)
case
"smt-cvc4"
=>
SolverFactory
(()
=>
new
UnrollingSolver
(
ctx
,
program
,
new
SMTLIBCVC4Solver
(
ctx
,
program
))
with
TimeoutSolver
)
case
"smt-cvc4-proof"
=>
SolverFactory
(()
=>
new
SMTLIBCVC4ProofSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"smt-cvc4-proof"
=>
SolverFactory
(()
=>
new
SMTLIBCVC4ProofSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"smt-cvc4-cex"
=>
SolverFactory
(()
=>
new
SMTLIBCVC4CounterExampleSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
"smt-cvc4-cex"
=>
SolverFactory
(()
=>
new
SMTLIBCVC4CounterExampleSolver
(
ctx
,
program
)
with
TimeoutSolver
)
case
_
=>
ctx
.
reporter
.
error
(
s
"Unknown solver $name"
)
showSolvers
()
}
case
_
=>
ctx
.
reporter
.
error
(
s
"Unknown solver $name"
)
showSolvers
(
ctx
)
}
def
showSolvers
()
=
{
ctx
.
reporter
.
error
(
availableSolversPretty
)
ctx
.
reporter
.
fatalError
(
"Aborting Leon..."
)
}
def
getFromNames
(
ctx
:
LeonContext
,
program
:
Program
)(
names
:
String*
)
:
SolverFactory
[
TimeoutSolver
]
=
{
val
selectedSolvers
=
names
.
map
(
get
Solver
)
val
selectedSolvers
=
names
.
map
(
get
FromName
(
ctx
,
program
)
)
if
(
selectedSolvers
.
isEmpty
)
{
ctx
.
reporter
.
error
(
s
"No solver selected."
)
showSolvers
()
showSolvers
(
ctx
)
}
else
if
(
selectedSolvers
.
size
==
1
)
{
selectedSolvers
.
head
}
else
{
...
...
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