p4lang / p4-constraints

Constraints on P4 objects enforced at runtime
Apache License 2.0
14 stars 7 forks source link

Support constraints on actions and their parameters in @entry_constraint #99

Open smolkaj opened 1 year ago

smolkaj commented 1 year ago

Since the action of a table is a sum type, this requires some language mechanism for destructing sum types, e.g. ADT-style pattern matching.

We didn't implement this feature thus far since this is a nontrivial effort.

This is related to but distinct from https://github.com/p4lang/p4-constraints/issues/98, which is about constraining a single action with a new @action_restriction annotation. https://github.com/p4lang/p4-constraints/issues/98 is simpler to implement since it doesn't require dealing with sum types.