katnetic: Change controller start API

The Controller's start function now takes a function of two arguments: a
policy, and a switch, and should return the local policy for that
switch.
katnetic: refactor dump into similar form as run
katnetic: make automaton runnable

Katnetic now has three different options for compiling local policies:

  * local     - assumes a local (link-free) policy as input;
  * classic   - uses the recursive dehopification algorithm; and
  * automaton - uses the automaton-based global dehopificaiton
                algorithm.
Merge pull request #146 from basus/master

Added dependency on Dprle to README
Fix issue with port check ordering

The link-free policy may modify the port, so do the port checking
extracted from the link terms at at the end of the link-free policy.

Closes #148.
Merge pull request #149 from frenetic-lang/portfix

Fix issue with port check ordering
Simple fix.
(cherry picked from commit e33d7359ba80ee65d957c78758fd03ae08e41983)
katnetic: implement dump for local policies.

At the moment there's no way of knowing which switches a local policy
may refer to, so just iterate over the first 40 switch ids and print the
tables.

In the near future, this code should find all the switches the policy
checks for, and only dump those flow tables.
Merge branch 'katnetic-frontend' of github.com:frenetic-lang/frenetic

Conflicts:
	lib/PolicyGenerator.ml
Fix bug in regex_of_policy for certain seq cases

In certain cases, the transformation wasn't using the fact that
sequencing is associative. For example in this program

    (filter switch = 1; port := 1 ;
      (1@1 => 2@1; filter switch = 2; port := 4)); 9@2 => 2@3

the transformation descends to the sequence of the link and the filter
on switch = 2. The link term will create a TP continuation, and the
filter will crate an NL continuation. The sequencing rule for TP, NL
would properly create a NL continuation in this case. But, if this NL
continuation is ever called with None as its second argument (indicating
no link-free policies are available), it will force the TP continuation
to turn the link into a character.

This is exactly what happens once you go up one constructor level,
where you're dealing with this expression:

  `(1@1 => 2@1; filter switch = 2); port := 4`

The left-hand side is the aforementioned NL continuation with the
embedded TP call. Passing that continuation None as its second argument
forced the link to become a character, causing the error.

What this code should have done is create a new NL continuation that
will be able to receive more link-free policies from its context, and
pass those along.

I've added an ascii "truth-table" showing the valid continuation
transitions. In the case of NL, NL, it should always transition to NL,
but just forcing the left-hand side continuation does not ensure that in
the general case. Therefore, you have to wrap the call in the proper
constructor.

Closes #152.
Must start from VLAN ID 1.
Start automaton state numbering from 2

Now it's assumed that all packets outside of the network are on vlan 1,
so start numbering automaton states from 2.
Merge pull request #155 from frenetic-lang/issue-152

Fix bug in regex_of_policy for certain seq cases
Merge pull request #156 from frenetic-lang/vlan1

Packets outside of the network are on vlan 1
Print switch number.
Fix a bug in bin_local noticed by Marco
Merge pull request #161 from frenetic-lang/nate-marco-bugfix

Fix a bug in bin_local noticed by Marco
Make the LocalCompiler more local

- thread switch argument through compilation

- interpret Test on Switch at compile time

- this means that a flow table is only for one switch

Slower, but simpler. And correct-ier.

- Also fixed up front-end and unit test code in light of this change.
Merge pull request #163 from frenetic-lang/nate-marco-bugfix-ii

Make the LocalCompiler more local
autofix: Remove constructor from link_provider

A link_provider can accumulate link-free policies, but only via
sequential composition. That's because a link_provider represents a
policy that looks like this:

   (lfp ; r)

where lfp is a link-free policy, and r is a policy that's almost a
regular expression, when lfp is distributed across it. Associativity
matters here, so you can only extend lfp via sequential composition.

Related to #152, #155, and #158.