CurryInfo: icurry-3.2.0 / ICurry.Interpreter.execIProg

definition: Info
 
execIProg :: IOptions -> IProg -> String -> IO ([TG.State])
execIProg opts (IProg _ _ _ ifuns) f = do
  let (g,ni)  = addNode (FuncNode f []) emptyGraph
      pdfmain = optOutput (icOptions opts)
      opts1   = if null pdfmain
                  then opts
                  else opts { icOptions = (icOptions opts) { optShowGraph = 0 }
                            , stepNum = 1 }
  when (withGraph opts1 > 0) $
    viewDot (Just $ optViewPDF (icOptions opts)) 0
            (graphToDot g [] (withGraph opts1 > 2) (withGraph opts1 > 1))
  let allfuns = ifuns ++ standardFuncs
  unless (arityOf f allfuns == 0) $
    error $ "Main function '" ++ f ++ "' has non-zero arity!"
  (opts2,states) <- runWith opts1 (initState allfuns g ni) []
  unless (null pdfmain) $ do
    -- Concatenate all step PDFs into on PDF:
    let pdffiles = map (\i -> "ICURRYDOT" ++ show i ++ ".pdf")
                       [1 .. stepNum opts2]
    system $ unwords $ "pdftk" : pdffiles ++ ["cat", "output", pdfmain]
    system $ unwords $ "/bin/rm -f" : pdffiles
    putStrLn $ "PDFs of all steps written to '" ++ pdfmain ++ "'."
  return states
 where
  checkMainFunc ifs f = do
    let IFunction _ ar _ _ _ = funcOf f ifs
    unless (ar == 0) $ error $ "Function '" ++ f ++ "' has non-zero arity!"
demand: Info
 argument 2
deterministic: Info
 deterministic operation
documentation: Info
 
An interpreter for ICurry programs.
Executes a program with a main function where the name is provided
as a string.
It also prints intermediate steps, PDFs, etc. accordding to the options.
failfree: Info
 <FAILING>
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{IProg},_) |-> _}
name: Info
 execIProg
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 IOptions -> ICurry.Types.IProg -> String -> Prelude.IO [TermGraph.XML.State]
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term