| Copyright | (c) Dominik Dietrich DFKI Bremen 2010 | 
|---|---|
| License | GPLv2 or higher, see LICENSE.txt | 
| Maintainer | Dominik.Dietrich@dfki.de | 
| Stability | provisional | 
| Portability | non-portable (uses type-expression in class instances) | 
| Safe Haskell | None | 
CSL.Reduce_Interface
Description
Interface for Reduce CAS system.
Synopsis
- class Session a where
 - lookupRedShellCmd :: IO (Either String String)
 - connectCAS :: String -> IO (Handle, Handle, Handle, ProcessHandle)
 - disconnectCAS :: Session a => a -> IO ()
 - sendToReduce :: Session a => a -> String -> IO ()
 - reduceS :: String
 - openReduceProofStatus :: String -> [EXPRESSION] -> ProofStatus [EXPRESSION]
 - closedReduceProofStatus :: Ord pt => String -> pt -> ProofStatus pt
 - exportExps :: [EXPRESSION] -> String
 - infixOps :: [String]
 - exportExp :: EXPRESSION -> String
 - exportReduce :: Named CMD -> String
 - skipReduceLineNr :: String -> String
 - redOutputToExpression :: String -> Maybe EXPRESSION
 - cslReduceDefaultMapping :: [(OPNAME, String)]
 - getNextResultOutput :: Handle -> IO String
 - procCmd :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - evalString :: Session a => a -> String -> IO [EXPRESSION]
 - procString :: Session a => a -> String -> String -> IO (ProofStatus [EXPRESSION])
 - casfactorExp :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - cassolve :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - cassimplify :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - casask :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - casremainder :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - casint :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - casqelim :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])])
 - casDeclareOperators :: Session a => a -> [EXPRESSION] -> IO ()
 - casDeclareEquation :: Session a => a -> CMD -> IO ()
 - exportLemmaGeneric :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 - exportLemmaQelim :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 - exportLemmaFactor :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 - exportLemmaSolve :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 - exportLemmaSimplify :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 - exportLemmaAsk :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 - exportLemmaRemainder :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 - exportLemmaInt :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION])
 
Documentation
class Session a where Source #
A session is a process connection
lookupRedShellCmd :: IO (Either String String) Source #
Left String is success, Right String is failure
connectCAS :: String -> IO (Handle, Handle, Handle, ProcessHandle) Source #
connects to the CAS, prepares the streams and sets initial options
disconnectCAS :: Session a => a -> IO () Source #
closes the connection to the CAS
sendToReduce :: Session a => a -> String -> IO () Source #
openReduceProofStatus :: String -> [EXPRESSION] -> ProofStatus [EXPRESSION] Source #
returns a basic proof status for conjecture with name n where [EXPRESSION] represents the proof tree.
closedReduceProofStatus Source #
Arguments
| :: Ord pt | |
| => String | name of the goal  | 
| -> pt | |
| -> ProofStatus pt | 
exportExps :: [EXPRESSION] -> String Source #
exportExp :: EXPRESSION -> String Source #
Exports an expression to Reduce format
exportReduce :: Named CMD -> String Source #
exports command to Reduce Format
skipReduceLineNr :: String -> String Source #
removes the newlines 4: from the beginning of the string
redOutputToExpression :: String -> Maybe EXPRESSION Source #
try to get an EXPRESSION from a Reduce string
cslReduceDefaultMapping :: [(OPNAME, String)] Source #
getNextResultOutput :: Handle -> IO String Source #
reads characters from the specified output until the next result is complete, indicated by $ when using the maxima mode off nat;
procCmd :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
evalString :: Session a => a -> String -> IO [EXPRESSION] Source #
sends the given string to the CAS, reads the result and tries to parse it.
procString :: Session a => a -> String -> String -> IO (ProofStatus [EXPRESSION]) Source #
wrap evalString into a ProofStatus
casfactorExp :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
factors a given expression over the reals
cassolve :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
solves a single equation over the reals
cassimplify :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
simplifies a given expression over the reals
casask :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
asks value of a given expression
casremainder :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
computes the remainder of a division
casint :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
integrates the given expression
casqelim :: Session a => a -> Named CMD -> IO (ProofStatus [EXPRESSION], [(Named CMD, ProofStatus [EXPRESSION])]) Source #
performs quantifier elimination of a given expression
casDeclareOperators :: Session a => a -> [EXPRESSION] -> IO () Source #
declares an operator, such that it can used infix/prefix in CAS
casDeclareEquation :: Session a => a -> CMD -> IO () Source #
declares an equation x := exp
exportLemmaGeneric :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #
exportLemmaQelim :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #
exportLemmaFactor :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #
generates the lemma for cmd with result ProofStatus
exportLemmaSolve :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #
exportLemmaSimplify :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #
exportLemmaAsk :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #
exportLemmaRemainder :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #
exportLemmaInt :: Named CMD -> ProofStatus [EXPRESSION] -> (Named CMD, ProofStatus [EXPRESSION]) Source #