Module Translation

Module defining operations to translate rules into rules implementing a sequential rule selection strategy.

Author: Lasse Folger (with changes by Michael Hanus)

Version: September 2015

Summary of exported operations:

newprog :: CurryProg -> String -> CurryProg   
replaceRules :: [CFuncDecl] -> String -> [CFuncDecl]   
transSRule :: [CPattern] -> [([CPattern],CExpr,CExpr,[CLocalDecl])] -> String -> [(Int,String)] -> CTypeExpr -> CRule   
buildexp :: [(String,String)] -> [([CPattern],CExpr,CExpr,[CLocalDecl])] -> String -> [(Int,String)] -> CTypeExpr -> (CExpr,[CLocalDecl])   
removedouble :: [CLocalDecl] -> [CPattern] -> [CLocalDecl]   
letDecl :: [CLocalDecl] -> CExpr -> CExpr   
alwaysTrue :: CExpr -> Bool   
transMRules :: [CRule] -> String -> CTypeExpr -> CRule   
generateP :: [(Int,String)] -> [CPattern]   
gather :: CRule -> [([CPattern],CExpr,CExpr,[CLocalDecl])]   
getNames :: [([CPattern],CExpr,CExpr,[CLocalDecl])] -> [String]   

Exported operations:

newprog :: CurryProg -> String -> CurryProg   

replaceRules :: [CFuncDecl] -> String -> [CFuncDecl]   

transSRule :: [CPattern] -> [([CPattern],CExpr,CExpr,[CLocalDecl])] -> String -> [(Int,String)] -> CTypeExpr -> CRule   

buildexp :: [(String,String)] -> [([CPattern],CExpr,CExpr,[CLocalDecl])] -> String -> [(Int,String)] -> CTypeExpr -> (CExpr,[CLocalDecl])   

Further infos:
  • partially defined

letDecl :: [CLocalDecl] -> CExpr -> CExpr   

alwaysTrue :: CExpr -> Bool   

transMRules :: [CRule] -> String -> CTypeExpr -> CRule   

generateP :: [(Int,String)] -> [CPattern]   

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

gather :: CRule -> [([CPattern],CExpr,CExpr,[CLocalDecl])]   

getNames :: [([CPattern],CExpr,CExpr,[CLocalDecl])] -> [String]