Class Repl

java.lang.Object
org.clafer.ig.Repl

public final class Repl extends Object
The one loop of the solutions, whatever the backend: claferIG's CommandLine.hs, with clafersg's commands. A solution is an instance (Choco) or a trace (Alloy). The loop keeps the solutions shown, the most recent first, and their views: the full view or the diff view (d), the saved files (e), the Graphviz graph (dot) and the clafers found (f); the backend solves and handles its own commands.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    The solutions shown so far, the most recent first: those not saved yet and those saved; the Alloy XML of the most recent; and whether they are shown as the changes from the previous snapshot.
    static interface 
    Shows a solution, which becomes the most recent one.
    static final record 
    The input of the commands and the outputs: claferIG prints its solutions on the standard output and its unsat cores on the standard error.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Repl(Backend backend, Repl.Io io, boolean diffView)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Shows a solution, which becomes the most recent one.
    void
    run()
    Runs the loop until q or the end of the input.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Repl

      public Repl(Backend backend, Repl.Io io, boolean diffView)
      Parameters:
      diffView - whether the solutions are shown as their changes (--diff)
  • Method Details

    • run

      public void run() throws Exception
      Runs the loop until q or the end of the input.
      Throws:
      Exception
    • display

      public void display(Backend.Shown shown)
      Shows a solution, which becomes the most recent one.