proofs.rs

Report #39 — toml_write 0.1.2 string and key metrics and builder selection

Aeneas be86ab0f1989d04944292b345b24c435be3ad10a

12 verified claims · 1 finding

Recorded by the author; proofs.rs has not re-run it. How to read a report

MasWag · 2026-11-25 09:05 UTC

Revision v1

Overview

The selected release-source string and key builder methods choose an encoding from the cached
metrics in the builder. For every modeled builder state, the checked theorem
statements establish that each selected method returns successfully and makes the
choice specified by those metrics. Basic selectors always return their corresponding
encoding; optional selectors return it only when their recorded flags and quote
counts satisfy the method's conditions. The returned value retains the decoded
string and, for strings, the recorded newline flag.

The selector proofs alone use cached state. For keys, a separate constructor theorem
specifies that the metrics mark an unquoted key exactly when the input bytes are
nonempty and all are ASCII letters, digits, hyphen, or underscore. The other flags
record whether any byte is a single quote, double quote, backslash, ASCII C0 control
byte other than tab, or DEL. A composed theorem specifies that the constructor and
selector return successfully, with the selector returning Some exactly under that
nonempty ASCII condition and None otherwise.

For strings whose longest consecutive runs of apostrophes and double quotes are
each at most 255, the string constructor theorem specifies successful construction
with the original text and exact metrics: both longest runs and the presence of
backslash, line feed, and ASCII C0 controls other than tab and line feed, or DEL.
This is a bound on each run, not on total length or total quote count. A complementary
theorem specifies modeled integer overflow when either run reaches 256. In the checked-arithmetic model this covers both constructor outcomes. The managed
run and audit are documented in the profile's results.md.

Separate theorems for adapted default methods specify the first eligible encoding
in the documented order, for every raw builder state. Composition theorems connect
them to the key constructor and, under the two quote-run bounds, the string
constructor. The default-method adaptation and its correspondence to the release
are described under limitations.

Findings (1)

APIs (12)

Recorded callables

TomlKeyBuilder::as_basic recorded callable · signature and safety not recorded
TomlKeyBuilder::as_basic_pretty recorded callable · signature and safety not recorded
TomlKeyBuilder::as_literal recorded callable · signature and safety not recorded
TomlKeyBuilder::as_unquoted recorded callable · signature and safety not recorded
TomlKeyBuilder::new recorded callable · signature and safety not recorded
TomlStringBuilder::as_basic recorded callable · signature and safety not recorded
TomlStringBuilder::as_basic_pretty recorded callable · signature and safety not recorded
TomlStringBuilder::as_literal recorded callable · signature and safety not recorded
TomlStringBuilder::as_ml_basic recorded callable · signature and safety not recorded
TomlStringBuilder::as_ml_basic_pretty recorded callable · signature and safety not recorded
TomlStringBuilder::as_ml_literal recorded callable · signature and safety not recorded
TomlStringBuilder::new recorded callable · signature and safety not recorded

Evidence

https://github.com/MasWag/crate-proofs/tree/a5fbf385bb59e2f9e61418b4cb72226a1f6146bf

Reproduce

Toolchain source metadata: not recorded.

Run locally

git clone -- https://github.com/MasWag/crate-proofs report-39-source-1
git -C report-39-source-1 checkout --detach a5fbf385bb59e2f9e61418b4cb72226a1f6146bf
git -C report-39-source-1 submodule update --init --recursive --checkout
cd report-39-source-1/toml_write/0.1.2/.work/build/default/aarch64-apple-darwin/proofs

lake build +BuilderProofs +MetricsProofs +ValueMetricsProofs

printf '%s' 'import Aeneas
import BuilderProofs
import MetricsProofs
import ValueMetricsProofs
set_option pp.all true
set_option pp.universes true
set_option pp.explicit true
set_option pp.fullNames true
set_option pp.notation false
set_option pp.proofs true
set_option pp.deepTerms true
set_option pp.maxSteps 10000000
-- proofs.rs adapter for Lean 4.35.0 / Aeneas be86ab0f.
-- Uses Lean'\''s environment, Meta telescope and pretty-printer, never source parsing.
open Lean Meta Elab Command
namespace ProofsProbe
meta def moduleOf (env : Environment) (n : Name) : String :=
  match env.getModuleIdxFor? n with
  | some idx => env.header.moduleNames[idx.toNat]!.toString
  | none => ""
meta def pretty (e : Expr) : MetaM String := do
  let s := (← ppExpr e).pretty
  if s.contains '\''⋯'\'' then
    throwError "Lean display contains an omission marker (or literal ⋯); refusing an incomplete proposition"
  if s.utf8ByteSize > 1000000 then throwError "Proposition exceeds 1,000,000-byte recording limit"
  return s
-- The full statement stays explicit; the inspection view uses Lean notation.
meta def readable (e : Expr) : MetaM String :=
  withOptions (fun o =>
    let o := o.setBool `pp.all false
    let o := o.setBool `pp.explicit false
    let o := o.setBool `pp.universes false
    o.setBool `pp.notation true) (pretty e)
-- Only a constant'\''s own tag grants a link; names in plain text are never guessed.
partial def segments (code : Widget.CodeWithInfos) (ref : Option Name := none) : Array Json :=
  match code with
  | .text text => #[Json.mkObj (([("text", toJson text)]) ++
      (ref.toList.map fun n => ("ref", toJson n.toString)))]
  | .append parts => parts.foldl (fun acc part => acc ++ segments part ref) #[]
  | .tag info part =>
    let ref := match info.info.val.info with
      | .ofTermInfo ti => ti.expr.constName?
      | _ => none
    segments part ref
