CurryInfo: contract-prover-4.0.0 / ContractProver.addPreConditionCheck

definition:
addPreConditionCheck :: TypeExpr -> CombType -> QName -> TypeExpr -> [TAExpr]
                     -> TAExpr
addPreConditionCheck ty ct qf@(mn,fn) tys args =
  AComb ty FuncCall
    ((mn, maybe "checkPreCondNoShow" (const "checkPreCond") showdicttt),
     showDictTypeOf tt ~> ty ~> boolType ~> stringType ~> tt ~> ty)
    -- add Show dictionary argument of type tt, if possible:
    (maybe [] (:[]) showdicttt ++
    [ AComb ty ct (toNoCheckQName qf,tys) args
    , AComb boolType ct (toPreCondQName qf, pctype) args
    , string2TAFCY fn
    , tupleExpr args
    ])
 where
  argtypes   = map annExpr args
  tt         = tupleType argtypes
  pctype     = foldr FuncType boolType argtypes
  showdicttt = showDictOf tt
demand:
argument 3
deterministic:
deterministic operation
documentation:
---------------------------------------------------------------------------
-- Adds a precondition check to a original call of the form
-- `AComb ty ct (qf,tys) args`.
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,{(,)},_,_) |-> {AComb}}
name:
addPreConditionCheck
precedence:
no precedence defined
result-values:
{AComb}
signature:
FlatCurry.Types.TypeExpr -> FlatCurry.Types.CombType -> (String, String)
-> FlatCurry.Types.TypeExpr
-> [FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr]
-> FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term