@@ -0,0 +1,1960 @@
+package com.github.meteoorkip.utils;%0A%0Aimport alice.tuprolog.*;%0Aimport alice.tuprolog.lib.BasicLibrary;%0Aimport alice.tuprolog.lib.IOLibrary;%0Aimport alice.tuprolog.lib.ISOLibrary;%0Aimport alice.tuprolog.lib.OOLibrary;%0Aimport com.github.meteoorkip.graafvis.GraafvisCompiler;%0Aimport com.github.meteoorkip.prolog.TuProlog;%0Aimport com.github.meteoorkip.solver.Solver;%0Aimport org.graphstream.graph.Graph;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0Apublic class DebugUtils %7B%0A%0A%0A    public static void traceInvalidLibrary(Library l) throws InvalidLibraryException %7B%0A        List%3CLibrary%3E pre = new LinkedList%3C%3E();%0A        pre.add(new BasicLibrary());%0A        pre.add(new ISOLibrary());%0A        pre.add(new IOLibrary());%0A        pre.add(new OOLibrary());%0A        traceInvalidLibrary(pre,l);%0A    %7D%0A%0A%0A%0A    public static void traceInvalidLibrary(List%3CLibrary%3E pre, Library l) throws InvalidLibraryException %7B%0A        Prolog prolog = new Prolog();%0A        for (Library lib : pre) %7B%0A            try %7B%0A                prolog.loadLibrary(lib);%0A            %7D catch (InvalidLibraryException e) %7B%0A               throw new InvalidLibraryException(%22InvalidLibraryException in pre-trace libraries!!%22, e.getLine(), e.getPos());%0A            %7D%0A        %7D%0A        TheoryManager theoryManager = prolog.getTheoryManager();%0A        try %7B%0A            theoryManager.consult(new Theory(l.getTheory()), false, l.getName());%0A        %7D catch (InvalidTheoryException e) %7B%0A            System.out.println(l.getTheory());%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A%0A    public static String getCompleteTheory(Graph g, String script) throws GraafvisCompiler.SyntaxException, GraafvisCompiler.CheckerException %7B%0A        GraafvisCompiler compiler = new GraafvisCompiler();%0A        List%3CTerm%3E terms = compiler.compile(script);%0A        Solver solver = new Solver();%0A        TuProlog a = solver.loadProlog(g, terms);%0A        return a.getProlog().getTheoryManager().getTheory(false);%0A    %7D%0A%7D%0A

ADD DebugUtils added