CurryInfo: contract-prover-4.0.0 / ContractProver.extractPostConditionProofObligation

definition:
extractPostConditionProofObligation :: VerifyInfo -> [Int] -> Int -> TARule
                                    -> TransStateM Term
extractPostConditionProofObligation _ _ _ (AExternal _ s) =
  return $ tComb ("External: " ++ s) []
extractPostConditionProofObligation ti args resvar
                                    (ARule ty orgargs orgexp) = do
  let exp    = rnmAllVars renameRuleVar orgexp
      rtype  = resType (length orgargs) (stripForall ty)
  put $ makeTransState (maximum (resvar : allVars exp) + 1)
                       ((resvar, rtype) : zip args (map snd orgargs))
  binding2SMT True ti (resvar,exp)
 where
  maxArgResult = maximum (resvar : args)
  renameRuleVar r = maybe (r + maxArgResult + 1)
                          (args!!)
                          (elemIndex r (map fst orgargs))

  resType n te =
    if n==0
      then te
      else case te of
             FuncType _ rt -> resType (n-1) rt
             _             -> error $ "Internal errror: resType: " ++ show te
demand:
argument 4
deterministic:
deterministic operation
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,_,_,{AExternal}) |-> _ || (_,_,_,{ARule}) |-> _}
name:
extractPostConditionProofObligation
precedence:
no precedence defined
result-values:
_
signature:
VerifierState.VerifyInfo -> [Prelude.Int] -> Prelude.Int
-> FlatCurry.Annotated.Types.ARule 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