Missing proofs in code #6

Closed
opened 2023-08-23 13:27:41 -07:00 by aniva · 2 comments
Owner

Intuitively this terminates (in Serial.lean)

def serialize_sort_level_ast (level: Level): String :=
  let k := level.getOffset
  let u := level.getLevelOffset
  let u_str := match u with
    | .zero => "0"
    | .succ _ => panic! "getLevelOffset should not return .succ"
    | .max v w | .imax v w =>
      let v := serialize_sort_level_ast v
      let w := serialize_sort_level_ast w
      s!"(max {v} {w})"
    | .param name =>
      let name := name_to_ast name
      s!"{name}"
    | .mvar id =>
      let name := name_to_ast id.name
      s!"(:mvar {name})"
  match k, u with
  | 0, _ => u_str
  | _, .zero => s!"{k}"
  | _, _ => s!"(+ {u_str} {k})"
  termination_by serialize_sort_level_ast level => level_depth level
  decreasing_by
  . sorry

but Lean cannot show it automatically

Intuitively this terminates (in `Serial.lean`) ```lean def serialize_sort_level_ast (level: Level): String := let k := level.getOffset let u := level.getLevelOffset let u_str := match u with | .zero => "0" | .succ _ => panic! "getLevelOffset should not return .succ" | .max v w | .imax v w => let v := serialize_sort_level_ast v let w := serialize_sort_level_ast w s!"(max {v} {w})" | .param name => let name := name_to_ast name s!"{name}" | .mvar id => let name := name_to_ast id.name s!"(:mvar {name})" match k, u with | 0, _ => u_str | _, .zero => s!"{k}" | _, _ => s!"(+ {u_str} {k})" termination_by serialize_sort_level_ast level => level_depth level decreasing_by . sorry ``` but Lean cannot show it automatically
aniva added the
part/Serial
label 2023-08-23 13:27:41 -07:00
aniva self-assigned this 2023-08-23 13:27:41 -07:00
aniva added the
priority
low
label 2023-08-23 13:28:11 -07:00
aniva changed title from The termination of `Lean.Level` serialization is not ensured to Missing proofs in code 2023-08-30 19:19:11 -07:00
Author
Owner

Now we have a newcomer: Most functions in SemihashMap.lean don't have proofs either. They should be relatively easy to prove.

Now we have a newcomer: Most functions in `SemihashMap.lean` don't have proofs either. They should be relatively easy to prove.
aniva added this to the 0.2.6 milestone 2023-08-30 19:20:09 -07:00
aniva modified the milestone from 0.2.6 to 0.3 2023-10-28 16:38:40 -07:00
Author
Owner

serialize_sort_level_ast is marked with partial for now and SemihashMap.lean is removed since HashMap was added to Lean's library.

`serialize_sort_level_ast` is marked with `partial` for now and `SemihashMap.lean` is removed since `HashMap` was added to Lean's library.
aniva closed this issue 2023-11-07 16:47:48 -08:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: aniva/Pantograph#6
No description provided.