Documentation

Cedar.Thm.Validation.Typechecker.UnaryApp

This file proves that typechecking of .unaryApp expressions is sound.

theorem Cedar.Thm.type_of_like_is_sound {x₁ : Spec.Expr} {p : Spec.Pattern} {c₁ c₂ : Validation.Capabilities} {env : Validation.TypeEnv} {ty : Validation.TypedExpr} {request : Spec.Request} {entities : Spec.Entities} (h₁ : CapabilitiesInvariant c₁ request entities) (h₂ : InstanceOfWellFormedEnvironment request entities env) (h₃ : Validation.typeOf (Spec.Expr.unaryApp (Spec.UnaryOp.like p) x₁) c₁ env = Except.ok (ty, c₂)) (ih : TypeOfIsSound x₁) :
theorem Cedar.Thm.type_of_is_is_sound {x₁ : Spec.Expr} {ety : Spec.EntityType} {c₁ c₂ : Validation.Capabilities} {env : Validation.TypeEnv} {ty : Validation.TypedExpr} {request : Spec.Request} {entities : Spec.Entities} (h₁ : CapabilitiesInvariant c₁ request entities) (h₂ : InstanceOfWellFormedEnvironment request entities env) (h₃ : Validation.typeOf (Spec.Expr.unaryApp (Spec.UnaryOp.is ety) x₁) c₁ env = Except.ok (ty, c₂)) (ih : TypeOfIsSound x₁) :
theorem Cedar.Thm.type_of_unaryApp_is_sound {op₁ : Spec.UnaryOp} {x₁ : Spec.Expr} {c₁ c₂ : Validation.Capabilities} {env : Validation.TypeEnv} {ty : Validation.TypedExpr} {request : Spec.Request} {entities : Spec.Entities} (h₁ : CapabilitiesInvariant c₁ request entities) (h₂ : InstanceOfWellFormedEnvironment request entities env) (h₃ : Validation.typeOf (Spec.Expr.unaryApp op₁ x₁) c₁ env = Except.ok (ty, c₂)) (ih : TypeOfIsSound x₁) :
GuardedCapabilitiesInvariant (Spec.Expr.unaryApp op₁ x₁) c₂ request entities (v : Spec.Value), EvaluatesTo (Spec.Expr.unaryApp op₁ x₁) request entities v InstanceOfType env v ty.typeOf