All notable changes to the hasmtlib library will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to PVP versioning.
- Cardinality constraints in
Language.Hasmtlib.Counting
now use specialized and more efficient encodings for a few cases. - Debugging with debugger
statistically
now prints a more comprehensive overview about the problem size. - Fixed bug where setting multiple custom
SMTOption
s would only set the most recent. - Fixed bug where timeout for
SMT
/OMT
would not work. - Added smart constructors for
ite
.
- Added helpful instances for standard types for
Codec
to ease deriving. - Added decorator
timingout
inLanguage.Hasmtlib.Type.Solver
to set a time-out for solvers. Unfortunately as of SMTLib standard v2.6 there is no SMT-Option for this. Although some solvers likeZ3
(unreliably) support it, we instead do it by internally coordinating the kill of the solver process from Haskell usingSystem.Timeout.Lifted#timeout
. Works like a charme. - Added
Language.Hasmtlib.Type.Debugger
for debugging problem construction and solver interaction.
- (breaking change) Completely revised the way solver process-configurations are handled and debugged.
Solvers which previously had the type
Process.Config
fromsmtlib-backends
now have the typeSolverConfig
fromLanguage.Hasmtlib.Type.Solver
. This bundles information on the executable of the solver with additional information such as debugging and time-outs. Actual solver creation still is done by funtionsolver
. Therefore this change is only breaking, if you created custom solvers or debugged solvers. - Debugging solvers changed from
solveWith (debug z3 def) $ ...
tosolveWith (solver $ debugging z3 def) $ ...
. Also note that there are plenty debugging configurations besidesdef
existing inLanguage.Hasmtlib.Type.Debugger
now. - Interactive solving before was a two-stepper like
iZ3 <- interactiveSolver z3 ; interactiveWith iZ3 $ ...
. LeveragingSolverConfig
this has been changed to a more uniform way withinteractiveWith z3 $ do ...
. Also note thatdebugInteractiveWith z3 $ ...
now is replaced byinteractiveWith (debugging def z3) $ ...
.
- Removed
Language.Hasmtlib.Solver.Common
. Contents are now inLanguage.Hasmtlib.Type.Solver
.
- Added a solver configuration
bitwuzlaKissat
forBitwuzla
with underlying SAT-SolverKissat
.
- Removed
solveMinimizedDebug
&solveMaximizedDebug
. Use the modifiedsolveMinimized
&solveMaximized
instead. You can also provide a step-size now. - Fixed a bug where
MonadOMT#solve
would runget-model
although the solver did not necessarily respond withSat
. SharingMode
for sharing common (sub-)expressions now defaults toNone
. The previous defaultStableNames
in general is only worth using, when your program can benefit a lot from sharing. Otherwise it may drastically downgrade solver performance due to abundance of sharing-variables. If you still want to use it, runsetSharingMode StableNames
within the problems monad.
- Functions for enconding cardinality-constraints in
Language.Hasmtlib.Counting
now use specialized encodings for some cardinalities - improving solvers efficiency.
- Added module 'Language.Hasmtlib.Type.Relation' for encoding binary relations
- Added rich documentation and usage examples for all public modules
- Support for signed BitVec operations.
- Added constructor
Rem
forExpr t
.
- (breaking change) Enhanced the type of
BvSort Nat
toBvSort BvEnc Nat
whereBvEnc = Unsigned | Signed
. Before, the API only allowed unsigned BitVec, thereforeBvSort n
now becomesBvSort Unsigned n
. The promoted typeBvEnc
is phantom and only used for differentiating instances forNum
, ... - Moved
Language.Hasmtlib.Internal.Bitvec
toLanguage.Hasmtlib.Type.Bitvec
, exported API withLanguage.Hasmtlib
- Removed constructors
StrLT
andStrLTHE
fromExpr t
. - Fixed wrong implementation of Num for
Bitvec
.(+)
,(-)
and(*)
had invalid definitions.
- Added
SharingMode = None | StableNames
inLanguage.Hasmtlib.Internal.Sharing
. Defaults toStableNames
. - Added function
setSharingMode
which allows you to change theSharingMode
.
runSharing
inLanguage.Hasmtlib.Internal.Sharing
now differentiates sharing behavior based on newly given argument of typeSharingMode
- added instances
Eq
,Ord
,GEq
andGCompare
forExpr t
- added instances
Real
andEnum
forExpr IntSort
,Expr RealSort
andExpr (BvSort n)
- added instance
Integral
forExpr IntSort
andExpr (BvSort n)
- added instance
Bits
forExpr BoolSort
andExpr (BvSort n)
- Removed
Language.Hasmtlib.Integraled
: use the addedIntegral
instance instead - Removed redundant BitVec constructors from
Expr
and replaced usage in instances with the more generic existing ones. For example: WhereBvNot
was used previously, we now useNot
which is already used for Expr BoolSort. Differentiation between such operations now takes place inLanguage.Hasmtlib.Internal.Render#render
when rendering expressions, e.g. renderingbvnot
forBvSort
andnot
forBoolSort
. Therefore there is no behavioral change for the solver. - Removed functions
bvRotL
andbvRotR
fromLanguage.Hasmtlib.Type.Expr
: use the addedBits
instance instead withrotateL
androtateR
- Added observable sharing with
Language.Hasmtlib.Internal.Sharing
. Thank you fabeulous@github for the great help! - Added
Language.Hasmtlib.Internal.Uniplate1
for plating GADTs
- Deleted and moved
Language.Hasmtlib.Equatable
,Language.Hasmtlib.Orderable
,Language.Hasmtlib.Iteable
&Language.Hasmtlib.Internal.Expr
intoLanguage.Hasmtlib.Type.Expr
- Internal replacement of
Prelude.liftA2
for backwards compatiblity - Fixed bug where
solveMaximizedDebug
would solve minimized instead of maximized
- Instances for
Boolean
,Num
&Fractional
onExpr
now use smart constructors
- Added full SMTLib2.6-standard support for sort String
- Added module
Language.Hasmtlib.Lens
featuringinstance Plated (Expr t)
for rewriting
- Export constructors of
Expr t
instance Show (Expr t)
now displays expressions in SMTLib2-Syntax
- Added multiple basic instances for
Equatable
,Orderable
,Iteable
,Variable
&Codec
- (breaking change)
Variable
&Codec
now ship with aGeneric
default implementation instead of relying onApplicative
. This will break your instances if the type does not have an instance forGeneric
.
- Added solver Bitwuzla
- Added debugging capabilities for
Pipe
by introducingdebugInteractiveWith
- Yices now uses flag
--incremental
by default - (breaking change) Removed functional dependency
m -> s
fromMonadIncrSMT s m
. This forces you to specify the underlying state when usinginteractiveWith
. ThereforeinteractiveWith cvc5Living $ do ...
now becomesinteractiveWith @Pipe cvc5Living $ do ...
. - (breaking change) Removed
newtype ProcessSolver
and replaced it with underlyingSMTLIB.Backends.Process.Config
. This may only affect you if you instantiated custom solvers.
- Added more documentation
(<==>)
now hasinfixr 4
(<==)
now hasinfixl 0
- Arithmetic functions:
isIntSort
,toIntSort
&toRealSort
- Asserting maybe-formulas:
assertMaybe :: MonadSMT s m => Maybe (Expr BoolSort) -> m ()
- Logical equivalence
(<==>)
& reverse logical implication(<==)
- Solvers: OpenSMT, OptiMathSAT
- Iterative refinement optimizations utilizing incremental stack
- Custom solver options via
Custom String String :: SMTOption
- Optimization Modulo Theories (OMT) / MaxSMT support with:
minimize
,maximize
&assertSoft
- (breaking change) The functions
solver
anddebug
which createSolver
s fromProcessSolver
s are polymorph in the states
now. This requires you to annotate the mentioned functions with the targetted state. These areSMT
andOMT
. For example,solverWith (solver cvc5) $ do ...
becomessolverWith (solver @SMT cvc5) $ do ...
. - Prefix
xor
now has aninfix 4
- Added
count
inLanguage.Hasmtlib.Counting
- Added cardinality constraints with
Language.Hasmtlib.Counting
- Added n-ary comparisons
distinct
&equal
- (breaking change) When using
interactiveWith
theSMTOption
Incremental
is no longer set by default anymore
- Minor internal changes
- Added this
CHANGELOG.md
file
- Added
ArraySort
and full support for its SMTLib2 standard specification