Module TransformPluralArguments

A tool to support plural arguments by a transformation on Curry programs.

Author: Michael Hanus

Version: 22/06/2015

Summary of exported operations:

:: String   
defaultTParam :: TParam   
setRunQuiet :: TParam -> TParam   
setCompile :: TParam -> TParam   
setExec :: TParam -> TParam   
main :: IO ()   
usageInfo :: String   
transformPlural :: TParam -> String -> IO ()   
compileAcyFcy :: Bool -> String -> IO ()   
pluralArgsOfProg :: CurryProg -> [((String,String),[Int])]   
pluralArgsOfFunc :: CFuncDecl -> [((String,String),[Int])]   
pluralArgsOfType :: Int -> CTypeExpr -> [Int]   
tcPlural :: (String,String)   
tcPluralArg :: (String,String)   
tcplural :: (String,String)   
tPluralProg :: [((String,String),[Int])] -> CurryProg -> CurryProg   
tPluralFunc :: String -> [((String,String),[Int])] -> CFuncDecl -> CFuncDecl   
tPluralType :: [Int] -> Int -> CTypeExpr -> CTypeExpr   
tPluralRule :: String -> [((String,String),[Int])] -> [Int] -> CRule -> CRule   
replacePluralCPatterns :: [Int] -> (Int,CPattern) -> CPattern   
funPatError :: a   
lazyPatError :: a   
recPatError :: a   
freshVar :: Int -> (Int,String)   
matchForPluralCPatterns :: String -> [Int] -> (Int,CPattern) -> [CExpr]   
pluralVarsOfPattern :: String -> [Int] -> (Int,CPattern) -> ([((Int,String),CExpr)],[CFuncDecl])   
pluralVarsOfPattern' :: String -> [a] -> (Int,String) -> (a,CPattern) -> ([((Int,String),CExpr)],[CFuncDecl])   
projectPluralPatternVars :: String -> (Int,String) -> String -> (Int,CPattern) -> [((Int,String),CExpr)]   
projectFunctions :: String -> CPattern -> String -> (Int,CPattern) -> [CFuncDecl]   
tPluralExp :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CExpr -> CExpr   
tPluralBranch :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> (CPattern,CRhs) -> (CPattern,CRhs)   
tPluralRhs :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CRhs -> CRhs   
tPluralLocalDecl :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CLocalDecl -> CLocalDecl   
tPluralStat :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CStatement -> CStatement   
tPluralApply :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CExpr -> CExpr -> CExpr   
apply2funcall :: CExpr -> Maybe ((String,String),[CExpr])   
(~>) :: CTypeExpr -> CTypeExpr -> CTypeExpr   
A function type.
baseType :: (String,String) -> CTypeExpr   
A base type.
applyF :: (String,String) -> [CExpr] -> CExpr   
An application of a qualified function name to a list of arguments.
constF :: (String,String) -> CExpr   
A constant, i.e., an application without arguments.
pre :: String -> (String,String)   
Converts a string into a qualified name of the Prelude.
preSuccess :: CExpr   
list2conj :: [CExpr] -> CExpr   

Exported datatypes:


TParam

Constructors:

  • TParam :: Bool -> Bool -> Bool -> TParam

Exported operations:

defaultTParam :: TParam   

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

setRunQuiet :: TParam -> TParam   

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

setCompile :: TParam -> TParam   

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

setExec :: TParam -> TParam   

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

main :: IO ()   

usageInfo :: String   

transformPlural :: TParam -> String -> IO ()   

compileAcyFcy :: Bool -> String -> IO ()   

pluralArgsOfProg :: CurryProg -> [((String,String),[Int])]   

pluralArgsOfFunc :: CFuncDecl -> [((String,String),[Int])]   

pluralArgsOfType :: Int -> CTypeExpr -> [Int]   

tcPlural :: (String,String)   

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

tcPluralArg :: (String,String)   

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

tcplural :: (String,String)   

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

tPluralProg :: [((String,String),[Int])] -> CurryProg -> CurryProg   

tPluralFunc :: String -> [((String,String),[Int])] -> CFuncDecl -> CFuncDecl   

tPluralType :: [Int] -> Int -> CTypeExpr -> CTypeExpr   

tPluralRule :: String -> [((String,String),[Int])] -> [Int] -> CRule -> CRule   

replacePluralCPatterns :: [Int] -> (Int,CPattern) -> CPattern   

funPatError :: a   

lazyPatError :: a   

recPatError :: a   

freshVar :: Int -> (Int,String)   

matchForPluralCPatterns :: String -> [Int] -> (Int,CPattern) -> [CExpr]   

pluralVarsOfPattern :: String -> [Int] -> (Int,CPattern) -> ([((Int,String),CExpr)],[CFuncDecl])   

pluralVarsOfPattern' :: String -> [a] -> (Int,String) -> (a,CPattern) -> ([((Int,String),CExpr)],[CFuncDecl])   

projectPluralPatternVars :: String -> (Int,String) -> String -> (Int,CPattern) -> [((Int,String),CExpr)]   

projectFunctions :: String -> CPattern -> String -> (Int,CPattern) -> [CFuncDecl]   

tPluralExp :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CExpr -> CExpr   

Further infos:
  • partially defined

tPluralBranch :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> (CPattern,CRhs) -> (CPattern,CRhs)   

tPluralRhs :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CRhs -> CRhs   

tPluralLocalDecl :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CLocalDecl -> CLocalDecl   

tPluralStat :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CStatement -> CStatement   

tPluralApply :: [((String,String),[Int])] -> [((Int,String),CExpr)] -> CExpr -> CExpr -> CExpr   

apply2funcall :: CExpr -> Maybe ((String,String),[CExpr])   

(~>) :: CTypeExpr -> CTypeExpr -> CTypeExpr   

A function type.

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

baseType :: (String,String) -> CTypeExpr   

A base type.

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

applyF :: (String,String) -> [CExpr] -> CExpr   

An application of a qualified function name to a list of arguments.

constF :: (String,String) -> CExpr   

A constant, i.e., an application without arguments.

pre :: String -> (String,String)   

Converts a string into a qualified name of the Prelude.

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

preSuccess :: CExpr   

list2conj :: [CExpr] -> CExpr