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

Safe HaskellSafe
LanguageHaskell2010

Graph.QuickCheck

Contents

Synopsis

Documentation

randomNodeOf :: Graph n e -> Gen (Node n) Source #

Generate a random node that is a member of the given graph. Must not be used with empty graphs, so calls to this are often similar to the following:

not (Prelude.null $ nodes graph) ==> forAll (randomNodeOf graph) $ node -> someProperty graph node

randomNodeIdOf :: Graph n e -> Gen NodeId Source #

Generate a random node identifier that is a member of the given graph. Must not be used with empty graphs, so calls to this are often similar to the following:

not (Prelude.null $ nodes graph) ==> forAll (randomNodeIdOf graph) $ nodeId -> someProperty graph nodeId

randomNodeInContextOf :: Graph n e -> Gen (NodeInContext n e) Source #

Generate a random node that is a member of the given graph, along with its context. Must not be used with empty graphs, so calls to this are often similar to the following:

not (Prelude.null $ nodes graph) ==> forAll (randomNodeInContextOf graph) $ (node, ctx) -> someProperty graph node ctx

randomEdgeOf :: Graph n e -> Gen (Edge e) Source #

Generate a random edge that is a member of the given graph. Must not be used with empty graphs, so calls to this are often similar to the following:

not (Prelude.null $ edges graph) ==> forAll (randomEdgeOf graph) $ edge -> someProperty graph edge

randomEdgeIdOf :: Graph n e -> Gen EdgeId Source #

Generate a random edge identifier that is a member of the given graph. Must not be used with empty graphs, so calls to this are often similar to the following:

not (Prelude.null $ edges graph) ==> forAll (randomEdgeIdOf graph) $ edgeId -> someProperty graph edgeId

randomEdgeInContextOf :: Graph n e -> Gen (EdgeInContext n e) Source #

Generate a random edge that is a member of the given graph, along with its context. Must not be used with empty graphs, so calls to this are often similar to the following:

not (Prelude.null $ edges graph) ==> forAll (randomEdgeInContextOf graph) $ (edge, ctx) -> someProperty graph edge ctx

randomGraph :: Gen n -> Gen e -> Int -> Int -> Gen (Graph n e) Source #

Given generators for payloads, the number of nodes and the number of edges, generates a random graph.

shrinkGraph :: Graph n e -> [Graph n e] Source #

Produces all immediate shrinks of the given graph. Each shrink step may remove a single node (along with all its incident edges) or a single edge.

Orphan instances

Arbitrary EdgeId Source # 

Methods

arbitrary :: Gen EdgeId

shrink :: EdgeId -> [EdgeId]

Arbitrary NodeId Source # 

Methods

arbitrary :: Gen NodeId

shrink :: NodeId -> [NodeId]

Eq e => Eq (Edge e) Source # 

Methods

(==) :: Edge e -> Edge e -> Bool #

(/=) :: Edge e -> Edge e -> Bool #

Eq n => Eq (Node n) Source # 

Methods

(==) :: Node n -> Node n -> Bool #

(/=) :: Node n -> Node n -> Bool #

Arbitrary e => Arbitrary (Edge e) Source # 

Methods

arbitrary :: Gen (Edge e)

shrink :: Edge e -> [Edge e]

Arbitrary n => Arbitrary (Node n) Source # 

Methods

arbitrary :: Gen (Node n)

shrink :: Node n -> [Node n]

Show (NodeContext n e) Source # 

Methods

showsPrec :: Int -> NodeContext n e -> ShowS #

show :: NodeContext n e -> String #

showList :: [NodeContext n e] -> ShowS #

(Arbitrary n, Arbitrary e) => Arbitrary (Graph n e) Source # 

Methods

arbitrary :: Gen (Graph n e)

shrink :: Graph n e -> [Graph n e]