lisa/src/main/java/it/unive/lisa/analysis/nonrelational/value/impl/stringgraphdomain/SGNUtils.java
public static boolean strContainsAux_checkTrue(StringGraphNode<?> node, Character c) {

        if (node instanceof SimpleStringGraphNode)
            return ((SimpleStringGraphNode) node).getValueAsChar().equals(c);

        // do not check OR nodes here! At first iteration, left is the root, which can be an OR node!
        List<StringGraphNode<?>> children = node.getChildren();
        for (StringGraphNode<?> child: children) {
            if (child instanceof OrStringGraphNode) continue;
            if (child instanceof  SimpleStringGraphNode)
                if (strContainsAux_checkTrue(child, c))
                    return true;
            if (child instanceof ConcatStringGraphNode) {
                Integer k = ((ConcatStringGraphNode)child).getValue();
                for (int i=0; i<k; i++)
                    if (strContainsAux_checkTrue(child, c))
                        return true;
            }
        }

        return false;
    }
/**
     * Auxiliary function for implementing Contains.
     * Following Section 4.4.6 - Table VII, this recursive algorithm checks whether there is a Concat Node with a child node
     * which label is equal to the second argument of the function
     *
     * @param node the root of the graph tree of interest
     * @param c the character which has to be contained in the graph tree with root node
     * @return true iff there is a concat node with a node labeled 'c'
     */
Auxiliary function for implementing Contains.
Following Section 4.4.6 - Table VII, this recursive algorithm checks whether there is a Concat Node with a child node
which label is equal to the second argument of the function

@param node the root of the graph tree of interest
@param c the character which has to be contained in the graph tree with root node
@return true iff there is a concat node with a node labeled 'c'
Auxiliary function for implementing Contains . Following Section 4 . 4 . 6 - Table VII this recursive algorithm checks whether there is a Concat Node with a child node which label is equal to the second argument of the function @param node the root of the graph tree of interest @param c the character which has to be contained in the graph tree with root node @return true iff there is a concat node with a node labeled ' c '
public static boolean strContainsAux_checkTrue(StringGraphNode<?> node, Character c) {
        if (node instanceof SimpleStringGraphNode)
            return ((SimpleStringGraphNode) node).getValueAsChar().equals(c);
        List<StringGraphNode<?>> children = node.getChildren();
        for (StringGraphNode<?> child: children) {
            if (child instanceof OrStringGraphNode) continue;
            if (child instanceof  SimpleStringGraphNode)
                if (strContainsAux_checkTrue(child, c))
                    return true;
            if (child instanceof ConcatStringGraphNode) {
                Integer k = ((ConcatStringGraphNode)child).getValue();
                for (int i=0; i<k; i++)
                    if (strContainsAux_checkTrue(child, c))
                        return true;
            }
        }
        return false;
    }
public static boolean strContainsAux_checkTrue ( StringGraphNode < ? > node , Character c ) { if ( node instanceof SimpleStringGraphNode ) return ( ( SimpleStringGraphNode ) node ) . getValueAsChar ( ) . equals ( c ) ; List < StringGraphNode < ? > > children = node . getChildren ( ) ; for ( StringGraphNode < ? > child : children ) { if ( child instanceof OrStringGraphNode ) continue ; if ( child instanceof SimpleStringGraphNode ) if ( strContainsAux_checkTrue ( child , c ) ) return true ; if ( child instanceof ConcatStringGraphNode ) { Integer k = ( ( ConcatStringGraphNode ) child ) . getValue ( ) ; for ( int i = 0 ; i < k ; i ++ ) if ( strContainsAux_checkTrue ( child , c ) ) return true ; } } return false ; }
Auxiliary function for implementing Contains.
Auxiliary function for implementing Contains .
// do not check OR nodes here! At first iteration, left is the root, which can be an OR node!