Documentation

Cedar.Thm.TPE.WellTyped.Binary

theorem Cedar.Thm.tags_if_partial_tags {env : Validation.TypeEnv} {req : Spec.Request} {es : Spec.Entities} {pes : TPE.PartialEntities} {uid : Spec.EntityUID} {tags : Data.Map Spec.Tag Spec.Value} (h_wf : InstanceOfWellFormedEnvironment req es env) (h_eref : EntitiesRefine es pes) (h_tags : pes.tags uid = some tags) :
(edata : Spec.EntityData), edata.tags = tags InstanceOfSchemaEntry uid edata env
theorem Cedar.Thm.partial_eval_well_typed_app₂_values_getTag {env : Validation.TypeEnv} {expr1 : Spec.Residual} {preq : TPE.PartialRequest} {pes : TPE.PartialEntities} {expr2 : Spec.Residual} {id₁ : Spec.EntityUID} {id₂ : String} {ty : Validation.CedarType} {req : Spec.Request} {es : Spec.Entities} :
Residual.WellTyped env (TPE.evaluate expr1 preq pes)Residual.WellTyped env (TPE.evaluate expr2 preq pes)(TPE.evaluate expr1 preq pes).asValue = some (Spec.Value.prim (Spec.Prim.entityUID id₁))(TPE.evaluate expr2 preq pes).asValue = some (Spec.Value.prim (Spec.Prim.string id₂))PEWellTyped env (Spec.Residual.binaryApp Spec.BinaryOp.getTag expr1 expr2 ty) (TPE.getTag id₁ id₂ pes ty) req preq es pes
theorem Cedar.Thm.partial_eval_well_typed_app₂_values_mem {env : Validation.TypeEnv} {expr1 : Spec.Residual} {preq : TPE.PartialRequest} {pes : TPE.PartialEntities} {expr2 : Spec.Residual} {v₁ v₂ : Spec.Value} {ty : Validation.CedarType} {req : Spec.Request} {es : Spec.Entities} :
Residual.WellTyped env (TPE.evaluate expr1 preq pes)Residual.WellTyped env (TPE.evaluate expr2 preq pes)(TPE.evaluate expr1 preq pes).asValue = some v₁(TPE.evaluate expr2 preq pes).asValue = some v₂PEWellTyped env (Spec.Residual.binaryApp Spec.BinaryOp.mem expr1 expr2 ty) (Spec.Residual.binaryApp Spec.BinaryOp.mem (TPE.evaluate expr1 preq pes) (TPE.evaluate expr2 preq pes) ty) req preq es pes
theorem Cedar.Thm.partial_eval_well_typed_app₂_values {env : Validation.TypeEnv} {expr1 : Spec.Residual} {preq : TPE.PartialRequest} {pes : TPE.PartialEntities} {expr2 : Spec.Residual} {v₁ v₂ : Spec.Value} {op : Spec.BinaryOp} {ty : Validation.CedarType} {req : Spec.Request} {es : Spec.Entities} :
Residual.WellTyped env (TPE.evaluate expr1 preq pes)Residual.WellTyped env (TPE.evaluate expr2 preq pes)(TPE.evaluate expr1 preq pes).asValue = some v₁(TPE.evaluate expr2 preq pes).asValue = some v₂PEWellTyped env (Spec.Residual.binaryApp op expr1 expr2 ty) (TPE.apply₂ op (TPE.evaluate expr1 preq pes) (TPE.evaluate expr2 preq pes) pes ty) req preq es pes
theorem Cedar.Thm.partial_eval_well_typed_app₂_nonvalues {env : Validation.TypeEnv} {expr1 : Spec.Residual} {preq : TPE.PartialRequest} {pes : TPE.PartialEntities} {expr2 : Spec.Residual} {op : Spec.BinaryOp} {ty : Validation.CedarType} {req : Spec.Request} {es : Spec.Entities} :
Residual.WellTyped env (TPE.evaluate expr1 preq pes)Residual.WellTyped env (TPE.evaluate expr2 preq pes)(TPE.evaluate expr1 preq pes).asValue = none (TPE.evaluate expr2 preq pes).asValue = nonePEWellTyped env (Spec.Residual.binaryApp op expr1 expr2 ty) (TPE.apply₂ op (TPE.evaluate expr1 preq pes) (TPE.evaluate expr2 preq pes) pes ty) req preq es pes
theorem Cedar.Thm.partial_eval_well_typed_app₂ {env : Validation.TypeEnv} {expr1 : Spec.Residual} {preq : TPE.PartialRequest} {pes : TPE.PartialEntities} {expr2 : Spec.Residual} {op : Spec.BinaryOp} {ty : Validation.CedarType} {req : Spec.Request} {es : Spec.Entities} :
Residual.WellTyped env (TPE.evaluate expr1 preq pes)Residual.WellTyped env (TPE.evaluate expr2 preq pes)PEWellTyped env (Spec.Residual.binaryApp op expr1 expr2 ty) (TPE.apply₂ op (TPE.evaluate expr1 preq pes) (TPE.evaluate expr2 preq pes) pes ty) req preq es pes