Module TypedFlatCurryGoodies

Some goodies to deal with type-annotated FlatCurry programs.

Author: Michael Hanus

Version: March 2019

Summary of exported operations:

getAllFunctions :: IORef VState -> [AFuncDecl 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 from the prelude and their SMT names.
standardConstructors :: [(String,String)]   
baseType :: (String,String) -> TypeExpr   
A base FlatCurry type.
unitType :: TypeExpr   
charType :: TypeExpr   
boolType :: TypeExpr   
listType :: TypeExpr -> TypeExpr   
Constructs a list type from an element type.
stringType :: TypeExpr   
tupleType :: [TypeExpr] -> TypeExpr   
Constructs a tuple type from list of component types.
tupleExpr :: [AExpr TypeExpr] -> AExpr TypeExpr   
Constructs a tuple expression.
string2TFCY :: String -> AExpr TypeExpr   
tupleCons :: Int -> (String,String)   
Generates an n-ary tuple constructor (only meaningful for n>1).
pre :: String -> (String,String)   
Transforms a name into a qualified name from the prelude.

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:

getAllFunctions :: IORef VState -> [AFuncDecl 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 from the prelude and their SMT names.

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

standardConstructors :: [(String,String)]   

baseType :: (String,String) -> TypeExpr   

A base FlatCurry type.

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

unitType :: TypeExpr   

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

charType :: TypeExpr   

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

boolType :: TypeExpr   

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

listType :: TypeExpr -> TypeExpr   

Constructs a list type from an element type.

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

stringType :: TypeExpr   

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

tupleType :: [TypeExpr] -> TypeExpr   

Constructs a tuple type from list of component types.

tupleExpr :: [AExpr TypeExpr] -> AExpr TypeExpr   

Constructs a tuple expression.

string2TFCY :: String -> AExpr TypeExpr   

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

tupleCons :: Int -> (String,String)   

Generates an n-ary tuple constructor (only meaningful for n>1).

pre :: String -> (String,String)   

Transforms a name into a qualified name from the prelude.

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