Averest


ModelCheckingExplicit Module

This module implements functions for global and local model checking of mu-calculus and CTL formulas of explicitly defined Kripke structures. It also provides functions for some Kripke structure examples like the NIM game.

Types

Type Description

cubeOfAtoms

goal

qBlock

Functions and values

Function or value Description

ComputePreStructure phi

Full Usage: ComputePreStructure phi

Parameters:
Returns: Map<int, cubeOfAtoms> * Set<int> * Set<int * int>

compute a transition system whose states and transitions contains all models of a given formula if that formula is satisfiable at all

phi : SpecExpr
Returns: Map<int, cubeOfAtoms> * Set<int> * Set<int * int>

ComputeStates ostr prefix k phi

Full Usage: ComputeStates ostr prefix k phi

Parameters:
Returns: Set<int>

This function implements a model checker for CTL and mu-calculus using an explicit representation of the Kripke structure as given in this module.

ostr : 'a option
prefix : string
k : KripkeStructure
phi : SpecExpr
Returns: Set<int>

DecomposeGoals g

Full Usage: DecomposeGoals g

Parameters:
Returns: Set<goal>

decompose a set of goals where each goal is split into blocks gA which contain only literals and finished E- and A-blocks and where each block is split into b = b = bA ∪ bB where formulas in bA are all X-formulas so that no rule applies anymore.

g : Set<goal>
Returns: Set<goal>

DecomposeTool qscoll

Full Usage: DecomposeTool qscoll

Parameters:
qscoll : NameValueCollection

FindCTLTheorems maxNum maxLen rand varL

Full Usage: FindCTLTheorems maxNum maxLen rand varL

Parameters:
    maxNum : int
    maxLen : int
    rand : Random
    varL : string list

Returns: Set<SpecExpr> * Set<SpecExpr * KripkeStructure>

find some valid CTL formulas

maxNum : int
maxLen : int
rand : Random
varL : string list
Returns: Set<SpecExpr> * Set<SpecExpr * KripkeStructure>

FindInfinitePath k startSet

Full Usage: FindInfinitePath k startSet

Parameters:
Returns: int list

Find an infinite path through the Kripke structure k. The function can also be used to compute a witness for EG phi when k is restricted first to phi-states before calling the function.

k : KripkeStructure
startSet : Set<int>
Returns: int list

FindPath k startSet targetSet

Full Usage: FindPath k startSet targetSet

Parameters:
Returns: int list

Find a path from startSet to targetSet (assuming that such a path exists). The function is used to compute witnesses or counterexamples.

k : KripkeStructure
startSet : Set<int>
targetSet : Set<int>
Returns: int list

Goal2SpecExpr (arg1, arg2)

Full Usage: Goal2SpecExpr (arg1, arg2)

Parameters:
Returns: SpecExpr
arg0 : Set<qBlock>
arg1 : Set<qBlock>
Returns: SpecExpr

GuardedForm phi

Full Usage: GuardedForm phi

Parameters:
Returns: SpecExpr

Converting a given mu-calculus formula into guarded form so that local model checking will not run into infinite loops.

phi : SpecExpr
Returns: SpecExpr

LocalModelCheckTree2Dot ostr statePrefix pt

Full Usage: LocalModelCheckTree2Dot ostr statePrefix pt

Parameters:

write local model checking proof tree to a dot file

ostr : TextWriter
statePrefix : string
pt : Map<int, (int * int * SpecExpr * bool * int list)>

LocalModelChecking allSubgoals k state phi

Full Usage: LocalModelChecking allSubgoals k state phi

Parameters:
Returns: bool * int * Map<int, (int * int * SpecExpr * bool * int list)>

This function implements a local model checking procedure for CTL and mu-calculus using an explicit representation of the Kripke structure as given in this module. Given state s of a Kripke structure k, and formula phi, the function computes a triple (res,initNode,proofTree) where the boolean value res holds iff phi holds in s, initNode is the index of the root node (labelled with (s,phi)), and proofTree is a map where integers (used as identifiers for nodes of the proof tree) are mapped to tuples (kd,s,phi,res,sucL) with the following meaning: kd>0 for nodes with a conjunctive branching or proven leaf nodes, kd<0 for nodes with a disjunctive branching or disproven leaf nodes, and kd=0 when there is a unique successor node. (s,phi) are the state and the formula proven or disproven by the proof tree starting in this node, and res is the boolean value that tells us whether it is proven (res=true) or disproven (res=false). Finally, sucL is the list of successor nodes of this node.

allSubgoals : bool
k : KripkeStructure
state : int
phi : SpecExpr
Returns: bool * int * Map<int, (int * int * SpecExpr * bool * int list)>

MkTreeAutomaton phi

Full Usage: MkTreeAutomaton phi

Parameters:
Returns: List<SpecExpr * SpecExpr> * Map<SpecExpr, SpecExpr> * SpecExpr

