Module Tables
Forwarding Tables.
A forwarding table is an alternative representation of a relation R ⊆ {0,1}^n x {0,1}^n. For an IDD on 2n
variables, a row in a forwarding table is a pair (P,A)
where P
is a pattern on which the input string is matched and A
is a set of modifications which is applied to an input that matches P
. Specifically for a given input p
, the first pattern P
that p
matches yields a set of ouputs from the action A
of P
such that this output set is exactly {p':(p,p') ∈ R}
Type
Constructor
val to_table : Idds.Idd.t -> t
to_table idd
is the tablet
such thateval t env
iffIdd.eval idd env
for allenv
Semantics
val eval : t -> (Idds.Var.t -> Base.bool) -> Base.bool
eval tbl env
evaluates the forwarding tabletbl
in environmentenv
Generic operations on Forwarding Tables
val to_string : ?var_name:(Idds.Var.t -> Base.string) -> t -> Base.string
to_string ?var_name tbl
convertstbl
to a string usingvar_name
to map variables to string.var_name
defaults toVar.to_string
val to_expr : t -> interp_test:((Idds.Var.t * Base.bool) Base.list -> 'test Kat.Ast.bexp) -> interp_act:((Idds.Var.t * Base.bool) Base.list -> ('act, 'test) Kat.Ast.exp) -> ('act, 'test) Kat.Ast.exp
to_expr tbl ~interp_test ~interp_act
is the KAT expression representingtbl
whereinterp_act
(interp_test
) specifies how to map actions (patterns) in the forwarding table to (Boolean) expressions
val render : ?var_name:(Idds.Var.t -> Base.string) -> t -> Base.unit
render tbl
renderstbl
in HTML and opens the file usingvar_name
to map variables to string.var_name
defaults toVar.to_string