Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Isabelle/Tools/Graphview/   (Beweissystem Isabelle Version 2025-1©)  Datei vom 16.11.2025 mit Größe 1 kB image not shown  

Quelle  model.scala   Sprache: Scala

 
/*  Title:      Tools/Graphview/model.scala
    Author:     Markus Kaiser, TU Muenchen
    Author:     Makarius

Internal graph representation.
*/


package isabelle.graphview


import isabelle._

import java.awt.Color


class Mutator_Container(val available: List[Mutator]) {
  val events = new Mutator_Event.Bus

  private var _mutators : List[Mutator.Info] = Nil
  def apply(): List[Mutator.Info] = _mutators
  def apply(mutators: List[Mutator.Info]): Unit = {
    _mutators = mutators
    events.event(Mutator_Event.Message.New_List(mutators))
  }

  def add(mutator: Mutator.Info): Unit = {
    _mutators = _mutators ::: List(mutator)
    events.event(Mutator_Event.Message.Add(mutator))
  }
}


class Model(val full_graph: Graph_Display.Graph) {
  val Mutators =
    new Mutator_Container(
      List(
        Mutator.Node_Expression(".*"falsefalsefalse),
        Mutator.Node_List(Nil, falsefalsefalse),
        Mutator.Edge_Endpoints((Graph_Display.Node.dummy, Graph_Display.Node.dummy)),
        Mutator.Add_Node_Expression(""),
        Mutator.Add_Transitive_Closure(truetrue)))

  val Colors =
    new Mutator_Container(
      List(
        Mutator.Node_Expression(".*"falsefalsefalse),
        Mutator.Node_List(Nil, falsefalsefalse)))

  def find_node(ident: String): Option[Graph_Display.Node] =
    full_graph.keys_iterator.find(node => node.ident == ident)

  def make_visible_graph(): Graph_Display.Graph =
    Mutators().foldLeft(full_graph) {
      case (g, m) => if (!m.enabled) g else m.mutator.mutate(full_graph, g)
    }

  private var _colors = Map.empty[Graph_Display.Node, Color]
  def colors = _colors

  private def build_colors(): Unit = {
    _colors =
      Colors().foldLeft(Map.empty[Graph_Display.Node, Color]) {
        case (colors, m) =>
          m.mutator.mutate(full_graph, full_graph).keys_iterator.foldLeft(colors) {
            case (colors, node) => colors + (node -> m.color)
          }
      }
  }
  Colors.events += { case _ => build_colors() }
}

100%


¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.