patternMinor
Coding max as an interaction net
Viewed 0 times
interactionmaxcodingnet
Problem
I am reading Yves Lafont's introductory paper Interaction Nets. Early in the beginning he mentions that max cannot be coded as follows
since in this coding it is not possible to choose which argument to look at first (so necessitating the need for a principle port). But I don't understand why it's wrong. I am trying to come up with an example where certain choice of rewritings will lead to a wrong answer.
since in this coding it is not possible to choose which argument to look at first (so necessitating the need for a principle port). But I don't understand why it's wrong. I am trying to come up with an example where certain choice of rewritings will lead to a wrong answer.
Solution
Rules for agents in interaction nets are defined by what the principal port of that agent is connected to and each agent has exactly one principal port.
In the "max" example, for the top left rule to work the principal port of the Max agent must be the one connected to the 0.
But then the top right rule can only depend on the value of x, not the 0.
So the top right rule cannot be differentiated from the bottom rule (assuming x is not 0) and the bottom rule does not work if the y value is 0.
It is usual, when drawing interaction nets, for the principal port to have a little arrow drawn on it, to make this clear.
Lafont goes on to show how to make this work via an intermediate step, but I assume you've read that.
In the "max" example, for the top left rule to work the principal port of the Max agent must be the one connected to the 0.
But then the top right rule can only depend on the value of x, not the 0.
So the top right rule cannot be differentiated from the bottom rule (assuming x is not 0) and the bottom rule does not work if the y value is 0.
It is usual, when drawing interaction nets, for the principal port to have a little arrow drawn on it, to make this clear.
Lafont goes on to show how to make this work via an intermediate step, but I assume you've read that.
Context
StackExchange Computer Science Q#133716, answer score: 2
Revisions (0)
No revisions yet.