001package daikon.simplify;
002
003import org.checkerframework.checker.lock.qual.GuardSatisfied;
004import org.checkerframework.checker.lock.qual.GuardedBy;
005import org.checkerframework.dataflow.qual.SideEffectFree;
006
007/**
008 * A Raw command provides no additional structure, allowing arbitrary commands (as long as they have
009 * no output) to be sent to the prover. It will not block.
010 */
011public class CmdRaw implements Cmd {
012  public final String cmd;
013
014  public CmdRaw(String cmd) {
015    this.cmd = cmd.trim();
016    SimpUtil.assert_well_formed(this.cmd);
017  }
018
019  /** For documentation, read the class overview. */
020  @Override
021  public void apply(final @GuardedBy("<self>") Session s) {
022
023    synchronized (s) {
024      // send out the command
025      s.sendLine(cmd);
026      // there is no output from Simplify
027    }
028  }
029
030  @SideEffectFree
031  @Override
032  public String toString(@GuardSatisfied CmdRaw this) {
033    return "CmdRaw: " + cmd;
034  }
035}