Exemple #1
0
        void Respond(string[] command, bool inputIsPlaintext)
        {
            try {
                if (command.Length == 0)
                {
                    throw new ServerException("Empty command");
                }

                var verb = command[0];
                var msg  = "Verification completed successfully!";
                if (verb == "verify")
                {
                    ServerUtils.checkArgs(command, 0);
                    var vt = ReadVerificationTask(inputIsPlaintext);
                    vt.Run();
                }
                else if (verb == "counterexample")
                {
                    ServerUtils.checkArgs(command, 0);
                    var vt = ReadVerificationTask(inputIsPlaintext);
                    vt.CounterExample();
                }
                else if (verb == "dotgraph")
                {
                    ServerUtils.checkArgs(command, 0);
                    var vt = ReadVerificationTask(inputIsPlaintext);
                    vt.DotGraph();
                }
                else if (verb == "symbols")
                {
                    ServerUtils.checkArgs(command, 0);
                    var vt = ReadVerificationTask(inputIsPlaintext);
                    vt.Symbols();
                }
                else if (verb == "version")
                {
                    ServerUtils.checkArgs(command, 0);
                    var _ = ReadVerificationTask(inputIsPlaintext);
                    VersionCheck.CurrentVersion();
                }
                else if (verb == "unmarshal")
                {
                    ServerUtils.checkArgs(command, 0);
                    var vt = ReadVerificationTask(false);
                    vt.Unmarshal(command);
                    msg = null;
                }
                else if (verb == "marshal")
                {
                    ServerUtils.checkArgs(command, 0);
                    var vt = ReadVerificationTask(true);
                    vt.Marshal(command);
                    msg = null;
                }
                else if (verb == "quit")
                {
                    ServerUtils.checkArgs(command, 0);
                    Exit();
                    return; // don't print EOM message
                }
                else
                {
                    throw new ServerException("Unknown verb '{0}'", verb);
                }

                Interaction.EOM(Interaction.SUCCESS, msg);
            } catch (ServerException ex) {
                Interaction.EOM(Interaction.FAILURE, ex);
            } catch (Exception ex) {
                Interaction.EOM(Interaction.FAILURE, ex, "[FATAL]");
                running = false;
            }
        }
Exemple #2
0
 public bool Verify()
 {
     ServerUtils.ApplyArgs(args, reporter);
     return(Parse() && Resolve() && Translate() && Boogie());
 }