feat: Add extract dependency graph

This commit is contained in:
jstoobysmith 2024-09-16 07:40:15 -04:00
parent b50efa91f7
commit 0214c166b5
5 changed files with 119 additions and 0 deletions

View file

@ -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