A simple interpreter for ICurry based on the a small-step semantics.
The following invariants are required for ICurry programs:
defOpts
:: IOptions
|
withGraph
:: IOptions -> Int
|
lookupInEnv
:: Int -> [(Int,Int)] -> Int
|
updateEnv
:: [(Int,Int)] -> Int -> Int -> [(Int,Int)]
|
rootOfTask
:: Task -> Int
|
currentNodeOfTask
:: Task -> Int
|
initState
:: [IFunction] -> Graph -> Int -> State
|
rootsOfState
:: State -> [Int]
|
showResults
:: State -> String
|
addResult
:: Int -> State -> State
|
addTGState
:: ICOptions -> State -> [State] -> [State]
|
printState
:: IOptions -> State -> IO ()
|
askProceed
:: IOptions -> IO Bool
|
execProg
:: IOptions -> String -> String -> IO [State]
|
execIProg
:: IOptions -> IProg -> String -> IO [State]
|
runWith
:: IOptions -> State -> [State] -> IO (IOptions,[State])
|
evalFun
:: IProg -> String -> [String]
|
step
:: State -> State
|
evalFirstTask
:: State -> [Task] -> State
|
invokeFunction
:: State -> [Task] -> State
|
evalExternal
:: Graph -> String -> [Int] -> Node
|
lookupIntNode
:: Int -> Graph -> Int
|
selectConsBranch
:: Node -> [IConsBranch] -> IBlock
|
selectLitBranch
:: Node -> [ILitBranch] -> IBlock
|
addVarDecls
:: Graph -> [(Int,Int)] -> [IVarDecl] -> (Graph,[(Int,Int)])
|
addAssigns
:: Graph -> [(Int,Int)] -> [IAssign] -> (Graph,[(Int,Int)])
|
replaceNodeArg
:: Graph -> Int -> Int -> Int -> Graph
|
followPath
:: Graph -> Int -> [Int] -> Int
|
extendGraph
:: Graph -> [(Int,Int)] -> IExpr -> (Graph,Either Int Node)
|
extendGraphL
:: Graph -> [(Int,Int)] -> [IExpr] -> (Graph,[Int])
|
showILit
:: ILiteral -> String
|
funcOf
:: String -> [IFunction] -> IFunction
|
arityOf
:: String -> [IFunction] -> Int
|
bodyOf
:: String -> [IFunction] -> IFuncBody
|
demandOf
:: String -> [IFunction] -> Maybe Int
|
choiceOfDemand
:: State -> Int -> Maybe IExpr
|
funApply
:: IFunction
|
funSeq
:: IFunction
|
funDollarBang
:: IFunction
|
funDollarDollarBang
:: IFunction
|
funDollarHash
:: IFunction
|
funNormalForm
:: IFunction
|
standardFuncs
:: [IFunction]
|