-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Data Type for Rewriting Systems -- -- The package defines data types and parsers for rewriting systems, as -- used in the Termination Competitions. For syntax and semantics -- specification, see http://www.termination-portal.org/wiki/TPDB @package tpdb @version 0.1 module TPDB.Data data Identifier Identifier :: String -> Int -> Identifier name :: Identifier -> String arity :: Identifier -> Int data Term v s Var :: v -> Term v s Node :: s -> [Term v s] -> Term v s data Rule a Rule :: a -> a -> Bool -> Bool -> Rule a lhs :: Rule a -> a rhs :: Rule a -> a strict :: Rule a -> Bool top :: Rule a -> Bool data RS s r RS :: [s] -> [Rule r] -> Bool -> RS s r -- | better keep order in signature (?) signature :: RS s r -> [s] rules :: RS s r -> [Rule r] -- | if True, write comma between rules separate :: RS s r -> Bool type TRS v s = RS s (Term v s) type SRS s = RS s [s] data Problem v s Problem :: TRS v s -> Strategy -> Type -> Problem v s trs :: Problem v s -> TRS v s strategy :: Problem v s -> Strategy type_ :: Problem v s -> Type data Type Termination :: Type Complexity :: Type data Strategy Full :: Strategy Innermost :: Strategy Outermost :: Strategy instance Eq Identifier instance Ord Identifier instance Show Identifier instance (Show v, Show s) => Show (Term v s) instance Show a => Show (Rule a) instance (Show s, Show r) => Show (RS s r) instance Show Type instance Show Strategy instance (Show v, Show s) => Show (Problem v s) -- | the old TPDB format cf. -- http://www.lri.fr/~marche/tpdb/format.html module TPDB.Plain.Write class Pretty a pretty :: Pretty a => a -> Doc instance (Pretty s, Pretty r) => Pretty (Problem s r) instance (Pretty s, Pretty r) => Pretty (RS s r) instance Pretty s => Pretty [s] instance Pretty a => Pretty (Rule a) instance (Pretty v, Pretty s) => Pretty (Term v s) instance Pretty Identifier -- | textual input, cf. http://www.lri.fr/~marche/tpdb/format.html module TPDB.Plain.Read trs :: String -> Either String (TRS Identifier Identifier) srs :: String -> Either String (SRS Identifier) type Parser = Parsec String () class Reader a reader :: Reader a => Parser a data Declaration u Var_Declaration :: [Identifier] -> Declaration u Theory_Declaration :: Declaration u Strategy_Declaration :: Declaration u Rules_Declaration :: [Rule u] -> Declaration u -- | this is super-ugly: a parenthesized, possibly nested, possibly -- comma-separated, list of identifiers or strings Unknown_Declaration :: Declaration u declaration :: Reader u => Bool -> Parser (Declaration u) make_srs :: [Declaration [s]] -> SRS s make_trs :: [Declaration (Term Identifier Identifier)] -> TRS Identifier Identifier instance Reader (TRS Identifier Identifier) instance Reader (SRS Identifier) instance Reader u => Reader (Rule u) instance (Reader v, Reader s) => Reader (Term v s) instance Reader s => Reader [s] instance Reader Identifier -- | construct data object from XML tree. module TPDB.XTC.Read readProblems :: FilePath -> IO [Problem Identifier Identifier] module TPDB.XTC