add Hole and Template skeleton
This commit is contained in:
@@ -275,7 +275,8 @@ Only the existing statement will be available in later levels:
|
||||
let thmStatement ← `(theorem $(mkIdent defaultDeclName) $sig $val)
|
||||
elabCommand thmStatement
|
||||
else
|
||||
let thmStatement ← `(theorem $(mkIdent name.getId) $sig $val)
|
||||
-- logInfo attr
|
||||
let thmStatement ← `( theorem $(mkIdent name.getId) $sig $val)
|
||||
elabCommand thmStatement
|
||||
| none =>
|
||||
let thmStatement ← `(theorem $(mkIdent defaultDeclName) $sig $val)
|
||||
@@ -420,6 +421,39 @@ elab "Branch" t:tacticSeq : tactic => do
|
||||
|
||||
|
||||
|
||||
/-- The tactic block inside `Template` will be copied into the users editor.
|
||||
Use `Hole` inside the template for a part of the proof that should be replaced
|
||||
with `sorry`. -/
|
||||
elab "Template" t:tacticSeq : tactic => do
|
||||
--let b ← saveState
|
||||
Tactic.evalTactic t
|
||||
|
||||
-- -- Not correct
|
||||
-- let gs ← Tactic.getUnsolvedGoals
|
||||
-- if ¬ gs.isEmpty then
|
||||
-- logWarning "To work as intended, `Template` should contain the entire proof"
|
||||
|
||||
|
||||
-- -- Show an info whether the branch proofs all remaining goals.
|
||||
-- let gs ← Tactic.getUnsolvedGoals
|
||||
-- if gs.isEmpty then
|
||||
-- logInfo "This branch finishes the proof."
|
||||
-- else
|
||||
-- logInfo "This branch leaves open goals."
|
||||
|
||||
-- let msgs ← Core.getMessageLog
|
||||
-- b.restore
|
||||
-- Core.setMessageLog msgs
|
||||
|
||||
|
||||
/-- A hole inside a template proof that will be replaced by `sorry`. -/
|
||||
elab "Hole" t:tacticSeq : tactic => do
|
||||
Tactic.evalTactic t
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/-! # Make Game -/
|
||||
|
||||
def GameLevel.getInventory (level : GameLevel) : InventoryType → InventoryInfo
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ wss.addListener("connection", function(ws, req) {
|
||||
});
|
||||
|
||||
console.log(`[${new Date()}] Number of open sockets - ${socketCounter}`)
|
||||
console.log(`[${new Date()}] Free RAM - ${Math.round(os.freemem() / 1024 / 1024)} / ${Math.round(os.totalmem() / 1024 / 1024)} GB`)
|
||||
console.log(`[${new Date()}] Free RAM - ${Math.round(os.freemem() / 1024 / 1024)} / ${Math.round(os.totalmem() / 1024 / 1024)} MB`)
|
||||
|
||||
ws.on('close', () => {
|
||||
console.log(`[${new Date()}] Socket closed - ${ip}`)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import GameServer.Commands
|
||||
--import
|
||||
|
||||
Game "Test"
|
||||
World "TestW"
|
||||
@@ -6,5 +7,21 @@ Level 1
|
||||
|
||||
LemmaDoc add_zero as "add_zero" in "Nat" "(nothing)"
|
||||
|
||||
Statement add_zero (attr := simp, to_additive) "test" (n : Nat) : n + 0 = n := by
|
||||
rfl
|
||||
@[simp] Statement add_zero "test" (n : Nat) : n + n = n := by
|
||||
sorry
|
||||
|
||||
Statement (n : Nat) : 0 + n = n := by
|
||||
Template
|
||||
induction n
|
||||
Hole
|
||||
simp
|
||||
simp
|
||||
|
||||
NewLemma add_zero
|
||||
|
||||
--attribute [simp] add_zero
|
||||
|
||||
#print add_zero
|
||||
|
||||
theorem xy (n : Nat) : n + n = n := by
|
||||
simp
|
||||
|
||||
Reference in New Issue
Block a user