verigraph-1.1.1: Software specification and verification tool based on graph rewriting.

MaintainerGuilherme G. Azzi <ggazzi@inf.ufrgs.br>
Stabilityprovisional
Safe HaskellSafe
LanguageHaskell2010

Logic.Model

Contents

Description

 

Synopsis

Kripke structures

data KripkeStructure a Source #

A Kripke structure is composed of a list of states and a list of transitions between such states. States are labeled with the atomic propositions that hold in it.

This particular kind of labeled transition system may be used as a model for temporal logics. In particular, it may be used for model checking.

This structure is polymorphic on the type of atomic propositions.

Constructors

KripkeStructure 

Fields

data State a Source #

A state contains its unique identifier and a list of atomic propositions that hold in it.

Constructors

State Int [a] 

Instances

Eq a => Eq (State a) Source # 

Methods

(==) :: State a -> State a -> Bool #

(/=) :: State a -> State a -> Bool #

Read a => Read (State a) Source # 
Show a => Show (State a) Source # 

Methods

showsPrec :: Int -> State a -> ShowS #

show :: State a -> String #

showList :: [State a] -> ShowS #

Element (State a) Source # 

Associated Types

type Payload (State a) :: * Source #

Methods

elementId :: State a -> Int Source #

values :: State a -> [Payload (State a)] Source #

type Payload (State a) Source # 
type Payload (State a) = a

data Transition a Source #

A transition contains the identifiers of the source and target states.

Constructors

Transition 

Looking up states

stateIds :: KripkeStructure a -> [Int] Source #

List of all state IDs from a given Kripke structure

lookupState :: Int -> KripkeStructure a -> Maybe (State a) Source #

Finds the state with given ID in the given Kripke structure

getState :: Int -> KripkeStructure a -> State a Source #

Gets the state with given ID in the given Kripke structure, fails if there is none.

Looking up transitions

transitionIds :: KripkeStructure a -> [Int] Source #

List of all transition IDs on a given Kripke structure

lookupTransition :: Int -> KripkeStructure a -> Maybe (Transition a) Source #

Finds the transition with given ID in the given Kripke structure.

getTransition :: Int -> KripkeStructure a -> Transition a Source #

Gets the transition with given ID in the given Kripke structure, fails if there is none.

Lookup by adjacency

nextStates :: KripkeStructure a -> Int -> [Int] Source #

Obtains the IDs of the states that are reachable by a single transition from the state with given ID.

precedes :: KripkeStructure a -> Int -> Int -> Bool Source #

Tests if the second given state is reachable from the first by a single transition

prevStates :: KripkeStructure a -> Int -> [Int] Source #

Obtains the IDs of the states from which the given state is reachable by a single transition.

follows :: KripkeStructure a -> Int -> Int -> Bool Source #

Tests if the first given state is reachable from the second by a single transition

Utilities for labeled elements

class Element e where Source #

Type class for elements that have a numeric identifier and a list of associated values.

Minimal complete definition

elementId, values

Associated Types

type Payload e :: * Source #

Type of associated values.

Methods

elementId :: e -> Int Source #

Obtain the numeric identifier of an element.

values :: e -> [Payload e] Source #

Obtain the associated values of an element.

Instances

Element (Transition a) Source # 

Associated Types

type Payload (Transition a) :: * Source #

Element (State a) Source # 

Associated Types

type Payload (State a) :: * Source #

Methods

elementId :: State a -> Int Source #

values :: State a -> [Payload (State a)] Source #

findById :: Element a => Int -> [a] -> Maybe a Source #

Given a list of elements, find the element with the given identifier.