Module Main

A tool to verify non-failure properties of Curry operations.

Author: Michael Hanus

Version: May 2021

Summary of exported operations:

test :: Int -> String -> IO ()  Non-deterministic 
testv :: String -> IO ()  Non-deterministic 
testcv :: String -> IO ()  Non-deterministic 
:: String  Deterministic 
main :: IO ()  Non-deterministic 
verifyNonFailingModules :: Options -> [String] -> [String] -> IO ()  Non-deterministic 
verifyNonFailingMod :: Options -> String -> IO ()  Non-deterministic 
loadAnalysisWithImports :: (Read a, Show a) => Analysis a -> AProg TypeExpr -> IO (ProgInfo a)  Non-deterministic 
makeTransState :: Int -> [(Int,TypeExpr)] -> TransState  Deterministic 
emptyTransState :: TransState  Deterministic 
getFreshVarIndex :: StateT TransState IO Int  Deterministic 
setFreshVarIndex :: Int -> StateT TransState IO ()  Deterministic 
getFreshVar :: StateT TransState IO Int  Deterministic 
incFreshVarIndex :: TransState -> TransState  Deterministic 
getVarTypes :: StateT TransState IO [(Int,TypeExpr)]  Deterministic 
addVarTypes :: [(Int,TypeExpr)] -> StateT TransState IO ()  Deterministic 
getAssertion :: StateT TransState IO Term  Deterministic 
setAssertion :: Term -> StateT TransState IO ()  Deterministic 
addToAssertion :: Term -> StateT TransState IO ()  Deterministic 
proveNonFailingFuncs :: Options -> ProgInfo [((String,String),Int)] -> IORef VState -> [AFuncDecl TypeExpr] -> IO ()  Non-deterministic 
proveNonFailingFunc :: Options -> ProgInfo [((String,String),Int)] -> IORef VState -> AFuncDecl TypeExpr -> IO ()  Non-deterministic 
proveNonFailingRule :: Options -> ProgInfo [((String,String),Int)] -> IORef VState -> (String,String) -> TypeExpr -> ARule TypeExpr -> IO ()  Non-deterministic 
missingConsInBranch :: ProgInfo [((String,String),Int)] -> [ABranchExpr TypeExpr] -> [((String,String),Int)]  Deterministic 
simpExpr :: AExpr TypeExpr -> AExpr TypeExpr  Deterministic 
binding2SMT :: Bool -> VerifyInfo -> (Int,AExpr TypeExpr) -> StateT TransState IO Term  Deterministic 
nonfailPreCondExpOf :: VerifyInfo -> (String,String) -> TypeExpr -> [(Int,TypeExpr)] -> StateT TransState IO Term  Non-deterministic 
nonfailCondExpOf :: VerifyInfo -> (String,String) -> TypeExpr -> [(Int,TypeExpr)] -> StateT TransState IO ([(Int,TypeExpr)],Term)  Non-deterministic 
preCondExpOf :: VerifyInfo -> (String,String) -> [(Int,TypeExpr)] -> StateT TransState IO Term  Deterministic 
postCondExpOf :: VerifyInfo -> (String,String) -> [(Int,TypeExpr)] -> StateT TransState IO Term  Deterministic 
applyFunc :: AFuncDecl TypeExpr -> [(Int,TypeExpr)] -> StateT TransState IO (AExpr TypeExpr)  Deterministic 
pred2SMT :: AExpr TypeExpr -> StateT TransState IO Term  Deterministic 
normalizeArgs :: [AExpr TypeExpr] -> StateT TransState IO ([(Int,AExpr TypeExpr)],[AExpr TypeExpr])  Deterministic 
getFreshVarsForTypes :: [TypeExpr] -> StateT TransState IO [(Int,TypeExpr)]  Deterministic 
renameLetVars :: [((Int,TypeExpr),AExpr TypeExpr)] -> AExpr TypeExpr -> StateT TransState IO ([((Int,TypeExpr),AExpr TypeExpr)],AExpr TypeExpr)  Deterministic 
renameFreeVars :: [(Int,TypeExpr)] -> AExpr TypeExpr -> StateT TransState IO ([(Int,TypeExpr)],AExpr TypeExpr)  Deterministic 
renamePatternVars :: ABranchExpr TypeExpr -> StateT TransState IO (ABranchExpr TypeExpr)  Deterministic 
checkImplicationWithSMT :: Options -> IORef VState -> String -> [(Int,TypeExpr)] -> Term -> Term -> Term -> IO (Maybe Bool)  Non-deterministic 
axiomatizedOps :: [String]  Deterministic 
typedVar2SMT :: (Int,TypeExpr) -> Command  Deterministic 
tconsOfTypeExpr :: TypeExpr -> [(String,String)]  Deterministic 
testBoolCase :: [ABranchExpr TypeExpr] -> Maybe (AExpr TypeExpr,AExpr TypeExpr)  Deterministic 
Tests whether the given branches of a case expressions are a Boolean case distinction.
showWithLineNums :: String -> String  Deterministic 
Shows a text with line numbers prefixed:
ilog :: Int -> Int  Deterministic 
The value of ilog n is the floor of the logarithm in the base 10 of n.

