lisa/src/main/java/it/unive/lisa/analysis/nonrelational/value/impl/stringgraphdomain/SGNUtils.java
public static StringGraphNode<?> widening(StringGraphNode<?> go, StringGraphNode<?> gn) {
        if (gn != null) {
            /* CYCLE INTRODUCTION RULE */
            Iterator<List<StringGraphNode<?>>> CIIterator = CI(go, gn).iterator();
            if (CIIterator.hasNext()) {
                List<StringGraphNode<?>> CIEl = CIIterator.next();
                StringGraphNode<?> v = CIEl.get(0);
                StringGraphNode<?> vn = CIEl.get(1);
                StringGraphNode<?> va = CIEl.get(3);
                int vnIndex = v.getChildren().indexOf(vn);
                v.removeChild(vn);
                v.addBackwardChild(vnIndex, va);
                return gn;
            } else {
                /* REPLACEMENT RULE */
                Iterator<List<StringGraphNode<?>>> CRIterator = CR(go, gn).iterator();
                if (CRIterator.hasNext()) {
                    List<StringGraphNode<?>> CREl = CRIterator.next();
                    StringGraphNode<?> vn = CREl.get(0);
                    StringGraphNode<?> va = CREl.get(1);
                    replace(va, vn);
                    return gn;
                } else {
                    return gn;
                }
            }
        }
        return go;
    }
/**
     * Widening algorithm taken from the appendix of <a href="https://doi.org/10.1145/773473.178479">
     * P. Van Hentenryck, A. Cortesi, and B. Le Charlier. 1994. Type analysis of Prolog using type graphs.
     * SIGPLAN Not. 29, 6 (June 1994)</a>.
     *
     * @param go the root of the old graph
     * @param gn the root of the graph obtained normalizing the or between go and a new provided graph
     * @return the widened graph
     */
Widening algorithm taken from the appendix of 
P. Van Hentenryck, A. Cortesi, and B. Le Charlier. 1994. Type analysis of Prolog using type graphs.
SIGPLAN Not.

@param go the root of the old graph
@param gn the root of the graph obtained normalizing the or between go and a new provided graph
@return the widened graph
Widening algorithm taken from the appendix of P . Van Hentenryck A . Cortesi and B . Le Charlier . 1994 . Type analysis of Prolog using type graphs . SIGPLAN Not . @param go the root of the old graph @param gn the root of the graph obtained normalizing the or between go and a new provided graph @return the widened graph
public static StringGraphNode<?> widening(StringGraphNode<?> go, StringGraphNode<?> gn) {
        if (gn != null) {
            /* CYCLE INTRODUCTION RULE */
            Iterator<List<StringGraphNode<?>>> CIIterator = CI(go, gn).iterator();
            if (CIIterator.hasNext()) {
                List<StringGraphNode<?>> CIEl = CIIterator.next();
                StringGraphNode<?> v = CIEl.get(0);
                StringGraphNode<?> vn = CIEl.get(1);
                StringGraphNode<?> va = CIEl.get(3);
                int vnIndex = v.getChildren().indexOf(vn);
                v.removeChild(vn);
                v.addBackwardChild(vnIndex, va);
                return gn;
            } else {
                /* REPLACEMENT RULE */
                Iterator<List<StringGraphNode<?>>> CRIterator = CR(go, gn).iterator();
                if (CRIterator.hasNext()) {
                    List<StringGraphNode<?>> CREl = CRIterator.next();
                    StringGraphNode<?> vn = CREl.get(0);
                    StringGraphNode<?> va = CREl.get(1);
                    replace(va, vn);
                    return gn;
                } else {
                    return gn;
                }
            }
        }
        return go;
    }
public static StringGraphNode < ? > widening ( StringGraphNode < ? > go , StringGraphNode < ? > gn ) { if ( gn != null ) { /* CYCLE INTRODUCTION RULE */ Iterator < List < StringGraphNode < ? > > > CIIterator = CI ( go , gn ) . iterator ( ) ; if ( CIIterator . hasNext ( ) ) { List < StringGraphNode < ? > > CIEl = CIIterator . next ( ) ; StringGraphNode < ? > v = CIEl . get ( 0 ) ; StringGraphNode < ? > vn = CIEl . get ( 1 ) ; StringGraphNode < ? > va = CIEl . get ( 3 ) ; int vnIndex = v . getChildren ( ) . indexOf ( vn ) ; v . removeChild ( vn ) ; v . addBackwardChild ( vnIndex , va ) ; return gn ; } else { /* REPLACEMENT RULE */ Iterator < List < StringGraphNode < ? > > > CRIterator = CR ( go , gn ) . iterator ( ) ; if ( CRIterator . hasNext ( ) ) { List < StringGraphNode < ? > > CREl = CRIterator . next ( ) ; StringGraphNode < ? > vn = CREl . get ( 0 ) ; StringGraphNode < ? > va = CREl . get ( 1 ) ; replace ( va , vn ) ; return gn ; } else { return gn ; } } } return go ; }
Widening algorithm taken from the appendix of <a href="https://doi.org/10.1145/773473.178479">
 P. Van Hentenryck, A. Cortesi, and B.
Widening algorithm taken from the appendix of <a href = " https : // doi . org / 10 . 1145 / 773473 . 178479 " > P . Van Hentenryck A . Cortesi and B .