feat: Add extract dependency graph
This commit is contained in:
parent
b50efa91f7
commit
0214c166b5
5 changed files with 119 additions and 0 deletions
|
@ -120,6 +120,7 @@ macro "informal_lemma " name:ident " where " assignments:informalAssignment* : c
|
|||
unless math_def?.isSome do
|
||||
Macro.throwError "A 'math' assignments is required"
|
||||
`(
|
||||
|
||||
/-- An informal lemma. -/
|
||||
def $name : InformalLemma := {
|
||||
name := $(Lean.quote name.getId),
|
||||
|
@ -130,4 +131,22 @@ def $name : InformalLemma := {
|
|||
dependencies := $(dep_def?.getD (← `([])))
|
||||
})
|
||||
|
||||
def isInformal (c : ConstantInfo) : Bool :=
|
||||
match c with
|
||||
| ConstantInfo.defnInfo c =>
|
||||
if c.type.isAppOf ``InformalDefinition ∨ c.type.isAppOf ``InformalLemma then true else false
|
||||
| _ => false
|
||||
|
||||
def isInformalLemma (c : ConstantInfo) : Bool :=
|
||||
match c with
|
||||
| ConstantInfo.defnInfo c =>
|
||||
if c.type.isAppOf ``InformalLemma then true else false
|
||||
| _ => false
|
||||
|
||||
def isInformalDef (c : ConstantInfo) : Bool :=
|
||||
match c with
|
||||
| ConstantInfo.defnInfo c =>
|
||||
if c.type.isAppOf ``InformalDefinition then true else false
|
||||
| _ => false
|
||||
|
||||
end Informal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue