merge. Fix trailing whitespace
Merge pull request #182 from frenetic-lang/katnetic

Katnetic
switches: Group topology terms into switch terms

This commit changes the internal representation of topology terms within
the automaton-based dehopification algorithm. Previously, the algorithm
treated link terms in parallel composition as independent entities.

  topo = (1@1 => 2@1 | 1@2 => 3@1 | 2@1 => 3@2)

This meant that link-free policies would be distributed across the
entire parallel composition:

  lfp ; topo = (lfp ; 1@1 => 2@1) | (lfp ; 1@2 => 3@1) | ...

which would lead to rapid growth in transformed program size.

Instead, the algorithm now recognizes when link terms with the same
source switch are combined in parallel composition, and consider that a
single link term for the purposes of distributing sequences. The
distribution is actually done at a later point in the algorithm where it
can be implemented more efficiently as a port filter on the local
policy.

Note that this currently only applies for compositions that associate to
the left, which means you will only see the effect on one or two switch
policies if the policies are not crafted carefully. To clarify,

  (1@1 => 2@1 | 1@2 => 3@1 | 2@1 => 4@1 | 2@2 => 4@2)

will only group switch 1, whereas

  (1@1 => 2@1 | 1@2 => 3@1) | (2@1 => 4@1 | 2@2 => 4@2)

will group both switch 1 and switch 2.
switches: collect whole topolgy terms

This commit is a follow-up to the last, with further grouping of link
terms. Now, rather than just grouping links on the same switch, any
parallel composition of link terms is stored as a single unit. In other
orwds, the automaton now works over sequence of link-free policies and
topology terms.

Results: abfattree-tables-fail-full-4-3.kat

  Generate using the script in ocaml-topology:

    python abfattree.py -k abfattree-tables-fail-full-4-3.kat -t tables\
    -f fail -l full -o /tmp/f10.dot 4 3

  Running time:
    real    0m5.438s
    user    0m5.088s
    sys     0m0.036s

  Size of flowtables: 26 to 144

  Number of states used: 4 (including initial)

  Correctness: spot-checked but not confirmed.
Merge branch 'switches' into start-from-vlan1

Fixed conflicts.

Conflicts:
	frenetic/katnetic.ml
	lib/LocalCompiler.ml
	lib/PolicyGenerator.ml
	test/NetKAT_Test.ml
Merge branch 'start-from-vlan1' of https://github.com/frenetic-lang/frenetic into start-from-vlan1