Skip to content

Commit

Permalink
Add utility definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatolay committed Aug 16, 2024
1 parent 8df79f0 commit 76e3b49
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Extended/Reduction/Parallel/Definition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,29 @@ inductive PReduce : Ctx β†’ Term β†’ Term β†’ Type where
β†’ PReduce ctx glob glob

end

def PReducesTo (t t' : Term) := PReduce {glob := t, scope := t} t t'
def PReducesToMany := ReflTransGen PReducesTo

infix:20 " ⇛ " => PReducesTo
infix:20 " ⇛* " => PReducesToMany

def get_form_premise
{attrs : List Attr}
{ρ : Option Term}
{bnds bnds' : Bindings attrs}
{ctx : Ctx}
(preduce : PReduce ctx (obj ρ bnds) (obj ρ bnds'))
: FormationPremise {glob := ctx.glob, scope := obj ρ bnds} bnds bnds'
:= match preduce with
| .pr_cong_obj premise => premise

def get_application_premise
{attrs : List Attr}
{t : Term}
{apps apps' : Record Term attrs}
{ctx : Ctx}
(preduce : PReduce ctx (app t apps) (app t apps'))
: ApplicationPremise ctx apps apps'
:= match preduce with
| .pr_cong_app premise _ => premise
7 changes: 7 additions & 0 deletions Extended/Reduction/Regular/Definition.lean
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,10 @@ inductive Reduce : Ctx β†’ Term β†’ Term β†’ Type where
{glob := g, scope := l}
(obj ρ bnds)
(obj ρ (Record.insert bnds attr t'))


def ReducesTo (t t' : Term) := Reduce {glob := t, scope := t} t t'
def ReducesToMany := ReflTransGen ReducesTo

infix:20 " ⇝ " => ReducesTo
infix:20 " ⇝* " => ReducesToMany

0 comments on commit 76e3b49

Please sign in to comment.