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
2ff6b9b5
Commit
2ff6b9b5
authored
9 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Fallback to whatever is available, fatal otherwise.
parent
82e318bf
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
-4
31 additions, 4 deletions
src/main/scala/leon/solvers/SolverFactory.scala
with
31 additions
and
4 deletions
src/main/scala/leon/solvers/SolverFactory.scala
+
31
−
4
View file @
2ff6b9b5
...
...
@@ -9,6 +9,7 @@ import smtlib._
import
purescala.Definitions._
import
scala.reflect.runtime.universe._
import
_root_.smtlib.interpreters._
abstract
class
SolverFactory
[
+S
<:
Solver
:
TypeTag
]
{
def
getNewSolver
()
:
S
...
...
@@ -43,11 +44,21 @@ object SolverFactory {
val
names
=
ctx
.
findOptionOrDefault
(
SharedOptions
.
optSelectedSolvers
)
if
(((
names
contains
"fairz3"
)
||
(
names
contains
"unrollz3"
))
&&
!
hasNativeZ3
)
{
if
(!
reported
)
{
ctx
.
reporter
.
warning
(
"The Z3 native interface is not available, falling back to smt-based solver."
)
reported
=
true
if
(
hasZ3
)
{
if
(!
reported
)
{
ctx
.
reporter
.
warning
(
"The Z3 native interface is not available, falling back to smt-z3."
)
reported
=
true
}
getFromName
(
ctx
,
program
)(
"smt-z3"
)
}
else
if
(
hasCVC4
)
{
if
(!
reported
)
{
ctx
.
reporter
.
warning
(
"The Z3 native interface is not available, falling back to smt-cvc4."
)
reported
=
true
}
getFromName
(
ctx
,
program
)(
"smt-cvc4"
)
}
else
{
ctx
.
reporter
.
fatalError
(
"No SMT solver available: native Z3 api could not load and 'cvc4' or 'z3' binaries were not found in PATH."
)
}
getFromName
(
ctx
,
program
)(
"smt-z3"
)
}
else
{
getFromName
(
ctx
,
program
)(
names
.
toSeq
:
_
*
)
}
...
...
@@ -135,4 +146,20 @@ object SolverFactory {
}
}
lazy
val
hasZ3
=
try
{
Z3Interpreter
.
buildDefault
true
}
catch
{
case
e
:
java.io.IOException
=>
false
}
lazy
val
hasCVC4
=
try
{
CVC4Interpreter
.
buildDefault
true
}
catch
{
case
e
:
java.io.IOException
=>
false
}
}
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