Tools.hs revision 98997f9d65c6bec5e349057af53337d46e57ddba
abd8dd44106c507dd2cb64359b63d7d56fa0a9c8Christian MaederModule : $Header$
09249711700a6acbc40a2e337688b434d7aafa28Christian MaederDescription : Abstract syntax for reduce
76647324ed70f33b95a881b536d883daccf9568dChristian MaederCopyright : (c) Dominik Dietrich, DFKI Bremen 2010
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu ProdescuLicense : GPLv2 or higher
3f69b6948966979163bdfe8331c38833d5d90ecdChristian MaederMaintainer : dominik.dietrich@dfki.de
abd8dd44106c507dd2cb64359b63d7d56fa0a9c8Christian MaederStability : experimental
76647324ed70f33b95a881b536d883daccf9568dChristian MaederPortability : portable
0a39036fa485579a7b7c81cdd44a412392571927Christian MaedernegateFormula :: CMD -> CMD
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian MaedernegateFormula (Cmd s exps) = Cmd "Not" [(Op s [] exps nullRange)]
10b02b2343246df6773585636fe3ddbefa3b6a1bChristian MaedernegateFormula _ = error "negateFormula: not implemented" -- TODO: implement this
d48085f765fca838c1d972d2123601997174583dChristian MaedergetAtoms :: EXPRESSION -> [String]
ad270004874ce1d0697fb30d7309f180553bb315Christian Maeder Var tk -> ["var:" ++ tokStr tk]
0a39036fa485579a7b7c81cdd44a412392571927Christian Maeder Op s _ el _ -> ("op:" ++ s) : concatMap getAtoms el
abd8dd44106c507dd2cb64359b63d7d56fa0a9c8Christian Maeder List el _ -> ("list") : concatMap getAtoms el
d48085f765fca838c1d972d2123601997174583dChristian Maeder Int _ _ -> ["int"]
76647324ed70f33b95a881b536d883daccf9568dChristian Maeder Double _ _ -> ["dbl"]
d48085f765fca838c1d972d2123601997174583dChristian Maeder Interval _ _ _ -> ["intv"]
76647324ed70f33b95a881b536d883daccf9568dChristian MaedergetCmdAtoms :: CMD -> [String]
d48085f765fca838c1d972d2123601997174583dChristian MaedergetCmdAtoms c =
d48085f765fca838c1d972d2123601997174583dChristian Maeder Cmd s el -> ("cmd:" ++ s) : concatMap getAtoms el
d48085f765fca838c1d972d2123601997174583dChristian Maeder Repeat e cl -> "repeat" : (getAtoms e ++ concatMap getCmdAtoms cl)
d48085f765fca838c1d972d2123601997174583dChristian Maeder _ -> [] -- TODO: implement this
a39a820684c1974350f46593025e0bb279f41bc6Christian MaedergetBSAtoms :: BASIC_SPEC -> [String]
a39a820684c1974350f46593025e0bb279f41bc6Christian MaedergetBSAtoms (Basic_spec l) = concatMap (f . AS_Anno.item) l
72b9099aeec0762bae4546db3bc4b48721027bf4Christian Maeder where f (Op_decl _) = []
a39a820684c1974350f46593025e0bb279f41bc6Christian Maeder f (Axiom_item ac) = getCmdAtoms $ AS_Anno.item ac
76647324ed70f33b95a881b536d883daccf9568dChristian Maeder f _ = [] -- TODO: implement this