So8res comments on Prisoner's Dilemma (with visible source code) Tournament - Less Wrong

47 Post author: AlexMennen 07 June 2013 08:30AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (232)

You are viewing a single comment's thread. Show more comments above.

Comment author: solipsist 20 June 2013 08:00:42PM *  0 points [-]

But the only way to have a shot at mutual cooperation is to provide an obvious top-level cooperating codepath.

I'll do as you request, though there are other ways to achieve mutual cooperation (e.g. MimicBot).

Comment author: So8res 20 June 2013 08:34:39PM *  1 point [-]

Imagine implementing a MimicBot. You need to figure out what my bot will do, and that's non-trivial if you want to avoid infinite loops. You're going to need a fair bit of code. I don't care how the code works, but it should start with

(if <predicate> 'C ...)

This pattern alone won't get you mutual cooperation. You'll still need to write a MimicBot, or a FairBot, or a JustBot. But whatever you do, make it obvious that there's a cooperation condition.

I'm not advocating any particular strategy; I'm advocating a pattern: If you want a shot at trust, you'd better have a codepath that results in cooperation, and you'd best make it really easy for other bots to recognize.

Best of luck!

Comment author: solipsist 25 June 2013 12:38:52AM *  2 points [-]

Since I don't think you're going down the predicate route, I'll tell you the sort of strategy I was going to use against it.

(lambda (x)
    (let ([eq? (lambda (left right) #f)])
    (if (eq? 1 1)
        'C
        ; rest of program....
        )))

The predicate (eq? 1 1) evaluates to true, except when eq? is shadowed. Just curious -- would it have worked?

Comment author: So8res 25 June 2013 01:01:00AM 2 points [-]

Nice. But no. My first attempt was a static analyzer, and the first thing it did was a syntax expansion, putting all code into fully expanded form and attaching lexical information to each identifier that let me see what was from the base package and what was redefined.

FWIW, it's pretty easy to pull out the first conditional (cond, case, or if) when you have code in fully expanded form (which turns them all into ifs). However, that just puts you in a position of checking whether a predicate is #t or #f, which isn't much easier than discovering whether a program returns 'C or 'D. Ultimately, your MimicBot idea is better :-)