Exported datatypes:


TransState

Constructors:

  • TransState :: Term -> Int -> [(Int,TypeExpr)] -> TransState

    Fields:

    • cAssertion :: Term
    • freshVar :: Int
    • varTypes :: [(Int,TypeExpr)]

TransStateM

Type synonym: TransStateM a = StateT TransState IO a


Exported operations:

test :: Int -> String -> IO ()  Non-deterministic 

testv :: String -> IO ()  Non-deterministic 

testcv :: String -> IO ()  Non-deterministic 

main :: IO ()  Non-deterministic 

verifyNonFailingModules :: Options -> [String] -> [String] -> IO ()  Non-deterministic 

verifyNonFailingMod :: Options -> String -> IO ()  Non-deterministic 

loadAnalysisWithImports :: (Read a, Show a) => Analysis a -> AProg TypeExpr -> IO (ProgInfo a)  Non-deterministic 

makeTransState :: Int -> [(Int,TypeExpr)] -> TransState  Deterministic 

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

setFreshVarIndex :: Int -> StateT TransState IO ()  Deterministic 

getFreshVar :: StateT TransState IO Int  Deterministic 

getVarTypes :: StateT TransState IO [(Int,TypeExpr)]  Deterministic 

addVarTypes :: [(Int,TypeExpr)] -> StateT TransState IO ()  Deterministic 

setAssertion :: Term -> StateT TransState IO ()  Deterministic 

addToAssertion :: Term -> StateT TransState IO ()  Deterministic 

proveNonFailingFuncs :: Options -> ProgInfo [((String,String),Int)] -> IORef VState -> [AFuncDecl TypeExpr] -> IO ()  Non-deterministic 

proveNonFailingFunc :: Options -> ProgInfo [((String,String),Int)] -> IORef VState -> AFuncDecl TypeExpr -> IO ()  Non-deterministic 

proveNonFailingRule :: Options -> ProgInfo [((String,String),Int)] -> IORef VState -> (String,String) -> TypeExpr -> ARule TypeExpr -> IO ()  Non-deterministic 

missingConsInBranch :: ProgInfo [((String,String),Int)] -> [ABranchExpr TypeExpr] -> [((String,String),Int)]  Deterministic 

binding2SMT :: Bool -> VerifyInfo -> (Int,AExpr TypeExpr) -> StateT TransState IO Term  Deterministic 

nonfailPreCondExpOf :: VerifyInfo -> (String,String) -> TypeExpr -> [(Int,TypeExpr)] -> StateT TransState IO Term  Non-deterministic 

nonfailCondExpOf :: VerifyInfo -> (String,String) -> TypeExpr -> [(Int,TypeExpr)] -> StateT TransState IO ([(Int,TypeExpr)],Term)  Non-deterministic 

preCondExpOf :: VerifyInfo -> (String,String) -> [(Int,TypeExpr)] -> StateT TransState IO Term  Deterministic 

postCondExpOf :: VerifyInfo -> (String,String) -> [(Int,TypeExpr)] -> StateT TransState IO Term  Deterministic 

checkImplicationWithSMT :: Options -> IORef VState -> String -> [(Int,TypeExpr)] -> Term -> Term -> Term -> IO (Maybe Bool)  Non-deterministic 

axiomatizedOps :: [String]  Deterministic 

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

typedVar2SMT :: (Int,TypeExpr) -> Command  Deterministic 

tconsOfTypeExpr :: TypeExpr -> [(String,String)]  Deterministic 

testBoolCase :: [ABranchExpr TypeExpr] -> Maybe (AExpr TypeExpr,AExpr TypeExpr)  Deterministic 

Tests whether the given branches of a case expressions are a Boolean case distinction. If yes, the expressions of the False and True branch are returned.

showWithLineNums :: String -> String  Deterministic 

Shows a text with line numbers prefixed:

ilog :: Int -> Int  Deterministic 

The value of ilog n is the floor of the logarithm in the base 10 of n. Fails if n <= 0. For positive integers, the returned value is 1 less the number of digits in the decimal representation of n.

Example call:
(ilog n)
Parameters:
  • n : The argument.
Returns:
the floor of the logarithm in the base 10 of n.