public static ConceptLattice idealLattice(DAGraph dag) {
        if (!dag.isAcyclic()) {
            return null;
        }
        // initialize the poset of ideals with the emptyset
        ConceptLattice conceptLattice = new ConceptLattice();
        int id = 1;
        conceptLattice.addNode(new Concept(true, false));
        // travel on graph according to a topological sort
        DAGraph graph = new DAGraph(dag);
        graph.transitiveClosure();
        // treatment of nodes according to a topological sort
        ArrayList<Node> sort = graph.topologicalSort();
        for (Node x : sort) {
            // computation of Jx
            TreeSet<Node> jxmoins = new TreeSet<Node>(graph.getPredecessorNodes(x));
            // storage of new ideals in a set
            TreeSet<Concept> toAdd = new TreeSet<Concept>();
            for (Node j1 : conceptLattice.getNodes()) {
                if (((Concept) j1).containsAllInA(jxmoins)) {
                     Concept newJ = new Concept(true, false);
                     newJ.addAllToA(((TreeSet) ((Concept) j1).getSetA()));
                     newJ.addToA(x);
                     toAdd.add(newJ);
                }
            }
            // addition of the new ideals in conceptLattice
            for (Concept newJ : toAdd) {
                conceptLattice.addNode(newJ);
            }
        }
        // computation of the inclusion relaton
        for (Node node1 : conceptLattice.getNodes()) {
            for (Node node2 : conceptLattice.getNodes()) {
                if (((Concept) node1).containsAllInA(((Concept) node2).getSetA())) {
                    conceptLattice.addEdge(node2, node1);
                }
            }
        }
        conceptLattice.transitiveReduction();
        return conceptLattice;
    }