public void generateChildren() {

            children = new ArrayList<State>();
            if (popEligible) {
                Permutation q = p.delete(0);
                State child = new State(q, q.length() > 0);
                int[] childInsertionCandidates = new int[insertionPoints.length];
                for (int i = 1; i < insertionPoints.length; i++) {
                    childInsertionCandidates[i - 1] = insertionPoints[i] - 1;
                }
                child.computeInsertionPoints(childInsertionCandidates);
                children.add(child);
            }

            Permutation q = p.insert(0, p.length());
            if (definingProperty.isSatisfiedBy(q)) {
                State child = new State(q, true);
                int[] childInsertionCandidates = new int[insertionPoints.length + 1];
                childInsertionCandidates[0] = 1;
                for (int i = 1; i < childInsertionCandidates.length; i++) {
                    childInsertionCandidates[i] = insertionPoints[i - 1] + 1;
                }
                child.computeInsertionPoints(childInsertionCandidates);
                children.add(child);
            } else {
                return; // Assumes hereditary property
            }
            for (int i = 0; i < insertionPoints.length; i++) {
                q = p.insert(insertionPoints[i], p.length());
                if (definingProperty.isSatisfiedBy(q)) {
                    State child = new State(q, false);
                    int[] childInsertionCandidates = new int[insertionPoints.length + 1];
                    int ci = 0;
                    for (int j = 0; j < insertionPoints.length; j++) {
                        if (insertionPoints[j] <= insertionPoints[i]) {
                            childInsertionCandidates[ci++] = insertionPoints[j];
                        }
                        if (insertionPoints[j] >= insertionPoints[i]) {
                            childInsertionCandidates[ci++] = insertionPoints[j] + 1;
                        }
                    }
                    child.computeInsertionPoints(childInsertionCandidates);
                    children.add(child);
                }
            }
        }