|
definition: |
pred2smt :: TAExpr -> TransStateM Term
pred2smt exp = case exp of
AVar _ i -> return (TSVar i)
ALit _ l -> return (lit2SMT l)
AComb _ ct (qf,ftype) args ->
if qf == pre "not" && length args == 1
then do barg <- pred2smt (head args)
return (tNot barg)
else do bargs <- mapM pred2smt args
return (TComb (cons2SMT (ct /= ConsCall || not (null bargs))
False qf ftype) bargs)
_ -> error $ "Translation of some Boolean expressions into SMT " ++
"not yet supported:\n" ++ show (unAnnExpr exp)
|
|
demand: |
argument 1 |
|
deterministic: |
deterministic operation |
|
documentation: |
Translates a Boolean FlatCurry expression into an SMT formula. |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{({AVar}) |-> _ || ({ALit}) |-> _ || ({AComb}) |-> _ || ({ALet}) |-> _ || ({AFree}) |-> _ || ({AOr}) |-> _ || ({ACase}) |-> _ || ({ATyped}) |-> _}
|
|
name: |
pred2smt |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr -> Control.Monad.Trans.State.StateT TransState Prelude.IO ESMT.Term |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |