Hier ist eine Definition einer einfachen Sprache:Wie kann man eine Annahme beweisen, wenn man von einer induktiven Deklaration ausgeht?
theory SimpleLang
imports Main
begin
type_synonym vname = "string"
datatype exp = BConst bool | IConst int | Let vname exp exp | Var vname | And exp exp
datatype type = BType | IType
type_synonym tenv = "vname ⇒ type option"
inductive typing :: "tenv ⇒ exp ⇒ type ⇒ bool"
("(1_/ ⊢/ (_ :/ _))" [50,0,50] 50) where
BConstTyping: "Γ ⊢ BConst c : BType" |
IConstTyping: "Γ ⊢ IConst c : IType" |
LetTyping: "⟦Γ ⊢ init : t1; Γ(var ↦ t1) ⊢ body : t⟧ ⟹ Γ ⊢ Let var init body : t" |
VarTyping: "Γ var = Some t ⟹ Γ ⊢ Var var : t" |
AndTyping: "⟦Γ ⊢ a : BType; Γ ⊢ b : BType⟧ ⟹ Γ ⊢ And a b : BType"
lemma AndTypingRev:
"Γ ⊢ And a b : BType ⟹ Γ ⊢ a : BType ∧ Γ ⊢ b : BType"
end
ich für Ausdrücke eine Eingabe-Funktion definiert. Und ich versuche zu beweisen, dass, wenn And-Ausdruck einen Bool-Typ hat, beide Argumente auch Bool-Typ haben. Es ist eine Umkehrung der AndTyping-Regel aus der Theorie.
Können Sie vorschlagen, wie Sie dieses Lemma beweisen? Kann es ohne Isar bewiesen werden?