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

type t

The type of a forwarding table.

Constructor

val to_table : Idds.Idd.t -> t

to_table idd is the table t such that eval t env iff Idd.eval idd env for all env

Semantics

val eval : t -> (Idds.Var.t -> Base.bool) -> Base.bool

eval tbl env evaluates the forwarding table tbl in environment env

Generic operations on Forwarding Tables

val to_string : ?⁠var_name:(Idds.Var.t -> Base.string) -> t -> Base.string

to_string ?var_name tbl converts tbl to a string using var_name to map variables to string. var_name defaults to Var.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 representing tbl where interp_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 renders tbl in HTML and opens the file using var_name to map variables to string. var_name defaults to Var.to_string