INNER CODE UNIT · Python

program

lean-dojo/TorchLean · torchlean/__init__.py:187

def program : NN.IR.Program :=
  (Import.IR.parseProgram artifact).toOption.get (by decide +kernel)

/-- The program is the importer's result for this exact artifact. -/
theorem program_imported : Import.IR.parseProgram artifact = .ok program := by
  have success : (Import.IR.parseProgram artifact).toOption.isSome := by decide +kernel
  cases h : Import.IR.parseProgram artifact with
  | error message => simp [h, Except.toOption] at success
  | ok value => simp [program, h, Except.toOption]

/-- The imported program passes the shared shape, type and interface checks. -/
theorem program_checked : program.check = .ok () :=
  Import.IR.parseProgram_checked program_imported

end «{path.stem}»
'''
    path.parent.mkdir(parents=True, exist_ok=True)
    # An export may become a hand-written proof file. Never replace it on recapture.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…