@@ -0,0 +1,1888 @@
+import java.util.*;%0A%0A/**%0A * runtime representation of an immutable list of goals%0A * together with top of heap and trail pointers%0A * and current clause tried out by head goal%0A * as well as registers associated to it%0A *%0A * note that parts of this immutable lists%0A * are shared among alternative branches%0A */%0Aclass Spine %7B%0A%0A  /**%0A   * creates a spine - as a snapshot of some runtime elements%0A   */%0A%0A  Spine(final int%5B%5D gs0, final int base,  final int ttop, final int k, final int%5B%5D cs) %7B%0A    hd = gs0%5B0%5D;%0A    this.base = base;%0A    this.ttop = ttop;%0A    this.k = k;%0A    this.cs = cs;%0A%0A    System.out.println(%22The head  :%22+hd);%0A    System.out.println(%22The ttop  :%22+ttop);%0A    System.out.println(%22The base  :%22+base);%0A    System.out.println(%22The value of k :%22+k);%0A    System.out.println(%22The value of cs :%22+Arrays.toString(cs));%0A  %7D%0A%0A  /**%0A   * creates a specialized spine returning an answer (with no goals left to solve)%0A   */%0A  Spine(final int hd, final int ttop) %7B%0A    this.hd = hd;%0A    base = 0;%0A   // gs = IntList.empty;%0A    this.ttop = ttop;%0A    System.out.println(%22The head of the :%22+hd);%0A    System.out.println(%22The ttop of the :%22+ttop);%0A    k = -1;%0A    cs = null;%0A  %7D%0A%0A  final int hd;%0A  final int base;%0A  final int ttop;%0A  int k;%0A  int%5B%5D xs;%0A  int%5B%5D cs;%0A  %0A  public static int%5B%5D random(int seed)%7B%0A      int%5B%5D data;int random;%0A       data=new int%5B3%5D;%0A        for (int i=100,j=0;j%3C3;i=i*seed,j++)%7B%0A           random=i*seed+seed*(i-seed);%0A           data%5Bj%5D=random;%0A%0A       %7D%0A       return data;%0A%0A  %7D%0A  %0A  public static void main(String args%5B%5D)%0A  %7B%09 %0A%09 int r%5B%5D=random(2);%0A%09 int%5B%5D ac= %7B1,2%7D;%0A%09 int%5B%5D aab= %7B3,4%7D;%0A%09 System.out.println(%22Calling constructors%22);%0A%09 Spine b=new Spine(r%5B0%5D,r%5B1%5D);%0A%09 System.out.println(%22HT Constructor finish%22);%0A%09 System.out.println(%22Calling main Five constructor%22);%0A%09 Spine a=new Spine(ac,r%5B0%5D,r%5B0%5D,r%5B0%5D,ac);%0A%09 System.out.println(%22Constructor terminated%22);%0A  %7D%0A%7D%0A

Create Spine.java