feat(frontends/lean): add "premise" and "premises" command

It is just an alternative notation for "variable" and "variables"

closes #429
This commit is contained in:
Leonardo de Moura 2015-02-11 18:46:03 -08:00
parent 30d20e8029
commit 8ffadce4ab
3 changed files with 13 additions and 2 deletions

View file

@ -10,7 +10,8 @@
(defconst lean-keywords
'("import" "prelude" "tactic_hint" "protected" "private" "opaque" "definition" "renaming"
"hiding" "exposing" "parameter" "parameters" "begin" "proof" "qed" "conjecture" "constant" "constants"
"hypothesis" "lemma" "corollary" "variable" "variables" "print" "theorem" "example" "abbreviation"
"hypothesis" "lemma" "corollary" "variable" "variables" "premise" "premises"
"print" "theorem" "example" "abbreviation"
"context" "open" "as" "export" "axiom" "inductive" "with" "structure" "record" "universe" "universes"
"alias" "help" "environment" "options" "precedence" "reserve" "postfix" "prefix"
"calc_trans" "calc_subst" "calc_refl" "calc_symm" "match"

View file

@ -102,7 +102,8 @@ void init_token_table(token_table & t) {
{g_qed_unicode, "qed"}, {nullptr, nullptr}};
pair<char const *, char const *> cmd_aliases[] =
{{"lemma", "theorem"}, {"corollary", "theorem"}, {"hypothesis", "parameter"}, {"conjecture", "parameter"},
{{"lemma", "theorem"}, {"premise", "variable"}, {"premises", "variables"},
{"corollary", "theorem"}, {"hypothesis", "parameter"}, {"conjecture", "parameter"},
{"record", "structure"}, {nullptr, nullptr}};
auto it = builtin;

View file

@ -0,0 +1,9 @@
variable a : Prop
variables b c : Prop
premise Ha : a
premises (Hb : b) (Hc : c)
theorem tst : a ∧ b ∧ c :=
and.intro Ha (and.intro Hb Hc)
check tst