definition: |
inferNFCallRule :: Int -> TypeExpr -> TypeExpr -> QName -> TARule -> Maybe TAExpr -> TARule inferNFCallRule _ _ _ _ r@(AExternal _ _) _ = r inferNFCallRule arity nftype ty' qn (ARule _ argVars _) texp = ARule nftype (argVars ++ rhsVars) expr where expr = case texp of Nothing -> AComb boolType FuncCall (qn, ty') (replicate (length argVars) (boolExpr "True") ++ map (\(i, t) -> AVar t i) argVars) Just e -> e argIndxs = map fst argVars freshVar = maximum (argIndxs ++ allVars expr) + 1 rhsVars = drop (length argVars) (addTypes2Vars (argIndxs ++ [freshVar ..]) (stripForall nftype)) addTypes2Vars (v : vs) ty = case ty of FuncType t1 t2 -> (v, t1) : addTypes2Vars vs t2 _ -> [] |
demand: |
argument 5 |
deterministic: |
deterministic operation |
documentation: |
--- Return rule for calling inferred NFC with initial boolean values |
failfree: |
<FAILING> |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,_,_,_,{AExternal},_) |-> {AExternal} || (_,_,_,_,{ARule},_) |-> {ARule}} |
name: |
inferNFCallRule |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
Prelude.Int -> FlatCurry.Types.TypeExpr -> FlatCurry.Types.TypeExpr -> (String, String) -> FlatCurry.Annotated.Types.ARule FlatCurry.Types.TypeExpr -> Prelude.Maybe (FlatCurry.Annotated.Types.AExpr FlatCurry.Types.TypeExpr) -> FlatCurry.Annotated.Types.ARule FlatCurry.Types.TypeExpr |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |