verified-network-toolchain / petr4

Petr4: Formal Semantics for P4
Apache License 2.0
76 stars 21 forks source link

P4light Type System Incomplete #327

Open rudynicolop opened 2 years ago

rudynicolop commented 2 years ago

Refactoring of typing definitions.

In Typing.v, all of the typing rules are parameterized by a ge:genv, i.e. expression typing (expr_types) is:

(ge,path,D,G) |- e : t

ge should be hidden under the definition of expr_types, stmt_types, etc under a forall so the rule is independent of ge:

(path,D,G) |- e : t

and type soundness holds for any ge:genv. ge was added as a parameter to the typing definitions as a way to resolve enum type names in enum_member_sound, so removing ge will be tricky.

Furthermore, fundef_funtype_prop.Internal_prop needs to say that the body of the function is well-typed using block_types. B/c block_types needs fundef_funtype_prop as a constraint on the typing context & ge:genv it is necessary that these be defined in terms of one another via either a mutual Inductive or Fixpoint.

Missing Rules & Incomplete Proofs

In Rules.v type soundness for the following syntax forms is either only partially proved, entirely admitted, or not even defined yet.

hackedy commented 1 year ago

Do you still need this issue or have these things been filled in?

rudynicolop commented 1 year ago

Yeah there's still holes in the type system.