definition:
|
fromExpr :: QName -> CExpr -> (Term QName, Subst QName, TRS QName)
fromExpr _ (CVar (v, _)) = (TermVar v, emptySubst, [])
fromExpr _ (CLit l) = (fromLiteral l, emptySubst, [])
fromExpr _ (CSymbol s) = (tConst s, emptySubst, [])
fromExpr fn (CApply fe e) =
let (ft, fs, ftrs) = fromExpr fn fe
(et, es, etrs) = fromExpr fn e
sub = composeSubst fs es
in case ft of
TermVar _ -> error "fromExpr: Argument is not a function!"
TermCons c ts -> (TermCons c (ts ++ [et]), sub, ftrs ++ etrs)
fromExpr fn (CLambda _ _) = error (pError "fromExpr" "CLambda" fn)
fromExpr fn (CLetDecl _ _) = error (pError "fromExpr" "CLetDecl" fn)
fromExpr fn (CDoExpr _) = error (pError "fromExpr" "CDoExpr" fn)
fromExpr fn (CListComp _ _) = error (pError "fromExpr" "CListComp" fn)
fromExpr fn (CCase _ _ _) = error (pError "fromExpr" "CCase" fn)
fromExpr fn (CTyped e _) = fromExpr fn e
fromExpr fn (CRecConstr _ _) = error (pError "fromExpr" "CRecConstr" fn)
fromExpr fn (CRecUpdate _ _) = error (pError "fromExpr" "CRecUpdate" fn)
|
demand:
|
argument 2
|
deterministic:
|
deterministic operation
|
documentation:
|
--- Transforms an abstract Curry expression for the function with the given
--- name into a tuple of a term, a substitution and a term rewriting system.
|
failfree:
|
(_, _)
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,{CVar}) |-> {(,,)} || (_,{CLit}) |-> {(,,)} || (_,{CSymbol}) |-> {(,,)} || (_,{CApply}) |-> {(,,)} || (_,{CTyped}) |-> {(,,)}}
|
name:
|
fromExpr
|
precedence:
|
no precedence defined
|
result-values:
|
{(,,)}
|
signature:
|
(String, String) -> AbstractCurry.Types.CExpr
-> (Rewriting.Term.Term (String, String), Data.Map.Map Prelude.Int (Rewriting.Term.Term (String, String)), [(Rewriting.Term.Term (String, String), Rewriting.Term.Term (String, String))])
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|