ModalCasl.hs revision 26db4a742376d513cdba128780ee8ca60eeb927e
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu{-# OPTIONS -fglasgow-exts #-}
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiumodule ModalCasl where
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiuimport Control.Monad (liftM, liftM2)
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiuimport Text.ParserCombinators.Parsec hiding (State)
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu{------------------------------------------------------------------------------}
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu{- Formulas of Modal CASL -}
c038fcf2030a6cfac7a261dee48a9eb29edb78eaFelix Gabriel Mance{------------------------------------------------------------------------------}
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiudata StateFormula a = Var a
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu -- Boolean Operators
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu | Snot (StateFormula a)
ed1b8e97e72b2e3e92edaf2eb22a4b5373d705f1Felix Gabriel Mance | Sand (StateFormula a) (StateFormula a)
5180a08007989fd364622fc9bc01f82141643f7bFelix Gabriel Mance | Sor (StateFormula a) (StateFormula a)
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu -- Path Quantifiers
c038fcf2030a6cfac7a261dee48a9eb29edb78eaFelix Gabriel Mance | E (PathFormula a)
c038fcf2030a6cfac7a261dee48a9eb29edb78eaFelix Gabriel Mance | A (PathFormula a)
8d246de26958f1e8c35714b260b9d85c933c060aFrancisc Nicolae Bungiu -- Future Modalities
8d246de26958f1e8c35714b260b9d85c933c060aFrancisc Nicolae Bungiu | Diamond (StateFormula a)
6995877e4e201fcf8bb936066da2d259aed7c008Felix Gabriel Mance | Box (StateFormula a)
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu -- Past Modalities
19e01e1a7e319063434bd86c8ecbc5f241ef9993Felix Gabriel Mance | DiamondPast (StateFormula a)
19e01e1a7e319063434bd86c8ecbc5f241ef9993Felix Gabriel Mance | BoxPast (StateFormula a)
19e01e1a7e319063434bd86c8ecbc5f241ef9993Felix Gabriel Mance -- Fixpoint Opertors
19e01e1a7e319063434bd86c8ecbc5f241ef9993Felix Gabriel Mance | Mu a (StateFormula a)
19e01e1a7e319063434bd86c8ecbc5f241ef9993Felix Gabriel Mance | Nu a (StateFormula a)
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiudata PathFormula a = State (StateFormula a)
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu -- Boolean Operators
c4076ff1721f8901a30e4b7aa004479ecb2631e0Felix Gabriel Mance | Pnot (PathFormula a)
ccb84c1cb43fb0ed70c5bf2d364e671820473ed5Francisc Nicolae Bungiu | Pand (PathFormula a) (PathFormula a)
dda7065c0c0f383558d7d4e8072969c8c41a8ed7Francisc Nicolae Bungiu | Por (PathFormula a) (PathFormula a)
8e1b180fc839e96d7a4f1f63dfc563c75139c683Francisc Nicolae Bungiu -- Future Temporal Operators
e5ea4eeaeefd3521ae3475719e18c96cf91637d5Felix Gabriel Mance | X (PathFormula a)
15d62726781e67fe6458fbcf0a8c46832a7bb8daFelix Gabriel Mance | G (PathFormula a)
15d62726781e67fe6458fbcf0a8c46832a7bb8daFelix Gabriel Mance | F (PathFormula a)
c4076ff1721f8901a30e4b7aa004479ecb2631e0Felix Gabriel Mance | W (PathFormula a) (PathFormula a)
dda7065c0c0f383558d7d4e8072969c8c41a8ed7Francisc Nicolae Bungiu | U (PathFormula a) (PathFormula a)
15d62726781e67fe6458fbcf0a8c46832a7bb8daFelix Gabriel Mance | B (PathFormula a) (PathFormula a)
e5ea4eeaeefd3521ae3475719e18c96cf91637d5Felix Gabriel Mance | W' (PathFormula a) (PathFormula a)
e5ea4eeaeefd3521ae3475719e18c96cf91637d5Felix Gabriel Mance | U' (PathFormula a) (PathFormula a)
dda7065c0c0f383558d7d4e8072969c8c41a8ed7Francisc Nicolae Bungiu | B' (PathFormula a) (PathFormula a)
ed1b8e97e72b2e3e92edaf2eb22a4b5373d705f1Felix Gabriel Mance -- Past Temporal Operators
c4076ff1721f8901a30e4b7aa004479ecb2631e0Felix Gabriel Mance | XPast (PathFormula a)
c4076ff1721f8901a30e4b7aa004479ecb2631e0Felix Gabriel Mance | GPast (PathFormula a)
showStateFormula (Sand phi psi) True = showStateFormula phi False ++ " /\\ " ++ showStateFormula psi False
showStateFormula (Sor phi psi) True = showStateFormula phi False ++ " \\/ " ++ showStateFormula psi False
showPathFormula (Pand phi psi) True = showPathFormula phi False ++ " /\\ " ++ showPathFormula psi False
showPathFormula (Por phi psi) True = showPathFormula phi False ++ " \\/ " ++ showPathFormula psi False
showPathFormula (W' phi psi) True = showPathFormula phi False ++ " W! " ++ showPathFormula psi False
showPathFormula (U' phi psi) True = showPathFormula phi False ++ " U! " ++ showPathFormula psi False
showPathFormula (B' phi psi) True = showPathFormula phi False ++ " B! " ++ showPathFormula psi False
showPathFormula (WPast phi psi) True = showPathFormula phi False ++ " ~W " ++ showPathFormula psi False
showPathFormula (UPast phi psi) True = showPathFormula phi False ++ " ~U " ++ showPathFormula psi False
showPathFormula (BPast phi psi) True = showPathFormula phi False ++ " ~B " ++ showPathFormula psi False
showPathFormula (WPast' phi psi) True = showPathFormula phi False ++ " ~W! " ++ showPathFormula psi False
showPathFormula (UPast' phi psi) True = showPathFormula phi False ++ " ~U! " ++ showPathFormula psi False