meta def readableFields (key : String) (e : Expr) : MetaM (List (String × Json)) := do
  let text ← readable e
  let base := [(key, toJson text)]
  try
    let code ← withOptions (fun o =>
      let o := o.setBool `pp.all false
      let o := o.setBool `pp.explicit false
      let o := o.setBool `pp.universes false
      let o := o.setBool `pp.notation true
      o.setBool `pp.tagAppFns true) (Widget.ppExprTagged e)
    let parts := segments code
    let joined := String.join (parts.toList.map fun j =>
      (j.getObjValAs? String "text").toOption.getD "")
    if joined != text || parts.size > 10000 || joined.utf8ByteSize > 1000000 then
      return base
    return base ++ [(key ++ "_segments", toJson parts)]
  catch _ => return base
meta def inspect (n : Name) (ty : Expr) (manual : Bool) : MetaM (Option Json) := do
  let env ← getEnv
  forallTelescope ty fun xs conclusion => do
    let programExpr ← try
      let normalized ← Aeneas.Utils.normalizeLetBindings conclusion
      let (expr, _) ← Aeneas.Step.getStepSpecFunArgsExpr normalized
      pure (some expr)
    catch _ => pure none
    if programExpr.isNone && !manual then return none
    let full ← pretty ty
    let program ← match programExpr with
      | some expr => pure (toJson (← readable expr))
      | none => pure Json.null
    let head := toJson (programExpr.bind (·.getAppFn.constName?) |>.map Name.toString)
    let mut binders := #[]
    for x in xs do
      let d ← x.fvarId!.getDecl
      let prop ← isProp d.type
      binders := binders.push (Json.mkObj ((← readableFields "type" d.type) ++ [
        ("name", toJson d.userName.toString),
        ("kind", toJson (if d.binderInfo.isInstImplicit then "instance" else if prop then "hypothesis" else "variable")),
        ("binder", toJson (if d.binderInfo.isInstImplicit then "instance" else if d.binderInfo.isExplicit then "explicit" else "implicit"))]))
    if binders.size > 1000 then throwError "More than 1000 binders"
    let some ranges ← findDeclarationRanges? n | throwError "Missing theorem source range: {n}"
    let axioms ← Lean.collectAxioms n
    let constants := ty.getUsedConstants
    let mut definitions := #[]
    for nm in constants.extract 0 100 do
      let ranges ← findDeclarationRanges? nm
      definitions := definitions.push (Json.mkObj [
        ("name", toJson nm.toString), ("module", toJson (moduleOf env nm)),
        ("source", match ranges with
          | some r => Json.mkObj [("first_line", toJson r.range.pos.line), ("last_line", toJson r.range.endPos.line)]
          | none => Json.null)])
    return some (Json.mkObj ((← readableFields "conclusion" conclusion) ++ [
      ("version", toJson (1 : Nat)), ("theorem", toJson n.toString),
      ("module", toJson (moduleOf env n)), ("statement", toJson full),
      ("binders", toJson binders),
      ("program", program), ("program_head", head),
      ("axioms", toJson (axioms.map Name.toString)),
      ("first_line", toJson ranges.range.pos.line), ("last_line", toJson ranges.range.endPos.line),
      ("definitions", toJson definitions), ("definitions_truncated", toJson (decide (constants.size > 100))),
      ("translation_rerun", toJson false)]))
end ProofsProbe

run_cmd do
  let manual : Array Name := #[`TomlWriteVerification.string_basic, `TomlWriteVerification.string_ml_basic, `TomlWriteVerification.string_literal, `TomlWriteVerification.string_ml_literal, `TomlWriteVerification.string_basic_pretty, `TomlWriteVerification.string_ml_basic_pretty, `TomlWriteVerification.key_basic, `TomlWriteVerification.key_unquoted, `TomlWriteVerification.key_literal, `TomlWriteVerification.key_basic_pretty, `TomlWriteVerification.key_constructor, `TomlWriteVerification.string_constructor]
  let localModules : Array String := #[]
  let roots : Array Name := #[]
  let env ← getEnv
  let mut closure : Array Name := #[]
  let mut pending := roots.toList
  while !pending.isEmpty do
    let m := pending.head!
    pending := pending.tail!
    if !closure.contains m then
      closure := closure.push m
      if let some idx := env.header.moduleNames.findIdx? (· == m) then
        pending := (env.header.moduleData[idx]!.imports.toList.map (·.module)) ++ pending
  let scope := closure.filter (fun m => localModules.contains m.toString)
  for n in manual do
    match env.find? n with
    | some (.thmInfo _) => pure ()
    | _ => throwError "Expected a theorem: {n}"
  for (n, ci) in env.constants.toList do
    let explicit := manual.contains n
    if explicit || scope.contains (ProofsProbe.moduleOf env n).toName then
      if let .thmInfo th := ci then
        let result ← liftTermElabM <| ProofsProbe.inspect n th.type explicit
        if let some value := result then
          liftIO <| IO.println ("proofs.rs:formal:" ++ value.compress)

run_cmd do
  let theorem_name := `TomlWriteVerification.key_basic
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.key_basic"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.key_basic: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.key_basic"

run_cmd do
  let theorem_name := `TomlWriteVerification.key_basic_pretty
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.key_basic_pretty"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.key_basic_pretty: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.key_basic_pretty"

run_cmd do
  let theorem_name := `TomlWriteVerification.key_literal
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.key_literal"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.key_literal: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.key_literal"

run_cmd do
  let theorem_name := `TomlWriteVerification.key_unquoted
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.key_unquoted"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.key_unquoted: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.key_unquoted"

run_cmd do
  let theorem_name := `TomlWriteVerification.key_constructor
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.key_constructor"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.key_constructor: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.key_constructor"

run_cmd do
  let theorem_name := `TomlWriteVerification.string_basic
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.string_basic"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.string_basic: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.string_basic"

run_cmd do
  let theorem_name := `TomlWriteVerification.string_basic_pretty
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.string_basic_pretty"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.string_basic_pretty: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.string_basic_pretty"

run_cmd do
  let theorem_name := `TomlWriteVerification.string_literal
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.string_literal"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.string_literal: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.string_literal"

run_cmd do
  let theorem_name := `TomlWriteVerification.string_ml_basic
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.string_ml_basic"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.string_ml_basic: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.string_ml_basic"

run_cmd do
  let theorem_name := `TomlWriteVerification.string_ml_basic_pretty
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.string_ml_basic_pretty"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.string_ml_basic_pretty: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.string_ml_basic_pretty"

run_cmd do
  let theorem_name := `TomlWriteVerification.string_ml_literal
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.string_ml_literal"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.string_ml_literal: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.string_ml_literal"

run_cmd do
  let theorem_name := `TomlWriteVerification.string_constructor
  match (← getEnv).find? theorem_name with
  | some (.thmInfo _) => pure ()
  | _ => throwError "Expected a theorem: TomlWriteVerification.string_constructor"
  let axioms ← Lean.collectAxioms theorem_name
  for ax in axioms do
    unless [``propext, ``Classical.choice, ``Quot.sound].contains ax do
      throwError "Unapproved axiom in TomlWriteVerification.string_constructor: {ax}"
  liftIO <| IO.println "proofs.rs:checked:TomlWriteVerification.string_constructor"
' | lake env lean --stdin

Checks out the recorded source commit from GitHub. Install the report’s tool version before running.

Source on GitHub · SARIF with logs (.json)

Recorded run

Completed · 12 checks passed · 0 failed

2026-11-25T09:03:19.018304+00:00 · 53.3 seconds · Exit code 0

Recorded on the author’s machine.

CheckResultClaim
Lean checked theorem TomlWriteVerification.key_basic; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.key_basic
PassedClaim #1
Lean checked theorem TomlWriteVerification.key_basic_pretty; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.key_basic_pretty
PassedClaim #2
Lean checked theorem TomlWriteVerification.key_literal; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.key_literal
PassedClaim #3
Lean checked theorem TomlWriteVerification.key_unquoted; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.key_unquoted
PassedClaim #4
Lean checked theorem TomlWriteVerification.key_constructor; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.key_constructor
PassedClaim #5
Lean checked theorem TomlWriteVerification.string_basic; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.string_basic
PassedClaim #6
Lean checked theorem TomlWriteVerification.string_basic_pretty; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.string_basic_pretty
PassedClaim #7
Lean checked theorem TomlWriteVerification.string_literal; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.string_literal
PassedClaim #8
Lean checked theorem TomlWriteVerification.string_ml_basic; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.string_ml_basic
PassedClaim #9
Lean checked theorem TomlWriteVerification.string_ml_basic_pretty; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.string_ml_basic_pretty
PassedClaim #10
Lean checked theorem TomlWriteVerification.string_ml_literal; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.string_ml_literal
PassedClaim #11
Lean checked theorem TomlWriteVerification.string_constructor; axioms limited to propext, Classical.choice, Quot.sound
TomlWriteVerification.string_constructor
PassedClaim #12
Execution details
Started
2026-11-25T09:03:19.018304+00:00
Finished
2026-11-25T09:04:12.318640+00:00
Platform
macos aarch64
Rust compiler
rustc 1.94.1 (e408947bf 2026-03-25) binary: rustc commit-hash: e408947bfd200af42db322daf0fadfe7e26d3bd1 commit-date: 2026-03-25 host: aarch64-apple-darwin release: 1.94.1 LLVM version: 21.1.8
Working directory
toml_write/0.1.2/.work/build/default/aarch64-apple-darwin/proofs
Environment overrides
None recorded
Git repository
https://github.com/MasWag/crate-proofs
Git commit
a5fbf385bb59e2f9e61418b4cb72226a1f6146bf
Diagnostics & logs
=== stdout ===
✔ [1796/1801] Built TomlWrite.FunsExternal (5.3s)
✔ [1797/1801] Built TomlWrite.Types (5.3s)
✔ [1798/1801] Built TomlWrite.Funs (1.5s)
✔ [1799/1801] Built BuilderProofs (5.9s)
✔ [1800/1801] Built MetricsProofs (21s)
✔ [1801/1801] Built ValueMetricsProofs (3.5s)
Build completed successfully (1801 jobs).

$ lake env lean --stdin (proofs.rs formal extraction and axiom audit)
proofs.rs:formal:{"axioms":["propext","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlKeyBuilder","type_segments":[{"ref":"toml_write.string.TomlKeyBuilder","text":"toml_write.string.TomlKeyBuilder"}]}],"conclusion":"builder.as_literal =\n  Aeneas.Std.Result.ok\n    (if builder.metrics.escape_codes = Bool.false ∧ builder.metrics.single_quotes = Bool.false then\n      Option.some (TomlWriteVerification.keyResult✝ builder (Option.some toml_write.string.Encoding.LiteralString))\n    else Option.none)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.as_literal","text":"as_literal"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":"\n    "},{"ref":"ite","text":"("},{"ref":"ite","text":"if "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.KeyMetrics.escape_codes","text":"escape_codes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧ "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.KeyMetrics.single_quotes","text":"single_quotes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"ite","text":" then"},{"ref":"ite","text":"\n      "},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","text":"TomlWriteVerification.keyResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"text":"("},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"ref":"toml_write.string.Encoding.LiteralString","text":"toml_write.string.Encoding.LiteralString"},{"text":")"},{"text":")"},{"ref":"ite","text":"\n    "},{"ref":"ite","text":"else "},{"ref":"Option.none","text":"Option.none"},{"ref":"ite","text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder","source":{"first_line":65,"last_line":70}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"Init.Prelude","name":"Option","source":{"first_line":3047,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKey","source":{"first_line":72,"last_line":77}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlKeyBuilder.as_literal","source":{"first_line":414,"last_line":429}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"Init.Prelude","name":"ite","source":{"first_line":1324,"last_line":1346}},{"module":"Init.Prelude","name":"And","source":{"first_line":645,"last_line":659}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"TomlWrite.Types","name":"toml_write.string.KeyMetrics.escape_codes","source":{"first_line":62,"last_line":62}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder.metrics","source":{"first_line":70,"last_line":70}},{"module":"Init.Prelude","name":"Bool.false","source":{"first_line":108,"last_line":109}},{"module":"TomlWrite.Types","name":"toml_write.string.KeyMetrics.single_quotes","source":{"first_line":60,"last_line":60}},{"module":"Init.Prelude","name":"instDecidableAnd","source":{"first_line":1239,"last_line":1245}},{"module":"Init.Prelude","name":"instDecidableEqBool","source":{"first_line":1280,"last_line":1281}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","source":{"first_line":12,"last_line":14}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding","source":{"first_line":39,"last_line":46}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.LiteralString","source":{"first_line":43,"last_line":43}},{"module":"Init.Prelude","name":"Option.none","source":{"first_line":3055,"last_line":3056}}],"definitions_truncated":false,"first_line":76,"last_line":82,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlKeyBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} toml_write.string.TomlKey))\n    (toml_write.string.TomlKeyBuilder.as_literal builder)\n    (@Aeneas.Std.Result.ok.{0} (Option.{0} toml_write.string.TomlKey)\n      (@ite.{1} (Option.{0} toml_write.string.TomlKey)\n        (And\n          (@Eq.{1} Bool (toml_write.string.KeyMetrics.escape_codes (toml_write.string.TomlKeyBuilder.metrics builder))\n            Bool.false)\n          (@Eq.{1} Bool (toml_write.string.KeyMetrics.single_quotes (toml_write.string.TomlKeyBuilder.metrics builder))\n            Bool.false))\n        (@instDecidableAnd\n          (@Eq.{1} Bool (toml_write.string.KeyMetrics.escape_codes (toml_write.string.TomlKeyBuilder.metrics builder))\n            Bool.false)\n          (@Eq.{1} Bool (toml_write.string.KeyMetrics.single_quotes (toml_write.string.TomlKeyBuilder.metrics builder))\n            Bool.false)\n          (instDecidableEqBool\n            (toml_write.string.KeyMetrics.escape_codes (toml_write.string.TomlKeyBuilder.metrics builder)) Bool.false)\n          (instDecidableEqBool\n            (toml_write.string.KeyMetrics.single_quotes (toml_write.string.TomlKeyBuilder.metrics builder)) Bool.false))\n        (@Option.some.{0} toml_write.string.TomlKey\n          (_private.BuilderProofs.0.TomlWriteVerification.keyResult builder\n            (@Option.some.{0} toml_write.string.Encoding toml_write.string.Encoding.LiteralString)))\n        (@Option.none.{0} toml_write.string.TomlKey)))","theorem":"TomlWriteVerification.key_literal","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlStringBuilder","type_segments":[{"ref":"toml_write.string.TomlStringBuilder","text":"toml_write.string.TomlStringBuilder"}]}],"conclusion":"builder.as_ml_basic =\n  Aeneas.Std.Result.ok (TomlWriteVerification.stringResult✝ builder toml_write.string.Encoding.MlBasicString)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.as_ml_basic","text":"as_ml_basic"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","text":"TomlWriteVerification.stringResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"ref":"toml_write.string.Encoding.MlBasicString","text":"toml_write.string.Encoding.MlBasicString"},{"text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder","source":{"first_line":32,"last_line":37}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlString","source":{"first_line":48,"last_line":54}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlStringBuilder.as_ml_basic","source":{"first_line":196,"last_line":206}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","source":{"first_line":8,"last_line":10}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.MlBasicString","source":{"first_line":46,"last_line":46}}],"definitions_truncated":false,"first_line":27,"last_line":28,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlStringBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} toml_write.string.TomlString) (toml_write.string.TomlStringBuilder.as_ml_basic builder)\n    (@Aeneas.Std.Result.ok.{0} toml_write.string.TomlString\n      (_private.BuilderProofs.0.TomlWriteVerification.stringResult builder toml_write.string.Encoding.MlBasicString))","theorem":"TomlWriteVerification.string_ml_basic","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Classical.choice","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"s","type":"Aeneas.Std.Str","type_segments":[{"ref":"Aeneas.Std.Str","text":"Aeneas.Std.Str"}]},{"binder":"explicit","kind":"hypothesis","name":"singleFits","type":"TomlWriteVerification.longestQuoteRun 39#u8 ↑s ≤ 255","type_segments":[{"ref":"TomlWriteVerification.longestQuoteRun","text":"TomlWriteVerification.longestQuoteRun"},{"text":" "},{"text":"39"},{"ref":"Aeneas.Std.U8.ofNat","text":"#u8"},{"text":" "},{"text":"↑"},{"text":"s"},{"ref":"LE.le","text":" ≤ "},{"text":"255"}]},{"binder":"explicit","kind":"hypothesis","name":"doubleFits","type":"TomlWriteVerification.longestQuoteRun 34#u8 ↑s ≤ 255","type_segments":[{"ref":"TomlWriteVerification.longestQuoteRun","text":"TomlWriteVerification.longestQuoteRun"},{"text":" "},{"text":"34"},{"ref":"Aeneas.Std.U8.ofNat","text":"#u8"},{"text":" "},{"text":"↑"},{"text":"s"},{"ref":"LE.le","text":" ≤ "},{"text":"255"}]}],"conclusion":"∃ metrics,\n  toml_write.string.TomlStringBuilder.new s = Aeneas.Std.Result.ok { decoded := s, metrics := metrics } ∧\n    (↑metrics.max_seq_single_quotes, ↑metrics.max_seq_double_quotes, metrics.escape_codes, metrics.escape,\n        metrics.newline) =\n      TomlWriteVerification.valueMetricsSpec ↑s","conclusion_segments":[{"text":"∃ "},{"text":"metrics"},{"text":",\n  "},{"ref":"toml_write.string.TomlStringBuilder.new","text":"toml_write.string.TomlStringBuilder.new"},{"text":" "},{"text":"s"},{"ref":"Eq","text":" = "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":" "},{"ref":"toml_write.string.TomlStringBuilder.mk","text":"{ "},{"text":"decoded"},{"ref":"toml_write.string.TomlStringBuilder.mk","text":" := "},{"text":"s"},{"ref":"toml_write.string.TomlStringBuilder.mk","text":", "},{"text":"metrics"},{"ref":"toml_write.string.TomlStringBuilder.mk","text":" := "},{"text":"metrics"},{"ref":"toml_write.string.TomlStringBuilder.mk","text":" }"},{"ref":"And","text":" ∧\n    "},{"ref":"Prod.mk","text":"("},{"text":"↑"},{"text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.max_seq_single_quotes","text":"max_seq_single_quotes"},{"ref":"Prod.mk","text":", "},{"text":"↑"},{"text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.max_seq_double_quotes","text":"max_seq_double_quotes"},{"ref":"Prod.mk","text":", "},{"text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape_codes","text":"escape_codes"},{"ref":"Prod.mk","text":", "},{"text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape","text":"escape"},{"ref":"Prod.mk","text":",\n        "},{"text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.newline","text":"newline"},{"ref":"Prod.mk","text":")"},{"ref":"Eq","text":" =\n      "},{"ref":"TomlWriteVerification.valueMetricsSpec","text":"TomlWriteVerification.valueMetricsSpec"},{"text":" "},{"text":"↑"},{"text":"s"}],"definitions":[{"module":"Aeneas.Std.StringDef","name":"Aeneas.Std.Str","source":{"first_line":8,"last_line":8}},{"module":"Init.Prelude","name":"LE.le","source":{"first_line":1402,"last_line":1402}},{"module":"Init.Prelude","name":"Nat","source":{"first_line":1349,"last_line":1371}},{"module":"Init.Prelude","name":"instLENat","source":{"first_line":2026,"last_line":2027}},{"module":"ValueMetricsProofs","name":"TomlWriteVerification.longestQuoteRun","source":{"first_line":62,"last_line":65}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.U8.ofNat","source":{"first_line":704,"last_line":704}},{"module":"Init.Prelude","name":"OfNat.ofNat","source":{"first_line":1393,"last_line":1393}},{"module":"Init.Prelude","name":"instOfNatNat","source":{"first_line":1395,"last_line":1397}},{"module":"Init.Prelude","name":"of_decide_eq_true","source":{"first_line":1224,"last_line":1227}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalar.cMax","source":{"first_line":378,"last_line":381}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalarTy.U8","source":{"first_line":33,"last_line":33}},{"module":"Init.Prelude","name":"Nat.decLe","source":{"first_line":2196,"last_line":2212}},{"module":"Init.Prelude","name":"id","source":{"first_line":119,"last_line":131}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"Init.Prelude","name":"Decidable.decide","source":{"first_line":1158,"last_line":1158}},{"module":"Init.Prelude","name":"Bool.true","source":{"first_line":110,"last_line":111}},{"module":"Init.Prelude","name":"Eq.refl","source":{"first_line":74,"last_line":76}},{"module":"Aeneas.Std.SliceDef","name":"Aeneas.Std.Slice.val","source":{"first_line":21,"last_line":22}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.U8","source":{"first_line":669,"last_line":669}},{"module":"Init.Core","name":"Exists","source":{"first_line":313,"last_line":341}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics","source":{"first_line":23,"last_line":30}},{"module":"Init.Prelude","name":"And","source":{"first_line":645,"last_line":659}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder","source":{"first_line":32,"last_line":37}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlStringBuilder.new","source":{"first_line":118,"last_line":124}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder.mk","source":{"first_line":35,"last_line":35}},{"module":"Init.Prelude","name":"Prod","source":{"first_line":603,"last_line":618}},{"module":"Init.Prelude","name":"Prod.mk","source":{"first_line":614,"last_line":614}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalar.val","source":{"first_line":76,"last_line":76}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.max_seq_single_quotes","source":{"first_line":26,"last_line":26}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.max_seq_double_quotes","source":{"first_line":27,"last_line":27}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape_codes","source":{"first_line":28,"last_line":28}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape","source":{"first_line":29,"last_line":29}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.newline","source":{"first_line":30,"last_line":30}},{"module":"ValueMetricsProofs","name":"TomlWriteVerification.valueMetricsSpec","source":{"first_line":171,"last_line":173}}],"definitions_truncated":false,"first_line":211,"last_line":218,"module":"ValueMetricsProofs","program":null,"program_head":null,"statement":"∀ (s : Aeneas.Std.Str)\n  (singleFits :\n    @LE.le.{0} Nat instLENat\n      (TomlWriteVerification.longestQuoteRun\n        (Aeneas.Std.U8.ofNat (@OfNat.ofNat.{0} Nat (nat_lit 39) (instOfNatNat (nat_lit 39)))\n          (@of_decide_eq_true\n            (@LE.le.{0} Nat instLENat (@OfNat.ofNat.{0} Nat (nat_lit 39) (instOfNatNat (nat_lit 39)))\n              (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8))\n            (Nat.decLe (@OfNat.ofNat.{0} Nat (nat_lit 39) (instOfNatNat (nat_lit 39)))\n              (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8))\n            (@id.{0}\n              (@Eq.{1} Bool\n                (@Decidable.decide\n                  (@LE.le.{0} Nat instLENat (@OfNat.ofNat.{0} Nat (nat_lit 39) (instOfNatNat (nat_lit 39)))\n                    (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8))\n                  (Nat.decLe (@OfNat.ofNat.{0} Nat (nat_lit 39) (instOfNatNat (nat_lit 39)))\n                    (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8)))\n                Bool.true)\n              (@Eq.refl.{1} Bool Bool.true))))\n        (@Aeneas.Std.Slice.val.{0} Aeneas.Std.U8 s))\n      (@OfNat.ofNat.{0} Nat (nat_lit 255) (instOfNatNat (nat_lit 255))))\n  (doubleFits :\n    @LE.le.{0} Nat instLENat\n      (TomlWriteVerification.longestQuoteRun\n        (Aeneas.Std.U8.ofNat (@OfNat.ofNat.{0} Nat (nat_lit 34) (instOfNatNat (nat_lit 34)))\n          (@of_decide_eq_true\n            (@LE.le.{0} Nat instLENat (@OfNat.ofNat.{0} Nat (nat_lit 34) (instOfNatNat (nat_lit 34)))\n              (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8))\n            (Nat.decLe (@OfNat.ofNat.{0} Nat (nat_lit 34) (instOfNatNat (nat_lit 34)))\n              (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8))\n            (@id.{0}\n              (@Eq.{1} Bool\n                (@Decidable.decide\n                  (@LE.le.{0} Nat instLENat (@OfNat.ofNat.{0} Nat (nat_lit 34) (instOfNatNat (nat_lit 34)))\n                    (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8))\n                  (Nat.decLe (@OfNat.ofNat.{0} Nat (nat_lit 34) (instOfNatNat (nat_lit 34)))\n                    (Aeneas.Std.UScalar.cMax Aeneas.Std.UScalarTy.U8)))\n                Bool.true)\n              (@Eq.refl.{1} Bool Bool.true))))\n        (@Aeneas.Std.Slice.val.{0} Aeneas.Std.U8 s))\n      (@OfNat.ofNat.{0} Nat (nat_lit 255) (instOfNatNat (nat_lit 255)))),\n  @Exists.{1} toml_write.string.ValueMetrics fun (metrics : toml_write.string.ValueMetrics) =>\n    And\n      (@Eq.{1} (Aeneas.Std.Result.{0} toml_write.string.TomlStringBuilder) (toml_write.string.TomlStringBuilder.new s)\n        (@Aeneas.Std.Result.ok.{0} toml_write.string.TomlStringBuilder\n          (toml_write.string.TomlStringBuilder.mk s metrics)))\n      (@Eq.{1} (Prod.{0, 0} Nat (Prod.{0, 0} Nat (Prod.{0, 0} Bool (Prod.{0, 0} Bool Bool))))\n        (@Prod.mk.{0, 0} Nat (Prod.{0, 0} Nat (Prod.{0, 0} Bool (Prod.{0, 0} Bool Bool)))\n          (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n            (toml_write.string.ValueMetrics.max_seq_single_quotes metrics))\n          (@Prod.mk.{0, 0} Nat (Prod.{0, 0} Bool (Prod.{0, 0} Bool Bool))\n            (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n              (toml_write.string.ValueMetrics.max_seq_double_quotes metrics))\n            (@Prod.mk.{0, 0} Bool (Prod.{0, 0} Bool Bool) (toml_write.string.ValueMetrics.escape_codes metrics)\n              (@Prod.mk.{0, 0} Bool Bool (toml_write.string.ValueMetrics.escape metrics)\n                (toml_write.string.ValueMetrics.newline metrics)))))\n        (TomlWriteVerification.valueMetricsSpec (@Aeneas.Std.Slice.val.{0} Aeneas.Std.U8 s)))","theorem":"TomlWriteVerification.string_constructor","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Classical.choice","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlStringBuilder","type_segments":[{"ref":"toml_write.string.TomlStringBuilder","text":"toml_write.string.TomlStringBuilder"}]}],"conclusion":"builder.as_ml_literal =\n  Aeneas.Std.Result.ok\n    (if builder.metrics.escape_codes = Bool.false ∧ ↑builder.metrics.max_seq_single_quotes ≤ 2 then\n      Option.some (TomlWriteVerification.stringResult✝ builder toml_write.string.Encoding.MlLiteralString)\n    else Option.none)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.as_ml_literal","text":"as_ml_literal"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":"\n    "},{"ref":"ite","text":"("},{"ref":"ite","text":"if "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape_codes","text":"escape_codes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧ "},{"text":"↑"},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.max_seq_single_quotes","text":"max_seq_single_quotes"},{"ref":"LE.le","text":" ≤ "},{"text":"2"},{"ref":"ite","text":" then"},{"ref":"ite","text":"\n      "},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","text":"TomlWriteVerification.stringResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"ref":"toml_write.string.Encoding.MlLiteralString","text":"toml_write.string.Encoding.MlLiteralString"},{"text":")"},{"ref":"ite","text":"\n    "},{"ref":"ite","text":"else "},{"ref":"Option.none","text":"Option.none"},{"ref":"ite","text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder","source":{"first_line":32,"last_line":37}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"Init.Prelude","name":"Option","source":{"first_line":3047,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlString","source":{"first_line":48,"last_line":54}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlStringBuilder.as_ml_literal","source":{"first_line":147,"last_line":163}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"Init.Prelude","name":"ite","source":{"first_line":1324,"last_line":1346}},{"module":"Init.Prelude","name":"And","source":{"first_line":645,"last_line":659}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape_codes","source":{"first_line":28,"last_line":28}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder.metrics","source":{"first_line":37,"last_line":37}},{"module":"Init.Prelude","name":"Bool.false","source":{"first_line":108,"last_line":109}},{"module":"Init.Prelude","name":"LE.le","source":{"first_line":1402,"last_line":1402}},{"module":"Init.Prelude","name":"Nat","source":{"first_line":1349,"last_line":1371}},{"module":"Init.Prelude","name":"instLENat","source":{"first_line":2026,"last_line":2027}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalar.val","source":{"first_line":76,"last_line":76}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalarTy.U8","source":{"first_line":33,"last_line":33}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.max_seq_single_quotes","source":{"first_line":26,"last_line":26}},{"module":"Init.Prelude","name":"OfNat.ofNat","source":{"first_line":1393,"last_line":1393}},{"module":"Init.Prelude","name":"instOfNatNat","source":{"first_line":1395,"last_line":1397}},{"module":"Init.Prelude","name":"instDecidableAnd","source":{"first_line":1239,"last_line":1245}},{"module":"Init.Prelude","name":"instDecidableEqBool","source":{"first_line":1280,"last_line":1281}},{"module":"Init.Prelude","name":"Nat.decLe","source":{"first_line":2196,"last_line":2212}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","source":{"first_line":8,"last_line":10}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.MlLiteralString","source":{"first_line":45,"last_line":45}},{"module":"Init.Prelude","name":"Option.none","source":{"first_line":3055,"last_line":3056}}],"definitions_truncated":false,"first_line":39,"last_line":46,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlStringBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} toml_write.string.TomlString))\n    (toml_write.string.TomlStringBuilder.as_ml_literal builder)\n    (@Aeneas.Std.Result.ok.{0} (Option.{0} toml_write.string.TomlString)\n      (@ite.{1} (Option.{0} toml_write.string.TomlString)\n        (And\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (@LE.le.{0} Nat instLENat\n            (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n              (toml_write.string.ValueMetrics.max_seq_single_quotes\n                (toml_write.string.TomlStringBuilder.metrics builder)))\n            (@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2)))))\n        (@instDecidableAnd\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (@LE.le.{0} Nat instLENat\n            (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n              (toml_write.string.ValueMetrics.max_seq_single_quotes\n                (toml_write.string.TomlStringBuilder.metrics builder)))\n            (@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2))))\n          (instDecidableEqBool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (Nat.decLe\n            (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n              (toml_write.string.ValueMetrics.max_seq_single_quotes\n                (toml_write.string.TomlStringBuilder.metrics builder)))\n            (@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2)))))\n        (@Option.some.{0} toml_write.string.TomlString\n          (_private.BuilderProofs.0.TomlWriteVerification.stringResult builder\n            toml_write.string.Encoding.MlLiteralString))\n        (@Option.none.{0} toml_write.string.TomlString)))","theorem":"TomlWriteVerification.string_ml_literal","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlStringBuilder","type_segments":[{"ref":"toml_write.string.TomlStringBuilder","text":"toml_write.string.TomlStringBuilder"}]}],"conclusion":"builder.as_basic =\n  Aeneas.Std.Result.ok (TomlWriteVerification.stringResult✝ builder toml_write.string.Encoding.BasicString)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.as_basic","text":"as_basic"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","text":"TomlWriteVerification.stringResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"ref":"toml_write.string.Encoding.BasicString","text":"toml_write.string.Encoding.BasicString"},{"text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder","source":{"first_line":32,"last_line":37}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlString","source":{"first_line":48,"last_line":54}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlStringBuilder.as_basic","source":{"first_line":165,"last_line":175}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","source":{"first_line":8,"last_line":10}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.BasicString","source":{"first_line":44,"last_line":44}}],"definitions_truncated":false,"first_line":24,"last_line":25,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlStringBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} toml_write.string.TomlString) (toml_write.string.TomlStringBuilder.as_basic builder)\n    (@Aeneas.Std.Result.ok.{0} toml_write.string.TomlString\n      (_private.BuilderProofs.0.TomlWriteVerification.stringResult builder toml_write.string.Encoding.BasicString))","theorem":"TomlWriteVerification.string_basic","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Classical.choice","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"s","type":"Aeneas.Std.Str","type_segments":[{"ref":"Aeneas.Std.Str","text":"Aeneas.Std.Str"}]}],"conclusion":"toml_write.string.TomlKeyBuilder.new s =\n  Aeneas.Std.Result.ok { decoded := s, metrics := TomlWriteVerification.keyMetricsSpec s }","conclusion_segments":[{"ref":"toml_write.string.TomlKeyBuilder.new","text":"toml_write.string.TomlKeyBuilder.new"},{"text":" "},{"text":"s"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":" "},{"ref":"toml_write.string.TomlKeyBuilder.mk","text":"{ "},{"text":"decoded"},{"ref":"toml_write.string.TomlKeyBuilder.mk","text":" := "},{"text":"s"},{"ref":"toml_write.string.TomlKeyBuilder.mk","text":", "},{"text":"metrics"},{"ref":"toml_write.string.TomlKeyBuilder.mk","text":" := "},{"ref":"TomlWriteVerification.keyMetricsSpec","text":"TomlWriteVerification.keyMetricsSpec"},{"text":" "},{"text":"s"},{"ref":"toml_write.string.TomlKeyBuilder.mk","text":" }"}],"definitions":[{"module":"Aeneas.Std.StringDef","name":"Aeneas.Std.Str","source":{"first_line":8,"last_line":8}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder","source":{"first_line":65,"last_line":70}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlKeyBuilder.new","source":{"first_line":397,"last_line":403}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder.mk","source":{"first_line":68,"last_line":68}},{"module":"MetricsProofs","name":"TomlWriteVerification.keyMetricsSpec","source":{"first_line":86,"last_line":88}}],"definitions_truncated":false,"first_line":107,"last_line":110,"module":"MetricsProofs","program":null,"program_head":null,"statement":"∀ (s : Aeneas.Std.Str),\n  @Eq.{1} (Aeneas.Std.Result.{0} toml_write.string.TomlKeyBuilder) (toml_write.string.TomlKeyBuilder.new s)\n    (@Aeneas.Std.Result.ok.{0} toml_write.string.TomlKeyBuilder\n      (toml_write.string.TomlKeyBuilder.mk s (TomlWriteVerification.keyMetricsSpec s)))","theorem":"TomlWriteVerification.key_constructor","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Classical.choice","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlStringBuilder","type_segments":[{"ref":"toml_write.string.TomlStringBuilder","text":"toml_write.string.TomlStringBuilder"}]}],"conclusion":"builder.as_literal =\n  Aeneas.Std.Result.ok\n    (if\n        builder.metrics.escape_codes = Bool.false ∧\n          ↑builder.metrics.max_seq_single_quotes = 0 ∧ builder.metrics.newline = Bool.false then\n      Option.some (TomlWriteVerification.stringResult✝ builder toml_write.string.Encoding.LiteralString)\n    else Option.none)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.as_literal","text":"as_literal"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":"\n    "},{"ref":"ite","text":"("},{"ref":"ite","text":"if\n        "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape_codes","text":"escape_codes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧\n          "},{"text":"↑"},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.max_seq_single_quotes","text":"max_seq_single_quotes"},{"ref":"Eq","text":" = "},{"text":"0"},{"ref":"And","text":" ∧ "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.newline","text":"newline"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"ite","text":" then"},{"ref":"ite","text":"\n      "},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","text":"TomlWriteVerification.stringResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"ref":"toml_write.string.Encoding.LiteralString","text":"toml_write.string.Encoding.LiteralString"},{"text":")"},{"ref":"ite","text":"\n    "},{"ref":"ite","text":"else "},{"ref":"Option.none","text":"Option.none"},{"ref":"ite","text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder","source":{"first_line":32,"last_line":37}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"Init.Prelude","name":"Option","source":{"first_line":3047,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlString","source":{"first_line":48,"last_line":54}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlStringBuilder.as_literal","source":{"first_line":126,"last_line":145}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"Init.Prelude","name":"ite","source":{"first_line":1324,"last_line":1346}},{"module":"Init.Prelude","name":"And","source":{"first_line":645,"last_line":659}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape_codes","source":{"first_line":28,"last_line":28}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder.metrics","source":{"first_line":37,"last_line":37}},{"module":"Init.Prelude","name":"Bool.false","source":{"first_line":108,"last_line":109}},{"module":"Init.Prelude","name":"Nat","source":{"first_line":1349,"last_line":1371}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalar.val","source":{"first_line":76,"last_line":76}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalarTy.U8","source":{"first_line":33,"last_line":33}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.max_seq_single_quotes","source":{"first_line":26,"last_line":26}},{"module":"Init.Prelude","name":"OfNat.ofNat","source":{"first_line":1393,"last_line":1393}},{"module":"Init.Prelude","name":"instOfNatNat","source":{"first_line":1395,"last_line":1397}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.newline","source":{"first_line":30,"last_line":30}},{"module":"Init.Prelude","name":"instDecidableAnd","source":{"first_line":1239,"last_line":1245}},{"module":"Init.Prelude","name":"instDecidableEqBool","source":{"first_line":1280,"last_line":1281}},{"module":"Init.Prelude","name":"instDecidableEqNat","source":{"first_line":1995,"last_line":1995}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","source":{"first_line":8,"last_line":10}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.LiteralString","source":{"first_line":43,"last_line":43}},{"module":"Init.Prelude","name":"Option.none","source":{"first_line":3055,"last_line":3056}}],"definitions_truncated":false,"first_line":30,"last_line":37,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlStringBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} toml_write.string.TomlString))\n    (toml_write.string.TomlStringBuilder.as_literal builder)\n    (@Aeneas.Std.Result.ok.{0} (Option.{0} toml_write.string.TomlString)\n      (@ite.{1} (Option.{0} toml_write.string.TomlString)\n        (And\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Nat\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_single_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)))\n        (@instDecidableAnd\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Nat\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_single_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false))\n          (instDecidableEqBool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (@instDecidableAnd\n            (@Eq.{1} Nat\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_single_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)\n            (instDecidableEqNat\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_single_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n            (instDecidableEqBool\n              (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)))\n        (@Option.some.{0} toml_write.string.TomlString\n          (_private.BuilderProofs.0.TomlWriteVerification.stringResult builder\n            toml_write.string.Encoding.LiteralString))\n        (@Option.none.{0} toml_write.string.TomlString)))","theorem":"TomlWriteVerification.string_literal","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Classical.choice","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlKeyBuilder","type_segments":[{"ref":"toml_write.string.TomlKeyBuilder","text":"toml_write.string.TomlKeyBuilder"}]}],"conclusion":"builder.as_basic_pretty =\n  Aeneas.Std.Result.ok\n    (if\n        builder.metrics.escape_codes = Bool.false ∧\n          builder.metrics.escape = Bool.false ∧ builder.metrics.double_quotes = Bool.false then\n      Option.some (TomlWriteVerification.keyResult✝ builder (Option.some toml_write.string.Encoding.BasicString))\n    else Option.none)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.as_basic_pretty","text":"as_basic_pretty"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":"\n    "},{"ref":"ite","text":"("},{"ref":"ite","text":"if\n        "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.KeyMetrics.escape_codes","text":"escape_codes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧\n          "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.KeyMetrics.escape","text":"escape"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧ "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.KeyMetrics.double_quotes","text":"double_quotes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"ite","text":" then"},{"ref":"ite","text":"\n      "},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","text":"TomlWriteVerification.keyResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"text":"("},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"ref":"toml_write.string.Encoding.BasicString","text":"toml_write.string.Encoding.BasicString"},{"text":")"},{"text":")"},{"ref":"ite","text":"\n    "},{"ref":"ite","text":"else "},{"ref":"Option.none","text":"Option.none"},{"ref":"ite","text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder","source":{"first_line":65,"last_line":70}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"Init.Prelude","name":"Option","source":{"first_line":3047,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKey","source":{"first_line":72,"last_line":77}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlKeyBuilder.as_basic_pretty","source":{"first_line":439,"last_line":453}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"Init.Prelude","name":"ite","source":{"first_line":1324,"last_line":1346}},{"module":"Init.Prelude","name":"And","source":{"first_line":645,"last_line":659}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"TomlWrite.Types","name":"toml_write.string.KeyMetrics.escape_codes","source":{"first_line":62,"last_line":62}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder.metrics","source":{"first_line":70,"last_line":70}},{"module":"Init.Prelude","name":"Bool.false","source":{"first_line":108,"last_line":109}},{"module":"TomlWrite.Types","name":"toml_write.string.KeyMetrics.escape","source":{"first_line":63,"last_line":63}},{"module":"TomlWrite.Types","name":"toml_write.string.KeyMetrics.double_quotes","source":{"first_line":61,"last_line":61}},{"module":"Init.Prelude","name":"instDecidableAnd","source":{"first_line":1239,"last_line":1245}},{"module":"Init.Prelude","name":"instDecidableEqBool","source":{"first_line":1280,"last_line":1281}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","source":{"first_line":12,"last_line":14}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding","source":{"first_line":39,"last_line":46}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.BasicString","source":{"first_line":44,"last_line":44}},{"module":"Init.Prelude","name":"Option.none","source":{"first_line":3055,"last_line":3056}}],"definitions_truncated":false,"first_line":84,"last_line":90,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlKeyBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} toml_write.string.TomlKey))\n    (toml_write.string.TomlKeyBuilder.as_basic_pretty builder)\n    (@Aeneas.Std.Result.ok.{0} (Option.{0} toml_write.string.TomlKey)\n      (@ite.{1} (Option.{0} toml_write.string.TomlKey)\n        (And\n          (@Eq.{1} Bool (toml_write.string.KeyMetrics.escape_codes (toml_write.string.TomlKeyBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Bool (toml_write.string.KeyMetrics.escape (toml_write.string.TomlKeyBuilder.metrics builder))\n              Bool.false)\n            (@Eq.{1} Bool\n              (toml_write.string.KeyMetrics.double_quotes (toml_write.string.TomlKeyBuilder.metrics builder))\n              Bool.false)))\n        (@instDecidableAnd\n          (@Eq.{1} Bool (toml_write.string.KeyMetrics.escape_codes (toml_write.string.TomlKeyBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Bool (toml_write.string.KeyMetrics.escape (toml_write.string.TomlKeyBuilder.metrics builder))\n              Bool.false)\n            (@Eq.{1} Bool\n              (toml_write.string.KeyMetrics.double_quotes (toml_write.string.TomlKeyBuilder.metrics builder))\n              Bool.false))\n          (instDecidableEqBool\n            (toml_write.string.KeyMetrics.escape_codes (toml_write.string.TomlKeyBuilder.metrics builder)) Bool.false)\n          (@instDecidableAnd\n            (@Eq.{1} Bool (toml_write.string.KeyMetrics.escape (toml_write.string.TomlKeyBuilder.metrics builder))\n              Bool.false)\n            (@Eq.{1} Bool\n              (toml_write.string.KeyMetrics.double_quotes (toml_write.string.TomlKeyBuilder.metrics builder))\n              Bool.false)\n            (instDecidableEqBool\n              (toml_write.string.KeyMetrics.escape (toml_write.string.TomlKeyBuilder.metrics builder)) Bool.false)\n            (instDecidableEqBool\n              (toml_write.string.KeyMetrics.double_quotes (toml_write.string.TomlKeyBuilder.metrics builder))\n              Bool.false)))\n        (@Option.some.{0} toml_write.string.TomlKey\n          (_private.BuilderProofs.0.TomlWriteVerification.keyResult builder\n            (@Option.some.{0} toml_write.string.Encoding toml_write.string.Encoding.BasicString)))\n        (@Option.none.{0} toml_write.string.TomlKey)))","theorem":"TomlWriteVerification.key_basic_pretty","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlKeyBuilder","type_segments":[{"ref":"toml_write.string.TomlKeyBuilder","text":"toml_write.string.TomlKeyBuilder"}]}],"conclusion":"builder.as_unquoted =\n  Aeneas.Std.Result.ok\n    (if builder.metrics.unquoted = Bool.true then Option.some (TomlWriteVerification.keyResult✝ builder Option.none)\n    else Option.none)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.as_unquoted","text":"as_unquoted"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":"\n    "},{"ref":"ite","text":"("},{"ref":"ite","text":"if "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.KeyMetrics.unquoted","text":"unquoted"},{"ref":"Eq","text":" = "},{"ref":"Bool.true","text":"Bool.true"},{"ref":"ite","text":" then"},{"ref":"ite","text":" "},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","text":"TomlWriteVerification.keyResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"ref":"Option.none","text":"Option.none"},{"text":")"},{"ref":"ite","text":"\n    "},{"ref":"ite","text":"else "},{"ref":"Option.none","text":"Option.none"},{"ref":"ite","text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder","source":{"first_line":65,"last_line":70}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"Init.Prelude","name":"Option","source":{"first_line":3047,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKey","source":{"first_line":72,"last_line":77}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlKeyBuilder.as_unquoted","source":{"first_line":405,"last_line":412}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"Init.Prelude","name":"ite","source":{"first_line":1324,"last_line":1346}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"TomlWrite.Types","name":"toml_write.string.KeyMetrics.unquoted","source":{"first_line":59,"last_line":59}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder.metrics","source":{"first_line":70,"last_line":70}},{"module":"Init.Prelude","name":"Bool.true","source":{"first_line":110,"last_line":111}},{"module":"Init.Prelude","name":"instDecidableEqBool","source":{"first_line":1280,"last_line":1281}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","source":{"first_line":12,"last_line":14}},{"module":"Init.Prelude","name":"Option.none","source":{"first_line":3055,"last_line":3056}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding","source":{"first_line":39,"last_line":46}}],"definitions_truncated":false,"first_line":70,"last_line":74,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlKeyBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} toml_write.string.TomlKey))\n    (toml_write.string.TomlKeyBuilder.as_unquoted builder)\n    (@Aeneas.Std.Result.ok.{0} (Option.{0} toml_write.string.TomlKey)\n      (@ite.{1} (Option.{0} toml_write.string.TomlKey)\n        (@Eq.{1} Bool (toml_write.string.KeyMetrics.unquoted (toml_write.string.TomlKeyBuilder.metrics builder))\n          Bool.true)\n        (instDecidableEqBool (toml_write.string.KeyMetrics.unquoted (toml_write.string.TomlKeyBuilder.metrics builder))\n          Bool.true)\n        (@Option.some.{0} toml_write.string.TomlKey\n          (_private.BuilderProofs.0.TomlWriteVerification.keyResult builder\n            (@Option.none.{0} toml_write.string.Encoding)))\n        (@Option.none.{0} toml_write.string.TomlKey)))","theorem":"TomlWriteVerification.key_unquoted","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Classical.choice","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlStringBuilder","type_segments":[{"ref":"toml_write.string.TomlStringBuilder","text":"toml_write.string.TomlStringBuilder"}]}],"conclusion":"builder.as_basic_pretty =\n  Aeneas.Std.Result.ok\n    (if\n        builder.metrics.escape_codes = Bool.false ∧\n          builder.metrics.escape = Bool.false ∧\n            ↑builder.metrics.max_seq_double_quotes = 0 ∧ builder.metrics.newline = Bool.false then\n      Option.some (TomlWriteVerification.stringResult✝ builder toml_write.string.Encoding.BasicString)\n    else Option.none)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.as_basic_pretty","text":"as_basic_pretty"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":"\n    "},{"ref":"ite","text":"("},{"ref":"ite","text":"if\n        "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape_codes","text":"escape_codes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧\n          "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape","text":"escape"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧\n            "},{"text":"↑"},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.max_seq_double_quotes","text":"max_seq_double_quotes"},{"ref":"Eq","text":" = "},{"text":"0"},{"ref":"And","text":" ∧ "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.newline","text":"newline"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"ite","text":" then"},{"ref":"ite","text":"\n      "},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","text":"TomlWriteVerification.stringResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"ref":"toml_write.string.Encoding.BasicString","text":"toml_write.string.Encoding.BasicString"},{"text":")"},{"ref":"ite","text":"\n    "},{"ref":"ite","text":"else "},{"ref":"Option.none","text":"Option.none"},{"ref":"ite","text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder","source":{"first_line":32,"last_line":37}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"Init.Prelude","name":"Option","source":{"first_line":3047,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlString","source":{"first_line":48,"last_line":54}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlStringBuilder.as_basic_pretty","source":{"first_line":177,"last_line":194}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"Init.Prelude","name":"ite","source":{"first_line":1324,"last_line":1346}},{"module":"Init.Prelude","name":"And","source":{"first_line":645,"last_line":659}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape_codes","source":{"first_line":28,"last_line":28}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder.metrics","source":{"first_line":37,"last_line":37}},{"module":"Init.Prelude","name":"Bool.false","source":{"first_line":108,"last_line":109}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape","source":{"first_line":29,"last_line":29}},{"module":"Init.Prelude","name":"Nat","source":{"first_line":1349,"last_line":1371}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalar.val","source":{"first_line":76,"last_line":76}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalarTy.U8","source":{"first_line":33,"last_line":33}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.max_seq_double_quotes","source":{"first_line":27,"last_line":27}},{"module":"Init.Prelude","name":"OfNat.ofNat","source":{"first_line":1393,"last_line":1393}},{"module":"Init.Prelude","name":"instOfNatNat","source":{"first_line":1395,"last_line":1397}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.newline","source":{"first_line":30,"last_line":30}},{"module":"Init.Prelude","name":"instDecidableAnd","source":{"first_line":1239,"last_line":1245}},{"module":"Init.Prelude","name":"instDecidableEqBool","source":{"first_line":1280,"last_line":1281}},{"module":"Init.Prelude","name":"instDecidableEqNat","source":{"first_line":1995,"last_line":1995}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","source":{"first_line":8,"last_line":10}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.BasicString","source":{"first_line":44,"last_line":44}},{"module":"Init.Prelude","name":"Option.none","source":{"first_line":3055,"last_line":3056}}],"definitions_truncated":false,"first_line":48,"last_line":56,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlStringBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} toml_write.string.TomlString))\n    (toml_write.string.TomlStringBuilder.as_basic_pretty builder)\n    (@Aeneas.Std.Result.ok.{0} (Option.{0} toml_write.string.TomlString)\n      (@ite.{1} (Option.{0} toml_write.string.TomlString)\n        (And\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)\n            (And\n              (@Eq.{1} Nat\n                (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                  (toml_write.string.ValueMetrics.max_seq_double_quotes\n                    (toml_write.string.TomlStringBuilder.metrics builder)))\n                (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n              (@Eq.{1} Bool\n                (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n                Bool.false))))\n        (@instDecidableAnd\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)\n            (And\n              (@Eq.{1} Nat\n                (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                  (toml_write.string.ValueMetrics.max_seq_double_quotes\n                    (toml_write.string.TomlStringBuilder.metrics builder)))\n                (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n              (@Eq.{1} Bool\n                (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n                Bool.false)))\n          (instDecidableEqBool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (@instDecidableAnd\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)\n            (And\n              (@Eq.{1} Nat\n                (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                  (toml_write.string.ValueMetrics.max_seq_double_quotes\n                    (toml_write.string.TomlStringBuilder.metrics builder)))\n                (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n              (@Eq.{1} Bool\n                (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n                Bool.false))\n            (instDecidableEqBool\n              (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder)) Bool.false)\n            (@instDecidableAnd\n              (@Eq.{1} Nat\n                (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                  (toml_write.string.ValueMetrics.max_seq_double_quotes\n                    (toml_write.string.TomlStringBuilder.metrics builder)))\n                (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n              (@Eq.{1} Bool\n                (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n                Bool.false)\n              (instDecidableEqNat\n                (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                  (toml_write.string.ValueMetrics.max_seq_double_quotes\n                    (toml_write.string.TomlStringBuilder.metrics builder)))\n                (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))))\n              (instDecidableEqBool\n                (toml_write.string.ValueMetrics.newline (toml_write.string.TomlStringBuilder.metrics builder))\n                Bool.false))))\n        (@Option.some.{0} toml_write.string.TomlString\n          (_private.BuilderProofs.0.TomlWriteVerification.stringResult builder toml_write.string.Encoding.BasicString))\n        (@Option.none.{0} toml_write.string.TomlString)))","theorem":"TomlWriteVerification.string_basic_pretty","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Classical.choice","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlStringBuilder","type_segments":[{"ref":"toml_write.string.TomlStringBuilder","text":"toml_write.string.TomlStringBuilder"}]}],"conclusion":"builder.as_ml_basic_pretty =\n  Aeneas.Std.Result.ok\n    (if\n        builder.metrics.escape_codes = Bool.false ∧\n          builder.metrics.escape = Bool.false ∧ ↑builder.metrics.max_seq_double_quotes ≤ 2 then\n      Option.some (TomlWriteVerification.stringResult✝ builder toml_write.string.Encoding.MlBasicString)\n    else Option.none)","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.as_ml_basic_pretty","text":"as_ml_basic_pretty"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":"\n    "},{"ref":"ite","text":"("},{"ref":"ite","text":"if\n        "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape_codes","text":"escape_codes"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧\n          "},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.escape","text":"escape"},{"ref":"Eq","text":" = "},{"ref":"Bool.false","text":"Bool.false"},{"ref":"And","text":" ∧ "},{"text":"↑"},{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlStringBuilder.metrics","text":"metrics"},{"text":"."},{"ref":"toml_write.string.ValueMetrics.max_seq_double_quotes","text":"max_seq_double_quotes"},{"ref":"LE.le","text":" ≤ "},{"text":"2"},{"ref":"ite","text":" then"},{"ref":"ite","text":"\n      "},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","text":"TomlWriteVerification.stringResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"ref":"toml_write.string.Encoding.MlBasicString","text":"toml_write.string.Encoding.MlBasicString"},{"text":")"},{"ref":"ite","text":"\n    "},{"ref":"ite","text":"else "},{"ref":"Option.none","text":"Option.none"},{"ref":"ite","text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder","source":{"first_line":32,"last_line":37}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"Init.Prelude","name":"Option","source":{"first_line":3047,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlString","source":{"first_line":48,"last_line":54}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlStringBuilder.as_ml_basic_pretty","source":{"first_line":208,"last_line":222}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"Init.Prelude","name":"ite","source":{"first_line":1324,"last_line":1346}},{"module":"Init.Prelude","name":"And","source":{"first_line":645,"last_line":659}},{"module":"Init.Prelude","name":"Bool","source":{"first_line":99,"last_line":111}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape_codes","source":{"first_line":28,"last_line":28}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlStringBuilder.metrics","source":{"first_line":37,"last_line":37}},{"module":"Init.Prelude","name":"Bool.false","source":{"first_line":108,"last_line":109}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.escape","source":{"first_line":29,"last_line":29}},{"module":"Init.Prelude","name":"LE.le","source":{"first_line":1402,"last_line":1402}},{"module":"Init.Prelude","name":"Nat","source":{"first_line":1349,"last_line":1371}},{"module":"Init.Prelude","name":"instLENat","source":{"first_line":2026,"last_line":2027}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalar.val","source":{"first_line":76,"last_line":76}},{"module":"Aeneas.Std.Scalar.Core","name":"Aeneas.Std.UScalarTy.U8","source":{"first_line":33,"last_line":33}},{"module":"TomlWrite.Types","name":"toml_write.string.ValueMetrics.max_seq_double_quotes","source":{"first_line":27,"last_line":27}},{"module":"Init.Prelude","name":"OfNat.ofNat","source":{"first_line":1393,"last_line":1393}},{"module":"Init.Prelude","name":"instOfNatNat","source":{"first_line":1395,"last_line":1397}},{"module":"Init.Prelude","name":"instDecidableAnd","source":{"first_line":1239,"last_line":1245}},{"module":"Init.Prelude","name":"instDecidableEqBool","source":{"first_line":1280,"last_line":1281}},{"module":"Init.Prelude","name":"Nat.decLe","source":{"first_line":2196,"last_line":2212}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.stringResult","source":{"first_line":8,"last_line":10}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.MlBasicString","source":{"first_line":46,"last_line":46}},{"module":"Init.Prelude","name":"Option.none","source":{"first_line":3055,"last_line":3056}}],"definitions_truncated":false,"first_line":58,"last_line":65,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlStringBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} (Option.{0} toml_write.string.TomlString))\n    (toml_write.string.TomlStringBuilder.as_ml_basic_pretty builder)\n    (@Aeneas.Std.Result.ok.{0} (Option.{0} toml_write.string.TomlString)\n      (@ite.{1} (Option.{0} toml_write.string.TomlString)\n        (And\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)\n            (@LE.le.{0} Nat instLENat\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_double_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2))))))\n        (@instDecidableAnd\n          (@Eq.{1} Bool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (And\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)\n            (@LE.le.{0} Nat instLENat\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_double_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2)))))\n          (instDecidableEqBool\n            (toml_write.string.ValueMetrics.escape_codes (toml_write.string.TomlStringBuilder.metrics builder))\n            Bool.false)\n          (@instDecidableAnd\n            (@Eq.{1} Bool (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder))\n              Bool.false)\n            (@LE.le.{0} Nat instLENat\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_double_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2))))\n            (instDecidableEqBool\n              (toml_write.string.ValueMetrics.escape (toml_write.string.TomlStringBuilder.metrics builder)) Bool.false)\n            (Nat.decLe\n              (@Aeneas.Std.UScalar.val Aeneas.Std.UScalarTy.U8\n                (toml_write.string.ValueMetrics.max_seq_double_quotes\n                  (toml_write.string.TomlStringBuilder.metrics builder)))\n              (@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2))))))\n        (@Option.some.{0} toml_write.string.TomlString\n          (_private.BuilderProofs.0.TomlWriteVerification.stringResult builder\n            toml_write.string.Encoding.MlBasicString))\n        (@Option.none.{0} toml_write.string.TomlString)))","theorem":"TomlWriteVerification.string_ml_basic_pretty","translation_rerun":false,"version":1}
proofs.rs:formal:{"axioms":["propext","Quot.sound"],"binders":[{"binder":"explicit","kind":"variable","name":"builder","type":"toml_write.string.TomlKeyBuilder","type_segments":[{"ref":"toml_write.string.TomlKeyBuilder","text":"toml_write.string.TomlKeyBuilder"}]}],"conclusion":"builder.as_basic =\n  Aeneas.Std.Result.ok (TomlWriteVerification.keyResult✝ builder (Option.some toml_write.string.Encoding.BasicString))","conclusion_segments":[{"text":"builder"},{"text":"."},{"ref":"toml_write.string.TomlKeyBuilder.as_basic","text":"as_basic"},{"ref":"Eq","text":" =\n  "},{"ref":"Aeneas.Std.Result.ok","text":"Aeneas.Std.Result.ok"},{"text":" "},{"text":"("},{"ref":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","text":"TomlWriteVerification.keyResult✝"},{"text":" "},{"text":"builder"},{"text":" "},{"text":"("},{"ref":"Option.some","text":"Option.some"},{"text":" "},{"ref":"toml_write.string.Encoding.BasicString","text":"toml_write.string.Encoding.BasicString"},{"text":")"},{"text":")"}],"definitions":[{"module":"TomlWrite.Types","name":"toml_write.string.TomlKeyBuilder","source":{"first_line":65,"last_line":70}},{"module":"Init.Prelude","name":"Eq","source":{"first_line":46,"last_line":76}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result","source":{"first_line":67,"last_line":68}},{"module":"TomlWrite.Types","name":"toml_write.string.TomlKey","source":{"first_line":72,"last_line":77}},{"module":"TomlWrite.Funs","name":"toml_write.string.TomlKeyBuilder.as_basic","source":{"first_line":431,"last_line":437}},{"module":"Aeneas.Std.Primitives","name":"Aeneas.Std.Result.ok","source":{"first_line":72,"last_line":72}},{"module":"BuilderProofs","name":"_private.BuilderProofs.0.TomlWriteVerification.keyResult","source":{"first_line":12,"last_line":14}},{"module":"Init.Prelude","name":"Option.some","source":{"first_line":3057,"last_line":3058}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding","source":{"first_line":39,"last_line":46}},{"module":"TomlWrite.Types","name":"toml_write.string.Encoding.BasicString","source":{"first_line":44,"last_line":44}}],"definitions_truncated":false,"first_line":67,"last_line":68,"module":"BuilderProofs","program":null,"program_head":null,"statement":"∀ (builder : toml_write.string.TomlKeyBuilder),\n  @Eq.{1} (Aeneas.Std.Result.{0} toml_write.string.TomlKey) (toml_write.string.TomlKeyBuilder.as_basic builder)\n    (@Aeneas.Std.Result.ok.{0} toml_write.string.TomlKey\n      (_private.BuilderProofs.0.TomlWriteVerification.keyResult builder\n        (@Option.some.{0} toml_write.string.Encoding toml_write.string.Encoding.BasicString)))","theorem":"TomlWriteVerification.key_basic","translation_rerun":false,"version":1}

=== stderr ===
Environment

The selected scope is the toml_write 0.1.2 release and the aarch64-apple-darwin
target with default features. The managed run and named-theorem and transitive-axiom audit are documented in the profile's results.md. The proof uses unpatched Aeneas
and Charon. The cargo-proofs CLI carries a preparation patch to stage pinned sources
and proof inputs, including in its isolated checkout. A second recorder patch parses
finding entries and corrects API discovery for lifetime-only inherent implementations
and cfg(doctest) items excluded from the library target. These CLI patches are
separate from Aeneas and Charon; their sources and checks are recorded in
toolchain.lock.json and the profile's patches directory. Native tests also ran
with default, no-default, and alloc-only features; those tests are separate from the
formal results.

What is trusted

The statements concern Aeneas translations of the selected Rust bodies and rely
on the translation, Rust and standard-library models, and Lean's kernel. For the key and string
scans, the supplied models of str::as_bytes and str::is_empty assume that the
immutable byte slice is exactly the input string's modeled bytes and that emptiness
agrees with that byte sequence. Rust's str supplies the UTF-8 validity guarantee;
the Lean string model itself is a byte sequence. These operations are not proved
against the Rust standard library here. For release default methods, relating the
original Option::or_else and unwrap_or_else closure behavior to the mathematical
option chain is a reviewed semantic assumption; the closures were not extracted.
The pure option-chain equivalences themselves are checked in Lean.

Technical limitations

The bounded string-constructor success statement excludes quote runs longer than
255; the complementary failure theorem uses checked arithmetic. Native release
profile behavior differs, as described in the finding. Writing or serializing TOML
output remains outside the selected theorems, so they do not establish valid TOML
output or end-to-end panic freedom. In particular, the formatting model does not
retain the argument text needed to prove the writer's output.

The two default-method bodies are verified on an adaptation, separately from the
12 mapped original release APIs. The patch replaces the lazy option chains with
ordered early-return branches and renames the encoding enum through an alias for
generated Lean compatibility. The independent review relates each branch and
fallback to the original lazy chain, but no extracted release-closure equivalence
theorem is claimed. A native differential check compares all 32 key and 524,288
string cached-metric states with one fixed decoded string; it supplements rather
than replaces that semantic correspondence. Other selected Rust bodies are unchanged
from the pinned release.

Tool limitations

Lean backend only, requiring cargo-proofs 0.4.0 or later. The version identifies the official Aeneas Git revision pinned in lake-manifest.json (backends/lean); this revision uses Lean 4.35.0. The recorder checks committed Lean theorem declarations and permits only propext, Classical.choice, and Quot.sound as transitive axioms. It rejects sorryAx and custom axioms, including axiomatized external models. Charon/Aeneas extraction is not rerun. The author must review that the committed functional model matches the recorded Rust source, that the named theorem corresponds to the public API, and that the reported precondition matches the theorem. A checked theorem alone does not establish those links or the adequacy of the specification. The current adapter records the default Cargo configuration, with ordinary Lean module paths and a pinned official Git dependency. Other backends, custom Lake source directories, and local-path Aeneas dependencies are unsupported. See https://proofs.rs/book/aeneas.html and https://github.com/AeneasVerif/aeneas/tree/be86ab0f1989d04944292b345b24c435be3ad10a.

Updated 2026-10-16 00:00 UTC

Aeneas be86ab0f1989d04944292b345b24c435be3ad10a — version details

Dependencies (3)

CrateReports
proptest ^1.6.0 · dev—
snapbox ^0.6.0 · dev—
toml ^0.5.10 · dev—

Comments (0)

No comments.

Sign in to comment.