Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Sep 29, 2024
1 parent 2c2edcf commit c79830c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion equational_theories/Conjecture.lean
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ inductive EntryVariant where
structure Entry where
/-- Name of the declaration. -/
(name : Name)
/-- Lean code to be included in the extracted problem file. -/

/-- Which kind of conjecture is it? -/
(variant : EntryVariant)

initialize conjectureExtension : SimplePersistentEnvExtension Entry (Array Entry) ←
Expand Down
17 changes: 10 additions & 7 deletions equational_theories/Result.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@ open Lean Parser Elab Command

namespace Result

/--
A theorem providing an implication or negated implication to our directed graph.
-/
syntax (name := result) declModifiers "result " declId ppIndent(declSig) declVal : command

/-- An entry in the conjecture environment extension.
/-- An entry in the result environment extension.
-/
inductive EntryVariant where
| implication : Implication → EntryVariant
| nonimplication : Implication → EntryVariant
deriving Lean.ToJson, Lean.FromJson

/-- An entry in the conjecture environment extension -/
/-- An entry in the result environment extension -/
structure Entry where
/-- Name of the declaration. -/
(name : Name)

/-- Name of the file where this declaration was found. -/
(filename : String)

/-- Lean code to be included in the extracted problem file. -/
/-- Which kind of result is it? -/
(variant : EntryVariant)
deriving Lean.ToJson, Lean.FromJson

initialize resultExtension : SimplePersistentEnvExtension Entry (Array Entry) ←
registerSimplePersistentEnvExtension {
Expand All @@ -36,7 +39,7 @@ initialize resultExtension : SimplePersistentEnvExtension Entry (Array Entry)
/-- Elaborates a `result` declaration.
-/
elab_rules : command
| `(command| $dm:declModifiers result%$rs $di:declId $ds:declSig $dv:declVal) => do
| `(command| $dm:declModifiers result $di:declId $ds:declSig $dv:declVal) => do
let filename := (←read).fileName
let modifiers ← elabModifiers dm
let expanded_decl_id ← expandDeclId di modifiers
Expand Down Expand Up @@ -66,7 +69,7 @@ def extractResults {m : Type → Type} [Monad m] [MonadEnv m] [MonadError m] :
m (Array Entry) := do
return resultExtension.getState (← getEnv)

/-- Prints the contents of the conjecture environment extension.
/-- Prints the contents of the result environment extension.
-/
syntax (name := printResults) "#print_results" : command

Expand Down

0 comments on commit c79830c

Please sign in to comment.