Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
i7
peregrine
Commits
2c4fc15f
Commit
2c4fc15f
authored
Feb 07, 2017
by
Philipp J. Meyer
Browse files
added option to disable auto config of smt solver
parent
2fc3ba4b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Main.hs
View file @
2c4fc15f
...
@@ -478,17 +478,17 @@ refineTerminalMarkingsUniqueConsensusProperty net traps siphons inequalities c@(
...
@@ -478,17 +478,17 @@ refineTerminalMarkingsUniqueConsensusProperty net traps siphons inequalities c@(
r1
<-
checkSatMin
$
Solver
.
TerminalMarkingsUniqueConsensus
.
checkUnmarkedTrapSat
net
m0
m1
m2
x1
x2
r1
<-
checkSatMin
$
Solver
.
TerminalMarkingsUniqueConsensus
.
checkUnmarkedTrapSat
net
m0
m1
m2
x1
x2
case
r1
of
case
r1
of
Nothing
->
do
Nothing
->
do
r
eturn
(
Just
c
,
traps
,
siphons
,
inequalities
)
r
2
<-
checkSatMin
$
Solver
.
TerminalMarkingsUniqueConsensus
.
checkGeneralizedSiphonConstraintsSat
net
m0
m1
m2
x1
x2
--
r2 <- checkSatMin $ Solver.TerminalMarkingsUniqueConsensus.checkGeneralizedSiphonConstraintsSat net m0 m1 m2 x1 x2
case
r2
of
--
case r2 of
Nothing
->
do
--
Nothing -> do
return
(
Just
c
,
traps
,
siphons
,
inequalities
)
-- r3 <- checkSat $ Solver.TerminalMarkingsUniqueConsensus.checkGeneralizedCoTrapSat net m0 m1 m2 x1 x2
-- r3 <- checkSat $ Solver.TerminalMarkingsUniqueConsensus.checkGeneralizedCoTrapSat net m0 m1 m2 x1 x2
-- case r3 of
-- case r3 of
-- Nothing -> return (Just c, traps, siphons, inequalities)
-- Nothing -> return (Just c, traps, siphons, inequalities)
-- Just inequality ->
-- Just inequality ->
-- checkTerminalMarkingsUniqueConsensusProperty' net traps siphons (inequality:inequalities)
-- checkTerminalMarkingsUniqueConsensusProperty' net traps siphons (inequality:inequalities)
--
Just siphon ->
Just
siphon
->
--
checkTerminalMarkingsUniqueConsensusProperty' net traps (siphon:siphons) inequalities
checkTerminalMarkingsUniqueConsensusProperty'
net
traps
(
siphon
:
siphons
)
inequalities
Just
trap
->
Just
trap
->
checkTerminalMarkingsUniqueConsensusProperty'
net
(
trap
:
traps
)
siphons
inequalities
checkTerminalMarkingsUniqueConsensusProperty'
net
(
trap
:
traps
)
siphons
inequalities
...
...
src/Options.hs
View file @
2c4fc15f
...
@@ -48,6 +48,7 @@ data Options = Options { inputFormat :: InputFormat
...
@@ -48,6 +48,7 @@ data Options = Options { inputFormat :: InputFormat
,
optRefinementType
::
Maybe
RefinementType
,
optRefinementType
::
Maybe
RefinementType
,
optMinimizeRefinement
::
Int
,
optMinimizeRefinement
::
Int
,
optAuto
::
Bool
,
optAuto
::
Bool
,
optSMTAuto
::
Bool
,
optInvariant
::
Bool
,
optInvariant
::
Bool
,
optBoolConst
::
Bool
,
optBoolConst
::
Bool
,
optOutput
::
Maybe
String
,
optOutput
::
Maybe
String
...
@@ -67,6 +68,7 @@ startOptions = Options { inputFormat = PNET
...
@@ -67,6 +68,7 @@ startOptions = Options { inputFormat = PNET
,
optRefinementType
=
Just
SComponentWithCutRefinement
,
optRefinementType
=
Just
SComponentWithCutRefinement
,
optMinimizeRefinement
=
0
,
optMinimizeRefinement
=
0
,
optAuto
=
False
,
optAuto
=
False
,
optSMTAuto
=
True
,
optInvariant
=
False
,
optInvariant
=
False
,
optBoolConst
=
False
,
optBoolConst
=
False
,
optOutput
=
Nothing
,
optOutput
=
Nothing
...
@@ -273,6 +275,10 @@ options =
...
@@ -273,6 +275,10 @@ options =
(
NoArg
(
\
opt
->
Right
opt
{
optAuto
=
True
}))
(
NoArg
(
\
opt
->
Right
opt
{
optAuto
=
True
}))
"Automatically find best refinement, minimization and simplification method"
"Automatically find best refinement, minimization and simplification method"
,
Option
""
[
"smt-disable-auto-config"
]
(
NoArg
(
\
opt
->
Right
opt
{
optSMTAuto
=
False
}))
"Disable automatic configuration of the SMT solver"
,
Option
"v"
[
"verbose"
]
,
Option
"v"
[
"verbose"
]
(
NoArg
(
\
opt
->
Right
opt
{
optVerbosity
=
optVerbosity
opt
+
1
}))
(
NoArg
(
\
opt
->
Right
opt
{
optVerbosity
=
optVerbosity
opt
+
1
}))
"Increase verbosity (may be specified more than once)"
"Increase verbosity (may be specified more than once)"
...
...
src/Solver.hs
View file @
2c4fc15f
...
@@ -30,12 +30,18 @@ symConstraints vars constraint = do
...
@@ -30,12 +30,18 @@ symConstraints vars constraint = do
syms
<-
mapM
exists
vars
syms
<-
mapM
exists
vars
return
$
constraint
$
val
$
M
.
fromList
$
vars
`
zip
`
syms
return
$
constraint
$
val
$
M
.
fromList
$
vars
`
zip
`
syms
getSolverConfig
::
Bool
->
Bool
->
SMTConfig
getSolverConfig
verbose
auto
=
let
tweaks
=
if
auto
then
[]
else
[
"(set-option :auto_config false)"
]
in
z3
{
verbose
=
verbose
,
solverTweaks
=
tweaks
}
checkSat
::
(
SatModel
a
,
SymWord
a
,
Show
a
,
Show
b
)
=>
checkSat
::
(
SatModel
a
,
SymWord
a
,
Show
a
,
Show
b
)
=>
ConstraintProblem
a
b
->
OptIO
(
Maybe
b
)
ConstraintProblem
a
b
->
OptIO
(
Maybe
b
)
checkSat
(
problemName
,
resultName
,
vars
,
constraint
,
interpretation
)
=
do
checkSat
(
problemName
,
resultName
,
vars
,
constraint
,
interpretation
)
=
do
verbosePut
2
$
"Checking SAT of "
++
problemName
verbosePut
2
$
"Checking SAT of "
++
problemName
verbosity
<-
opt
optVerbosity
verbosity
<-
opt
optVerbosity
result
<-
liftIO
(
satWith
z3
{
verbose
=
verbosity
>=
4
}
autoConf
<-
opt
optSMTAuto
result
<-
liftIO
(
satWith
(
getSolverConfig
(
verbosity
>=
4
)
autoConf
)
(
symConstraints
vars
constraint
))
(
symConstraints
vars
constraint
))
case
rebuildModel
vars
(
getModel
result
)
of
case
rebuildModel
vars
(
getModel
result
)
of
Nothing
->
do
Nothing
->
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment