org.jmlspecs.samples.digraph
Class TransposableDigraph
java.lang.Object
org.jmlspecs.samples.digraph.Digraph
org.jmlspecs.samples.digraph.TransposableDigraph
- Direct Known Subclasses:
- SearchableDigraph
- public class TransposableDigraph
- extends Digraph
Transposable directed graphs.
- Author:
- Katie Becker, Gary T. Leavens
Specifications inherited from class Digraph |
private invariant_redundantly this.nodeSet != null;
private invariant ( \forall java.lang.Object e; this.nodeSet.contains(e); e != null&&e instanceof org.jmlspecs.samples.digraph.NodeType);
private invariant_redundantly this.arcSet != null;
private invariant ( \forall java.lang.Object e; this.arcSet.contains(e); e != null&&e instanceof org.jmlspecs.samples.digraph.Arc);
public invariant_redundantly this.nodes != null;
public invariant ( \forall org.jmlspecs.models.JMLType n; this.nodes.has(n); n instanceof org.jmlspecs.samples.digraph.NodeType);
public invariant_redundantly this.arcs != null;
public invariant ( \forall org.jmlspecs.models.JMLType a; this.arcs.has(a); a instanceof org.jmlspecs.samples.digraph.ArcType);
public invariant ( \forall org.jmlspecs.samples.digraph.ArcType a; this.arcs.has(a); this.nodes.has(a.from)&&this.nodes.has(a.to));
private represents nodes <- org.jmlspecs.models.JMLValueSet.convertFrom(this.nodeSet);
private represents arcs <- this.arcAbstractValue(this.arcSet); |
Specifications inherited from class Object |
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT;
public represents _getClass <- \typeof(this); |
Model fields inherited from class org.jmlspecs.samples.digraph.Digraph |
arcs, nodes |
Method Summary |
void |
transpose()
Transpose this graph by inverting the direction of all its edges. |
TransposableDigraph
public TransposableDigraph()
- Initialize this transposable digraph to be empty.
- Specifications:
-
public normal_behavior
assignable nodes, arcs;
ensures this.nodes.isEmpty()&&this.arcs.isEmpty();
flipAll
public JMLValueSet flipAll(JMLValueSet s)
- Return a set with each edge inverted.
- Specifications: pure
transpose
public void transpose()
- Transpose this graph by inverting the direction of all its edges.
- Specifications:
-
public normal_behavior
assignable arcs;
ensures this.nodes.equals(\old(this.nodes));
ensures this.arcs.equals(this.flipAll(\old(this.arcs)));
JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.