A simple interpreter for ICurry based on the a small-step semantics.
The following invariants are required for ICurry programs:
data IOptions
Constructors:
type FingerPrint
= [(ChoiceID, Int)]
data Control
Constructors:
Known instances:
type IEnv
= [(IVarIndex, NodeID)]
data Task
Constructors:
Task
:: Control -> [(NodeID, Int)] -> FingerPrint -> Task
Known instances:
data State
Constructors:
Known instances:
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]
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
funDollarDollarBang
:: IFunction
standardFuncs
:: [IFunction]