-- the Generic Model Parser Abstract Syntax
-- Copyright 2007, Lutz Schroeder and Georgel Calin
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Datatype for the clauses ---------------------------------------------------
data PropClause = Pimplies [Int] [Int]
-- Datatypes for the modal index ----------------------------------------------
data ModalK = ModalK () -- K modal logic index
data ModalKD = ModalKD () -- KD modal logic index
data GML = GML Int -- Graded modal logic index
data CL = CL (
Set.Set Int) -- Coalition modal logic index
data ML = ML Int -- Majority modal logic index
data Kars = Kars [Char] -- Generic modal logic index
-- Formula Datatype -----------------------------------------------------------
data Otype = Square | Angle -- type of the Modal Operator
data Junctor = And | Or | If | Fi | Iff
data Mop a = Mop a Otype -- Modal Operator: index & type
data Formula a = F -- datatype for the formulae
| Junctor (Formula a) Junctor (Formula a)
| Mapp (Mop a) (Formula a) -- modal appl constr
| Var Char Integer -- variables
-- Modal Clause (Negated and Positive modal Atoms -----------------------------
data ModClause a = Mimplies [Formula a] [Formula a]
-------------------------------------------------------------------------------
-- Show Instances 4 Abstract Syntax
-------------------------------------------------------------------------------
instance Show a => Show (Mop a) where
Mop x Square -> "[" ++ show x ++ "]"
Mop x Angle -> "<" ++ show x ++ ">"
instance Show Junctor where
instance Show a => Show (Formula a) where
Junctor x j y -> "(" ++ show x ++ " " ++ show j ++ " " ++ show y ++ ")"
Mapp m x -> show m ++ " " ++ show x
Var x i -> show ([x] ++ show i)
show (CL i) = let showSet s =
in show aux ++ showSet next
in show aux ++ "," ++ showSet next
instance Show ModalK where
instance Show ModalKD where