Commands.hs revision 980c2505814d75dc689de1412f4de30b4d96314f
640b2adac05bb7f5e9fba064434c91852c3a72e6ndModule :$Header$
640b2adac05bb7f5e9fba064434c91852c3a72e6ndCopyright : uni-bremen and Razvan Pascanu
640b2adac05bb7f5e9fba064434c91852c3a72e6ndLicence : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
640b2adac05bb7f5e9fba064434c91852c3a72e6ndMaintainer : r.pascanu@iu-bremen.de
640b2adac05bb7f5e9fba064434c91852c3a72e6ndStability : provisional
640b2adac05bb7f5e9fba064434c91852c3a72e6ndPortability : portable
640b2adac05bb7f5e9fba064434c91852c3a72e6ndFunction that executes the script commands together with the datatypes used.
640b2adac05bb7f5e9fba064434c91852c3a72e6nd - add comments
640b2adac05bb7f5e9fba064434c91852c3a72e6nd - implement the rest of the functions
640b2adac05bb7f5e9fba064434c91852c3a72e6nd - delete the test function
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | Edge Id Id
d2a771c01de1a39b6f6770d9edd8b271d8e4f10eerikabele | LabeledEdge Id Int Id
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive deriving (Eq,Show)
ef685e00a47967e27d89709461728a229d762172nddata ScriptCommandParameters =
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive Path [String]
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | Formula Id
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | Prover Id
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | Goals [GOAL]
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | ParsedComorphism [Id]
2a7c98db85d4969dcbe7711a5ec3264ee4fc6222yoshiki | AxiomSelectionWith [Id]
2a7c98db85d4969dcbe7711a5ec3264ee4fc6222yoshiki | AxiomSelectionExcluding [Id]
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | Formulas [Id]
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | ProofScript String
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | ParamErr String
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive deriving (Eq,Show)
a27e9e05958bc51ea09edb8d8d862fe8b125313bslivedata CmdInterpreterStatus =
ef685e00a47967e27d89709461728a229d762172nd OutputErr String
ef685e00a47967e27d89709461728a229d762172nd | CmdInitialState
ef685e00a47967e27d89709461728a229d762172nd | Env LIB_NAME LibEnv
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive | SelectedNodes [Node]
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slivedata CmdInterpreterStatusID =
a27e9e05958bc51ea09edb8d8d862fe8b125313bslivedata CommandFunctionsAndParameters=
a27e9e05958bc51ea09edb8d8d862fe8b125313bslive CommandParam ([ScriptCommandParameters]->IO [CmdInterpreterStatus]) [ScriptCommandParameters]
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive | CommandParamStatus (([ScriptCommandParameters],[CmdInterpreterStatus])-> [CmdInterpreterStatus]) [ScriptCommandParameters] [CmdInterpreterStatusID]
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx | CommandStatus ([CmdInterpreterStatus] -> [CmdInterpreterStatus]) [CmdInterpreterStatusID]
d2a771c01de1a39b6f6770d9edd8b271d8e4f10eerikabele | CommandTest ([ScriptCommandParameters]->IO()) [ScriptCommandParameters]
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx | CommandShowStatus ([CmdInterpreterStatus] -> ()) [CmdInterpreterStatusID]
ef685e00a47967e27d89709461728a229d762172nd | CommandError
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkxtest::([ScriptCommandParameters])->IO()
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkxtest (ls) = putStrLn $ show ls
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkxcommandUse::[ScriptCommandParameters]->IO [CmdInterpreterStatus]
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkxcommandUse ls
cd51960ffc0f49d7a9e702162ed49b3eb0909276dirkx = case ls of
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick (Path list):_ -> do
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick let file = joinWith '/' list
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick let opts = defaultHetcatsOpts
1b3225113bb6fcf326cf16af9023e381ae0ac083nd result<- anaLib opts file
1b3225113bb6fcf326cf16af9023e381ae0ac083nd case result of
1b3225113bb6fcf326cf16af9023e381ae0ac083nd Just (name,env) -> return [(Env name env)]
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick Nothing -> return [(OutputErr "Couldn't load the file specified")]
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick _ -> return [(OutputErr "Wrong parameter")]
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawickcommandDgAllAuto::[CmdInterpreterStatus] -> [CmdInterpreterStatus]
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawickcommandDgAllAuto arg
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick = case arg of
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick (Env x y):_ -> let result= automatic x y
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick in [(Env x result)]
b5468eddc0cb1691af19ddc70a6e205daf00a94ctrawick _:l -> commandDgAllAuto l
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive [] -> [(OutputErr "Wrong parameter")]
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slivecommandDgAuto :: ([ScriptCommandParameters],[CmdInterpreterStatus]) -> [CmdInterpreterStatus]
ef685e00a47967e27d89709461728a229d762172ndcommandDgAuto (param,status)
ef685e00a47967e27d89709461728a229d762172nd = case status of
ef685e00a47967e27d89709461728a229d762172nd (Env ln libEnv):_ -> case param of
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive (Goals ls):_ -> let l = getAllEdgeGoals ln libEnv ls
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive result = automaticFromList ln l libEnv
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive in [(Env ln result)]
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive _ -> [(OutputErr "Wrong parameters")]
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive _:l -> commandDgAuto (param, l)
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slive [] -> [(OutputErr "Wrong parameters")]
222f0f03c2f9ee6343c18f80f0cb6e9aad21bc58slivecommandDgGlobSubsume::([ScriptCommandParameters],[CmdInterpreterStatus]) -> [CmdInterpreterStatus]
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabelecommandDgGlobSubsume (param,status)
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabele = case status of
d2a771c01de1a39b6f6770d9edd8b271d8e4f10eerikabele (Env ln libEnv):_ -> case param of
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabele (Goals ls):_ -> let l = getAllGlobalEdgeGoals ln libEnv ls
ef685e00a47967e27d89709461728a229d762172nd result = globSubsumeFromList ln l libEnv
ef685e00a47967e27d89709461728a229d762172nd in [(Env ln result)]
ef685e00a47967e27d89709461728a229d762172nd _ -> [(OutputErr "Wrong parameters")]
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabele _:l -> commandDgGlobSubsume (param,l)
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabele [] -> [(OutputErr "Wrong parameters")]
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabelecommandDgAllGlobSubsume::[CmdInterpreterStatus] -> [CmdInterpreterStatus]
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabelecommandDgAllGlobSubsume arg
1f2a7403f1389cbf2da0a53a2b2fb425dea75506erikabele = case arg of
81622596373177e079337e956f7a5800895443b3erikabele (Env x y):_ -> let result =(globSubsume x) y
81622596373177e079337e956f7a5800895443b3erikabele in [(Env x result)]
81622596373177e079337e956f7a5800895443b3erikabele _:l -> commandDgAllGlobSubsume l
81622596373177e079337e956f7a5800895443b3erikabele [] -> [(OutputErr "Wrong parameters")]
ef685e00a47967e27d89709461728a229d762172ndcommandDgAllGlobDecomp::[CmdInterpreterStatus] -> [CmdInterpreterStatus]
ef685e00a47967e27d89709461728a229d762172ndcommandDgAllGlobDecomp arg
81622596373177e079337e956f7a5800895443b3erikabele = case arg of
81622596373177e079337e956f7a5800895443b3erikabele (Env x y):_ -> let result= (globDecomp x) y
81622596373177e079337e956f7a5800895443b3erikabele in [(Env x result)]
81622596373177e079337e956f7a5800895443b3erikabele _:l -> commandDgAllGlobDecomp l
81622596373177e079337e956f7a5800895443b3erikabele [] -> [(OutputErr "Wrong parameters")]
ef685e00a47967e27d89709461728a229d762172ndcommandDgGlobDecomp :: ([ScriptCommandParameters],[CmdInterpreterStatus]) -> [CmdInterpreterStatus]
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabelecommandDgGlobDecomp (param,status)
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele = case status of
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele (Env ln libEnv):_ -> case param of
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele (Goals ls):_ -> let l = getAllGlobalEdgeGoals ln libEnv ls
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele result = globDecompFromList ln l libEnv
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele in [(Env ln result)]
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele _ -> [(OutputErr "Wrong parameters")]
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele _:l -> commandDgGlobDecomp (param,l)
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabele [] -> [(OutputErr "Wrong parameters")]
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabelecommandDgAllLocInfer::[CmdInterpreterStatus] -> [CmdInterpreterStatus]
f0eae6f6191f5730fa8db049f7391e93b4ff41b9erikabelecommandDgAllLocInfer arg
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki = case arg of
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki (Env x y):_ -> let result= (localInference x) y
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki in [(Env x result)]
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki _:l -> commandDgAllLocInfer l
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki [] -> [(OutputErr "Wrong parameters")]
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshikicommandDgLocInfer::([ScriptCommandParameters],[CmdInterpreterStatus]) -> [CmdInterpreterStatus]
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshikicommandDgLocInfer (param,status)
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki = case status of
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki (Env ln libEnv):_ -> case param of
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki (Goals ls):_ -> let l = getAllLocalEdgeGoals ln libEnv ls
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki result = localInferenceFromList ln l libEnv
4a67c5c0053e1c1c2202122e46a42987f6fd28dfyoshiki in [(Env ln result)]
-- | The 'findNodeNumber' function, given the Id of a node searches a list of LNode and returns the index of the node
-- | The 'isEdgeBetween' function checks for two given Node and an edge if the edge is between those nodes