org.metacsp.examples.AckermannTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of meta-csp-framework Show documentation
Show all versions of meta-csp-framework Show documentation
A Java API for Meta-CSP based reasoning
package org.metacsp.examples;
public class AckermannTest {
public static int ack(int m, int n) {
if (m == 0) return n+1;
if (n == 0) return ack(m-1,1);
return ack(m-1,ack(m,n-1));
}
public static void main(String[] args) {
System.out.println(ack(4,1));
}
}