sop-satisfier-0.3.4.5: Check satisfiability of expressions on natural numbers
Safe HaskellSafe-Inferred
LanguageHaskell2010

SoPSat.Satisfier

Synopsis

State

State manipulation

declare Source #

Arguments

:: (Ord f, Ord c) 
=> SoPE f c

Expression to declare

-> SolverState f c Bool
  • True - if expression was declared
  • False - if expression contradicts current state

State will become Nothing if it cannot reason about these kind of expressions

Declare expression to the state

assert Source #

Arguments

:: (Ord f, Ord c) 
=> SoPE f c

Asserted expression

-> SolverState f c Bool
  • True - if expressions holds
  • False - otherwise

State will become Nothing if it cannot reason about these kind of expressions

Assert if given expression holds in the current environment

unify Source #

Arguments

:: (Ord f, Ord c) 
=> SoPE f c

Unified expression

-> SolverState f c [SoPE f c]

List of unifiers - Minimal list of unifiers for the expression to hold. The list is empty, if it never holds

State will always be valid after a call

Get unifiers for an expression minimal set of expressions that should hold for the expression to hold

State information

range Source #

Arguments

:: (Ord f, Ord c) 
=> SoP f c

Expression

-> SolverState f c (Maybe (SoP f c), Maybe (SoP f c))

(lower bound, upper bound) - Range for an expression

Nothing means that the expression is unbounded from that side

Get range of possible values for an expression

ranges Source #

Arguments

:: (Ord f, Ord c) 
=> SolverState f c [(Maybe (SoP f c), SoP f c, Maybe (SoP f c))]

(lower bound, symbol, upper bound) - Similar to range but also provides expression

Get list of all ranges stored in a state

State execution

withState :: (Ord f, Ord c) => State f c -> SolverState f c () Source #

Puts a state to use during computations

runStatements :: (Ord f, Ord c) => SolverState f c a -> Maybe (a, State f c) Source #

Runs computation returning result and resulting state

evalStatements :: (Ord f, Ord c) => SolverState f c a -> Maybe a Source #

Similar to runStatements but does not return final state

Expressions

evalSoP Source #

Arguments

:: (Ord f, Ord c, Floating n) 
=> SoP f c

Expression to evaluate

-> Map (Atom f c) n

Bindings from atoms to values

-> n

Evaluation result

Evaluates SoP given atom bindings