@@ -0,0 +1,1029 @@
+package org.clafer;%0A%0Aimport org.clafer.ast.AstConcreteClafer;%0Aimport org.clafer.ast.AstModel;%0Aimport static org.clafer.ast.Asts.*;%0Aimport org.clafer.compiler.ClaferCompiler;%0Aimport org.clafer.compiler.ClaferSolver;%0Aimport org.clafer.scope.Scope;%0Aimport static org.junit.Assert.assertEquals;%0Aimport org.junit.Test;%0A%0A/**%0A *%0A * @author jimmy%0A */%0Apublic class TransitiveTest %7B%0A%0A    /**%0A     * %3Cpre%3E%0A     * Person *%0A     *     Child -%3E Person *%0A     *     %5B this not in this.(Person -%3E Child . Child -%3E ref)* %5D%0A     * %3C/pre%3E%0A     */%0A    @Test(timeout = 60000)%0A    public void testAcyclic() %7B%0A        AstModel model = newModel();%0A%0A        AstConcreteClafer person = model.addChild(%22Person%22);%0A        AstConcreteClafer child = person.addChild(%22Child%22).refToUnique(person);%0A        person.addConstraint(notIn($this(), join($this(), transitiveClosure(join(relation(child), ref(child))))));%0A%0A        ClaferSolver solver = ClaferCompiler.compile(model, Scope.defaultScope(2));%0A        assertEquals(4, solver.allInstances().length);%0A    %7D%0A%7D%0A

Test for transitive closure.