Module TypedFlatCurryGoodies

Some goodies to deal with type-annotated FlatCurry programs.

Author: Michael Hanus

Version: September 2017

Summary of exported operations:

readTypedFlatCurry :: String -> IO (AProg TypeExpr)   
Reads a type FlatCurry program or exit with a failure message in case of some typing error.
getAllFunctions :: [AFuncDecl TypeExpr] -> [AProg TypeExpr] -> [(String,String)] -> IO [AFuncDecl TypeExpr]   
Extract all user-defined typed FlatCurry functions that might be called by a given list of functions.
funcsOfFuncDecl :: AFuncDecl TypeExpr -> [(String,String)]   
Returns the names of all functions/constructors occurring in the body of a function declaration.
ndExpr :: AExpr TypeExpr -> Bool   
Returns True if the expression is non-deterministic, i.e., if Or or Free occurs in the expression.
isPrimOp :: (String,String) -> Bool   
Is a qualified FlatCurry name primitive?
preludePrimOps :: [(String,String)]   
Primitive operations of the prelude and their SMT names.
primCons :: [(String,String)]   
Primitive constructors and their SMT names.
standardConstructors :: [(String,String)]   
pre :: String -> (String,String)   
showQName :: (String,String) -> String   

Exported datatypes:


TAProg

Type synonym: TAProg = AProg TypeExpr


TAFuncDecl

Type synonym: TAFuncDecl = AFuncDecl TypeExpr


TARule

Type synonym: TARule = ARule TypeExpr


TAExpr

Type synonym: TAExpr = AExpr TypeExpr


TABranchExpr

Type synonym: TABranchExpr = ABranchExpr TypeExpr


TAPattern

Type synonym: TAPattern = APattern TypeExpr


Exported operations:

readTypedFlatCurry :: String -> IO (AProg TypeExpr)   

Reads a type FlatCurry program or exit with a failure message in case of some typing error.

getAllFunctions :: [AFuncDecl TypeExpr] -> [AProg TypeExpr] -> [(String,String)] -> IO [AFuncDecl TypeExpr]   

Extract all user-defined typed FlatCurry functions that might be called by a given list of functions.

funcsOfFuncDecl :: AFuncDecl TypeExpr -> [(String,String)]   

Returns the names of all functions/constructors occurring in the body of a function declaration.

ndExpr :: AExpr TypeExpr -> Bool   

Returns True if the expression is non-deterministic, i.e., if Or or Free occurs in the expression.

isPrimOp :: (String,String) -> Bool   

Is a qualified FlatCurry name primitive?

preludePrimOps :: [(String,String)]   

Primitive operations of the prelude and their SMT names.

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

primCons :: [(String,String)]   

Primitive constructors and their SMT names.

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

standardConstructors :: [(String,String)]   

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

pre :: String -> (String,String)   

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

showQName :: (String,String) -> String   

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