compute a tree automaton for a given CTL* or mu-calculus formula: for a given CTL* formula, it computes (doneAbbrv,abbrvMap,phiTop) where doneAbbrv is a list of abbreviations x[i]=phi[i] where x[i] is a new (state) variable and phi[i] a modal logic formula over the state and input variables; abbrvMap is a map that maps x[i] to a CTL* formula which is abbreviated by it; and phiTop is a modal logic formula whose satisfying assignments are the initial states

phi : SpecExpr
Returns: List<SpecExpr * SpecExpr> * Map<SpecExpr, SpecExpr> * SpecExpr

ModelCheckingTool qscoll

Full Usage: ModelCheckingTool qscoll

Parameters:

This function is meant to be called from cgi; it expects a Kripke structure as value of name "KripkeStructure" and a μ-calculus formula given as value of name "Property" in the qscoll argument. The values are parsed, and then the set of states where the μ-calculus formula holds are compute step by step.

qscoll : NameValueCollection

MysticSquare n

Full Usage: MysticSquare n

Parameters:
    n : int

Returns: KripkeStructure

The following function generates a Kripke structure for the mystic square puzzle, i.e., a NxN matrix with numbers 0,...,NxN-1, where the number 0 is considered to be a hole where its neighbors can be moved in. The task is to sort the matrix by such moves.

n : int
Returns: KripkeStructure

NIM initState

Full Usage: NIM initState

Parameters:
    initState : int[]

Returns: KripkeStructure

The following function generates a Kripke structure for the NIM game, i.e., an array of size N, which is used by two players. Each player can remove any number of tokens of an array element i.e., can reduce the number as much as (s)he likes. The player who has to take the last element loses the game.

initState : int[]
Returns: KripkeStructure

PreStructure2Dot ostr onlyProp statePrefix (indexMap, initialStates, transRel)

Full Usage: PreStructure2Dot ostr onlyProp statePrefix (indexMap, initialStates, transRel)

Parameters:
    ostr : TextWriter
    onlyProp : bool
    statePrefix : string
    indexMap : Map<int, cubeOfAtoms>
    initialStates : Set<int>
    transRel : seq<int * int>

draw a pre-structure to a dot file

ostr : TextWriter
onlyProp : bool
statePrefix : string
indexMap : Map<int, cubeOfAtoms>
initialStates : Set<int>
transRel : seq<int * int>

PreStructure2DotNew ostr statePrefix (indexMap, initialStates, transRel)

Full Usage: PreStructure2DotNew ostr statePrefix (indexMap, initialStates, transRel)

Parameters:

draw a pre-structure to a dot file

ostr : TextWriter
statePrefix : string
indexMap : Map<int, Set<SpecExpr>>
initialStates : Set<int>
transRel : seq<int * int>

PreStructure2File filename onlyProp (indexMap, initialStates, transRel)

Full Usage: PreStructure2File filename onlyProp (indexMap, initialStates, transRel)

Parameters:
    filename : string
    onlyProp : bool
    indexMap : Map<int, cubeOfAtoms>
    initialStates : Set<int>
    transRel : seq<int * int>

filename : string
onlyProp : bool
indexMap : Map<int, cubeOfAtoms>
initialStates : Set<int>
transRel : seq<int * int>

PreStructure2KripkeStructure (indexMap, initialStates, transRel)

Full Usage: PreStructure2KripkeStructure (indexMap, initialStates, transRel)

Parameters:
Returns: KripkeStructure

convert a given pre-structure to a Kripke structure

indexMap : Map<'a, cubeOfAtoms>
initialStates : Set<int>
transRel : Set<int * int>
Returns: KripkeStructure

PreStructureTool qscoll

Full Usage: PreStructureTool qscoll

Parameters:
qscoll : NameValueCollection

ProveCTL phi

Full Usage: ProveCTL phi

Parameters:
Returns: bool * KripkeStructure option

prove a given CTL* or mu-calculus formula

phi : SpecExpr
Returns: bool * KripkeStructure option

RandomCTL rand varL length

Full Usage: RandomCTL rand varL length

Parameters:
    rand : Random
    varL : string list
    length : int

Returns: SpecExpr

generate a random CTL logic formula of a given size

rand : Random
varL : string list
length : int
Returns: SpecExpr

SatCheckCTL phi

Full Usage: SatCheckCTL phi

Parameters:
Returns: bool * KripkeStructure option

check satisfiability of a given CTL* or mu-calculus formula

phi : SpecExpr
Returns: bool * KripkeStructure option

SpecialModelCheckingExamples qscoll

Full Usage: SpecialModelCheckingExamples qscoll

Parameters:

This is the cgi-function for the special model checking examples.

qscoll : NameValueCollection

TreeAutomaton2PreStructure (eqs, aMap, initPhi)

Full Usage: TreeAutomaton2PreStructure (eqs, aMap, initPhi)

Parameters:
Returns: Map<int, Set<SpecExpr>> * Set<int> * Set<int * int>

compute a prestructure for a given alternating tree automaton

eqs : (SpecExpr * SpecExpr) list
aMap : 'a
initPhi : SpecExpr
Returns: Map<int, Set<SpecExpr>> * Set<int> * Set<int * int>