Example #1
0
        public void BeginCheck(string descriptiveName, VCExpr vc, ProverInterface.ErrorHandler handler, int timeout, int rlimit, int?randomSeed)
        {
            Contract.Requires(descriptiveName != null);
            Contract.Requires(vc != null);
            Contract.Requires(handler != null);
            Contract.Requires(IsReady);

            status       = CheckerStatus.Busy;
            hasOutput    = false;
            outputExn    = null;
            this.handler = handler;

            thmProver.Reset(gen);
            if (0 < rlimit)
            {
                timeout = 0;
            }
            SetTimeout(timeout);
            SetRlimit(rlimit);
            SetRandomSeed(randomSeed);
            proverStart = DateTime.UtcNow;
            thmProver.BeginCheck(descriptiveName, vc, handler);
            //  gen.ClearSharedFormulas();    PR: don't know yet what to do with this guy

            ProverTask = Task.Factory.StartNew(() => { WaitForOutput(null); }, TaskCreationOptions.LongRunning);
        }
Example #2
0
    private void WaitForOutput(object dummy) {
      lock (this)
      {
        try
        {
          outcome = thmProver.CheckOutcome(cce.NonNull(handler));
        }
        catch (UnexpectedProverOutputException e)
        {
          outputExn = e;
        }

        switch (outcome)
        {
          case ProverInterface.Outcome.Valid:
            thmProver.LogComment("Valid");
            break;
          case ProverInterface.Outcome.Invalid:
            thmProver.LogComment("Invalid");
            break;
          case ProverInterface.Outcome.TimeOut:
            thmProver.LogComment("Timed out");
            break;
          case ProverInterface.Outcome.OutOfMemory:
            thmProver.LogComment("Out of memory");
            break;
          case ProverInterface.Outcome.Undetermined:
            thmProver.LogComment("Undetermined");
            break;
        }

        hasOutput = true;
        proverRunTime = DateTime.UtcNow - proverStart;
      }
    }
Example #3
0
 public void Retarget(Program prog, ProverContext ctx)
 {
     lock (this)
     {
         hasOutput = default(bool);
         outcome   = default(ProverInterface.Outcome);
         outputExn = default(UnexpectedProverOutputException);
         handler   = default(ProverInterface.ErrorHandler);
         TheoremProver.FullReset(gen);
         ctx.Reset();
         Setup(prog, ctx);
     }
 }
Example #4
0
        private void WaitForOutput(object dummy)
        {
            lock (this)
              {
            try
            {
              outcome = thmProver.CheckOutcome(cce.NonNull(handler));
            }
            catch (UnexpectedProverOutputException e)
            {
              outputExn = e;
            }

            switch (outcome)
            {
              case ProverInterface.Outcome.Valid:
            thmProver.LogComment("Valid");
            break;
              case ProverInterface.Outcome.Invalid:
            thmProver.LogComment("Invalid");
            break;
              case ProverInterface.Outcome.TimeOut:
            thmProver.LogComment("Timed out");
            break;
              case ProverInterface.Outcome.OutOfMemory:
            thmProver.LogComment("Out of memory");
            break;
              case ProverInterface.Outcome.Undetermined:
            thmProver.LogComment("Undetermined");
            break;
            }

            hasOutput = true;
            proverRunTime = DateTime.UtcNow - proverStart;
              }
        }
Example #5
0
 public void Retarget(Program prog, ProverContext ctx, int timeout = 0)
 {
     lock (this)
       {
     hasOutput = default(bool);
     outcome = default(ProverInterface.Outcome);
     outputExn = default(UnexpectedProverOutputException);
     handler = default(ProverInterface.ErrorHandler);
     TheoremProver.FullReset(gen);
     ctx.Reset();
     Setup(prog, ctx);
     this.timeout = timeout;
     SetTimeout();
       }
 }
Example #6
0
        public void BeginCheck(string descriptiveName, VCExpr vc, ProverInterface.ErrorHandler handler)
        {
            Contract.Requires(descriptiveName != null);
              Contract.Requires(vc != null);
              Contract.Requires(handler != null);
              Contract.Requires(IsReady);

              status = CheckerStatus.Busy;
              hasOutput = false;
              outputExn = null;
              this.handler = handler;

              thmProver.Reset(gen);
              SetTimeout();
              proverStart = DateTime.UtcNow;
              thmProver.BeginCheck(descriptiveName, vc, handler);
              //  gen.ClearSharedFormulas();    PR: don't know yet what to do with this guy

              ProverTask = Task.Factory.StartNew(() => { WaitForOutput(null); }, TaskCreationOptions.LongRunning);
        }