Module OrCaseLifter

Transform FlatCurry function definitions into a form where all the right-hand sides contain Case and Or only at the top-level and all case expressions have a variable argument (i.e., all rules are overlapping inductively sequential). Furthermore, non-recursive Let bindings are replaced by auxiliary functions.

Author: Michael Hanus

Version: May 2017

Summary of exported operations:

liftNestedOrCase :: (String,String) -> [FuncDecl] -> [FuncDecl]   
Lift nested or/case expressions by replacing them by auxiliary functions.

Exported operations:

liftNestedOrCase :: (String,String) -> [FuncDecl] -> [FuncDecl]   

Lift nested or/case expressions by replacing them by auxiliary functions. The names of the new auxiliary functions are prefixed by a string and a number (starting with 0).

Example call:
(liftNestedOrCase prefix funs)
Parameters:
  • prefix : the prefix for the new auxiliary functions (e.g., ("module","ORCASE_")
  • funs : the list of functions to be lifted
Returns:
the list of lifted functions and auxiliary functions