INNER CODE UNIT · Python

artifact

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

def artifact : Lean.Json :=
  {literal}

/-- The typed program obtained from this artifact by the shared importer. -/
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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…