AtpClient.Isabelle.Verdict (AtpClient v0.7.2)

Copy Markdown View Source

Reads the use_theories payload of an Isabelle server into SZS values.

Isabelle does not print SZS lines. Its result is a list of messages with positions, and the verdict for a lemma is read from the messages at its position. classify/1 treats every message as one bucket; per_lemma/3 buckets them by the line range each lemma covers.

Verdict precedence

Within a bucket, the signals read from its messages are reconciled in this order, each step short-circuiting:

  1. :counter_satisfiable — a Nitpick or Quickcheck counterexample disproves the goal and dominates any concurrent proof attempt.
  2. :theorem from a sledgehammer or metis found a proof line.
  3. :satisfiable — a Nitpick or Quickcheck model.
  4. A Failed to finish proof or Failed to apply initial proof method error vetoes a theorem name: echo from the same bucket: Isabelle prints the goal at the by position whether or not the method closed it.
  5. :theorem from a theorem name: completion.
  6. :timeout, :memory_out, then :gave_up.

A bucket with no signal is :gave_up. Messages are read one at a time, never across their concatenation: Nitpick found a model followed by Nitpick found no counterexample reads as a model, not as a counterexample.

Summary

Types

The verdict for one lemma, by name. The line number is not carried: it would refer to the generated theory, not to the caller's input.

One lemma of a generated theory body.

Functions

The verdict over every message of a finished use_theories task's result.

One verdict per lemma, in the order of specs.

Every message text in the payload, across all nodes, joined by newlines.

Types

lemma_result()

@type lemma_result() :: %{name: String.t() | nil, status: Tptp.Szs.Ontology.t()}

The verdict for one lemma, by name. The line number is not carried: it would refer to the generated theory, not to the caller's input.

lemma_spec()

@type lemma_spec() :: %{name: String.t(), range: Range.t()}

One lemma of a generated theory body.

  • name — the lemma's name as written in the body.
  • range — the body lines the lemma covers, inclusive, from its lemma line to the line before the next.

Functions

classify(payload)

@spec classify(map()) :: Tptp.Szs.Ontology.t()

The verdict over every message of a finished use_theories task's result.

Reads messages, not the task's ok flag: a theory with "ok" => false still classifies, with the proof-method veto keeping a goal echo from counting as a proof.

per_lemma(payload, specs, options \\ [])

@spec per_lemma(map(), [lemma_spec()], keyword()) :: [lemma_result()]

One verdict per lemma, in the order of specs.

Options

  • :file — keep only messages whose pos.file ends with this suffix, typically "/<theory_name>.thy", so messages from imported theories are left out.
  • :line_offset — subtracted from each message's pos.line before it is compared with a range. A body wrapped in a one-line theory header passes 1.

text(payload)

@spec text(map()) :: binary()

Every message text in the payload, across all nodes, joined by newlines.