CurryInfo: call-analysis-3.2.0 / LetDropping.insertLetInExp

definition: Info
 
insertLetInExp :: [Rule] -> Term -> Term
insertLetInExp _ (Var i) = Var i
insertLetInExp rls (Func Cons c args) =
  Func Cons c (map (insertLetInExp rls) args)
insertLetInExp rls (Func Def f args) =
  let (_,hashp) = break (=='#') f
  in if null hashp || take 4 hashp /= "#LET"
       then Func Def f (map (insertLetInExp rls) args)
       else let letrules = funcRules f rls
            in if length letrules /= 1
                 then error $ "LetDropping: incorrect rules for " ++ f
                 else let (largs,lexp) = head letrules
                          freenums = case readNat (fst (break (=='_')
                                                          (drop 4 hashp))) of
                                       [(n,"")] -> n
                                       _ -> error $ "readNat in insertLetInExp"
                      in replaceLetCall f args freenums
                           (insertLetInRule rls (Rule f largs lexp))
demand: Info
 argument 2
deterministic: Info
 deterministic operation
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{Var}) |-> {Var} || (_,{Func}) |-> _}
name: Info
 insertLetInExp
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 [TRS.Rule] -> TRS.Term -> TRS.Term
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term