CurryInfo: contract-prover-4.0.0 / ContractProver.addPostConditionCheck

definition: Info
 
addPostConditionCheck :: QName -> TARule -> TAExpr
addPostConditionCheck _ (AExternal _ _) =
  error $ "Trying to add postcondition to external function!"
addPostConditionCheck qf@(mn,fn) (ARule _ lhs rhs) =
  AComb ty FuncCall
    ((mn, if showdictsexists then "checkPostCond" else "checkPostCondNoShow"),
     showDictTypeOf ty ~> showDictTypeOf tt
       ~> ty ~> (ty ~> boolType) ~> stringType ~> tt ~> ty)
    (-- add Show dictionary arguments of types ty and tt, if both exist:
     (if showdictsexists then catMaybes showdicts else []) ++
     [ rhs
     , AComb boolType (FuncPartCall 1) (toPostCondQName qf, ty) args
     , string2TAFCY fn
     , tupleExpr args
     ])
 where
  args = map (\ (i,t) -> AVar t i) lhs
  tt   = tupleType (map annExpr args)
  ty   = annExpr (last args)
  showdicts       = [showDictOf ty, showDictOf tt]
  showdictsexists = all isJust showdicts
demand: Info
 argument 2
deterministic: Info
 deterministic operation
documentation: Info
 
Adds a postcondition check to a program rule of a given operation.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{AExternal}) |-> _ || ({(,)},{ARule}) |-> {AComb}}
name: Info
 addPostConditionCheck
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 (String, String) -> FlatCurry.Annotated.Types.ARule FlatCurry.Types.TypeExpr
-> FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term