Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Init/Internal/Order/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ instance ReverseImplicationOrder.instOrder : PartialOrder ReverseImplicationOrde
rel_antisymm h₁ h₂ := propext ⟨h₂, h₁⟩

-- This defines a complete lattice on `Prop`, used to define coinductive predicates
def ReverseImplicationOrder.instCompleteLattice : CompleteLattice ReverseImplicationOrder where
instance ReverseImplicationOrder.instCompleteLattice : CompleteLattice ReverseImplicationOrder where
sup c := ∀ p, c p → p
sup_spec := by
intro x c
Expand Down
4 changes: 1 addition & 3 deletions src/Lean/Elab/PreDefinition/TerminationHint.lean
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,10 @@ def elabTerminationHints {m} [Monad m] [MonadError m] (stx : TSyntax ``suffix) :
| _ => pure none
else pure none
let terminationBy? : Option TerminationBy ← if let some t := t? then match t with
| `(terminationBy|termination_by partialFixpointursion) =>
pure (some {ref := t, structural := false, vars := #[], body := ⟨.missing⟩ : TerminationBy})
| `(terminationBy|termination_by $[structural%$s]? => $_body) =>
throwErrorAt t "no extra parameters bounds, please omit the `=>`"
| `(terminationBy|termination_by $[structural%$s]? $vars* => $body) =>
pure (some {ref := t, structural := s.isSome, vars, body})
pure (some {ref := t, structural := s.isSome, vars, body : TerminationBy})
| `(terminationBy|termination_by $[structural%$s]? $body:term) =>
pure (some {ref := t, structural := s.isSome, vars := #[], body})
| `(terminationBy?|termination_by?) => pure none
Expand Down
9 changes: 4 additions & 5 deletions src/Lean/Parser/Term.lean
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,10 @@ the inferrred termination measure will be suggested.

-/
@[builtin_doc] def terminationBy := leading_parser
"termination_by " >> (
(nonReservedSymbol "tailrecursion") <|>
(optional (nonReservedSymbol "structural ") >>
optional (atomic (many (ppSpace >> Term.binderIdent) >> " => ")) >>
termParser))
"termination_by " >>
optional (nonReservedSymbol "structural ") >>
optional (atomic (many (ppSpace >> Term.binderIdent) >> " => ")) >>
termParser

@[inherit_doc terminationBy, builtin_doc]
def terminationBy? := leading_parser
Expand Down
Loading