Make sure the equality comparison only depends on things that affect functionality—i.e. it will declare any functionally equivalent programs equal even they use a different nameset for variables or something.
(Yes, I know that’s reducible to the halting problem; in practice, you’ll use a computable, polynomial time approximation for it that will inevitably have to throw out equivalent programs that are too complex or otherwise be too ‘clever’.)
It’s quite likely that the optimal behaviour should be different in case the program is functionally equal but not exactly equal.
If you’re playing yourself, then you want to cooperate.
If you’re playing someone else, then you’d want to cooperate if and only if that someone else is smart enough to check if you’ll cooperate; but if it’s decision doesn’t depend on yours, then you should defect.
You only need to evaluate the equivalence of the first two lines of the program, by the way. It cooperates with those who can’t not cooperate with it if it goes through that branch of the logic, and does something else to everyone else.
TIL that ethnic hatred and tribalism is a Nash (folk) equilibrium.
Make sure the equality comparison only depends on things that affect functionality—i.e. it will declare any functionally equivalent programs equal even they use a different nameset for variables or something.
(Yes, I know that’s reducible to the halting problem; in practice, you’ll use a computable, polynomial time approximation for it that will inevitably have to throw out equivalent programs that are too complex or otherwise be too ‘clever’.)
Patrick discusses this issue here in some depth.
It’s quite likely that the optimal behaviour should be different in case the program is functionally equal but not exactly equal.
If you’re playing yourself, then you want to cooperate.
If you’re playing someone else, then you’d want to cooperate if and only if that someone else is smart enough to check if you’ll cooperate; but if it’s decision doesn’t depend on yours, then you should defect.
You only need to evaluate the equivalence of the first two lines of the program, by the way. It cooperates with those who can’t not cooperate with it if it goes through that branch of the logic, and does something else to everyone else.
Can you write that in Scheme so I can submit this? Thanks