Module ICurry.Interpreter

A simple interpreter for ICurry based on the a small-step semantics.

Summary of exported operations:

defOpts :: IOptions   
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   
printState :: IOptions -> State -> IO ()   
askProceed :: IOptions -> IO Bool   
execProg :: IOptions -> String -> String -> IO ()   
execIProg :: IOptions -> IProg -> String -> IO ()   
runWith :: IOptions -> State -> IO IOptions   
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   
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]   

Exported datatypes:


IOptions

Constructors:

  • IOptions :: Int -> Bool -> Bool -> String -> Bool -> Bool -> Int -> Bool -> Int -> IOptions

    Fields:

    • verbosity :: Int
    • showAllExps :: Bool
    • withGraph :: Bool
    • withViewer :: String
    • fullGraph :: Bool
    • interactive :: Bool
    • waitTime :: Int
    • makePDF :: Bool
    • stepNum :: Int

FingerPrint

Type synonym: FingerPrint = [(ChoiceID,Int)]


Control

Constructors:


IEnv

Type synonym: IEnv = [(IVarIndex,NodeID)]


Task

Constructors:


State

Constructors:


Exported operations:

defOpts :: IOptions   

Further infos:
  • solution complete, i.e., able to compute all solutions

lookupInEnv :: Int -> [(Int,Int)] -> Int   

updateEnv :: [(Int,Int)] -> Int -> Int -> [(Int,Int)]   

rootOfTask :: Task -> Int   

currentNodeOfTask :: Task -> Int   

initState :: [IFunction] -> Graph -> Int -> State   

Further infos:
  • solution complete, i.e., able to compute all solutions

rootsOfState :: State -> [Int]   

showResults :: State -> String   

addResult :: Int -> State -> State   

Further infos:
  • solution complete, i.e., able to compute all solutions

printState :: IOptions -> State -> IO ()   

askProceed :: IOptions -> IO Bool   

execProg :: IOptions -> String -> String -> IO ()   

execIProg :: IOptions -> IProg -> String -> IO ()   

runWith :: IOptions -> State -> IO IOptions   

evalFun :: IProg -> String -> [String]   

step :: State -> State   

evalFirstTask :: State -> [Task] -> State   

invokeFunction :: State -> [Task] -> State   

evalExternal :: Graph -> String -> [Int] -> Node   

lookupIntNode :: Int -> Graph -> Int   

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   

bodyOf :: String -> [IFunction] -> IFuncBody   

demandOf :: String -> [IFunction] -> Maybe Int   

choiceOfDemand :: State -> Int -> Maybe IExpr   

funApply :: IFunction   

Further infos:
  • solution complete, i.e., able to compute all solutions

funSeq :: IFunction   

funDollarBang :: IFunction   

Further infos:
  • solution complete, i.e., able to compute all solutions

funDollarHash :: IFunction   

Further infos:
  • solution complete, i.e., able to compute all solutions

funNormalForm :: IFunction   

Further infos:
  • solution complete, i.e., able to compute all solutions