Not AGI-related but a nice quick new video (2 min) about a little coding "magic 
trick" (hibernating and resuming computations with my programming language). 
Hope you enjoy.

https://www.youtube.com/watch?v=lwn06JRdRaY&ab_channel=StefanReich

  /* // standard version
     static int ackermann(int a, int b) {
       if (a == 0) ret b+1;
       if (b == 0) ret ackermann(a-1, 1);
       ret ackermann(a-1, ackermann(a, b-1));
     }
  */

  // hibernatable version
  srecord ackermann 
<http://code.botcompany.de:8081/tb/show-snippet.php?id=1030372>(int a, int b) 
implements VStack 
<http://code.botcompany.de:8081/tb/show-snippet.php?id=1030376>.Computable<Int> 
{
    void step(VStack 
<http://code.botcompany.de:8081/tb/show-snippet.php?id=1030376> stack, O 
subComputationResult) {
      if (subComputationResult == null) {
        if (a == 0)
          stack._return(b+1);
        else if (b == 0)
          stack.tailCall(new ackermann 
<http://code.botcompany.de:8081/tb/show-snippet.php?id=1030372>(a-1, 1));
        else
          stack.push(new ackermann 
<http://code.botcompany.de:8081/tb/show-snippet.php?id=1030372>(a, b-1));
      } else
        stack.tailCall(new ackermann 
<http://code.botcompany.de:8081/tb/show-snippet.php?id=1030372>(a-1, 
subComputationResult/Int));
    }
  }

------------------------------------------
Artificial General Intelligence List: AGI
Permalink: 
https://agi.topicbox.com/groups/agi/T0012e7e9d7005864-M91e13e08dc695376e1ebd9d7
Delivery options: https://agi.topicbox.com/groups/agi/subscription

Reply via email to