diff --git a/server/leanserver/GameServer/Commands.lean b/server/leanserver/GameServer/Commands.lean index 301f744..1030396 100644 --- a/server/leanserver/GameServer/Commands.lean +++ b/server/leanserver/GameServer/Commands.lean @@ -114,9 +114,9 @@ elab "Branch" t:tacticSeq : tactic => do Arguments: - ident: (Optional) The name of the statemtent. -- descr: The human-readable version of the lemma as string. Accepts Markdown and Mathjax. +- descr: (Optional) The human-readable version of the lemma as string. Accepts Markdown and Mathjax. -/ -elab "Statement" statementName:ident ? descr:str sig:declSig val:declVal : command => do +elab "Statement" statementName:ident ? descr:str ? sig:declSig val:declVal : command => do let lvlIdx ← getCurLevelIdx let defaultDeclName : Name := (← getCurGame).name ++ (← getCurWorld).name ++ @@ -166,7 +166,9 @@ elab "Statement" statementName:ident ? descr:str sig:declSig val:declVal : comma module := env.header.mainModule goal := sig, scope := scope, - descrText := descr.getString, + descrText := match descr with + | none => "" + | some s => s.getString descrFormat := match statementName with | none => "example " ++ (toString <| reprint sig.raw) ++ " := by" | some name => (Format.join ["lemma ", reprint name.raw, " ", reprint sig.raw, " := by"]).pretty 10 -- "lemma " ++ (toString <| reprint name.raw) ++ " " ++ (Format.pretty (reprint sig.raw) 40) ++ " := by" diff --git a/server/testgame/TestGame/Levels/Implication/L01_Intro.lean b/server/testgame/TestGame/Levels/Implication/L01_Intro.lean index 75f0f80..ffedd93 100644 --- a/server/testgame/TestGame/Levels/Implication/L01_Intro.lean +++ b/server/testgame/TestGame/Levels/Implication/L01_Intro.lean @@ -14,8 +14,15 @@ Introduction **Operationsleiter**: Sagt mal, könnt ihr mir hier weiterhelfen? " -Statement "" (A B : Prop) (hb : B) : A → (A ∧ B) := by +Statement (A B : Prop) (hb : B) : A → (A ∧ B) := by + Hint "**Du**: Einen Moment, das ist eine Implikation (`\\to`), + also `A` impliziert `A und B`, soweit so gut, also eine Tautologie. + + **Robo**: Die scheinen hier `tauto` auch nicht zu verstehen. + Implikationen kannst du aber mit `intro h` angehen." intro hA + Hint "**Du**: Jetzt habe ich also angenommen, dass `A` wahr ist und muss `A ∧ B` zeigen, + das kennen wir ja schon." constructor assumption assumption @@ -23,15 +30,4 @@ Statement "" (A B : Prop) (hb : B) : A → (A ∧ B) := by NewTactic intro DisabledTactic tauto -Hint (A : Prop) (B : Prop) (hb : B) : A → (A ∧ B) => -"**Du**: Einen Moment, das ist eine Implikation (`\\to`), -also `A` impliziert `A und B`, soweit so gut, also eine Tautologie. - -**Robo**: Die scheinen hier `tauto` auch nicht zu verstehen. -Implikationen kannst du aber mit `intro h` angehen." - -Hint (A : Prop) (B : Prop) (ha : A) (hb : B) : (A ∧ B) => -"**Du**: Jetzt habe ich also angenommen, dass `A` wahr ist und muss `A ∧ B` zeigen, -das kennen wir ja schon." - Conclusion "Der Operationsleiter nickt bedacht." diff --git a/server/testgame/TestGame/Levels/Implication/L02_Revert.lean b/server/testgame/TestGame/Levels/Implication/L02_Revert.lean index f66aeda..03551fb 100644 --- a/server/testgame/TestGame/Levels/Implication/L02_Revert.lean +++ b/server/testgame/TestGame/Levels/Implication/L02_Revert.lean @@ -11,23 +11,19 @@ Title "Revert" Introduction "Jemand aus der Gruppe gibt dir ein Blatt Papier mit einer Zeile Text:" -Statement -"" - (A B : Prop) (ha : A) (h : A → B) : B := by +Statement "" (A B : Prop) (ha : A) (h : A → B) : B := by + Hint "**Robo**: Mit `revert {ha}` kann man die Annahme `ha` als + Implikationsprämisse vorne ans Goal anhängen, dann ist das Goal `{A} → {B}`. + + **Du**: Das wirkt etwas unnatürlich. + + **Robo**: Schon, ja. Aber als Tool kann das manchmal nützlich sein." revert ha assumption NewTactic revert DisabledTactic tauto -Hint (A : Prop) (B : Prop) (ha : A) (h : A → B) : B => -"**Robo**: Mit `revert {ha}` kann man die Annahme `ha` als -Implikationsprämisse vorne ans Goal anhängen, dann ist das Goal `{A} → {B}`. - -**Du**: Das wirkt etwas unnatürlich. - -**Robo**: Schon, ja. Aber als Tool kann das manchmal nützlich sein." - Conclusion "**Du**: Aber das müsste doch auch anders gehen, ich hätte jetzt intuitiv die Implikation $A \\Rightarrow B$ angewendet und behauptet, dass es genügt $A$ zu zeigen…