0
下面是一个简单的语言的定义:如何从归纳式声明中给出它的结论的假设?
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
我的表达式定义一个打字的功能。我试图证明,如果And-expression有一个Bool Type,那么它的两个参数都有Bool Type。这是从理论上回归AndTyping规则。
你能否建议如何证明这个引理? Isar没有证明吗?