public List < BaseDescr > getRemainingPatterns ( ) { if ( this . patterns . size ( ) > 1 ) { return this . patterns . subList ( 1 , this . patterns . size ( ) ) ; } else if ( this . patterns . size ( ) == 1 ) { // in case there is only one pattern, we do a rewrite, so: // forall( Cheese( type == "stilton" ) ) // becomes // forall( BASE_IDENTIFIER : Cheese() Cheese( this == BASE_IDENTIFIER, type == "stilton" ) ) PatternDescr original = ( PatternDescr ) this . patterns . get ( 0 ) ; PatternDescr remaining = ( PatternDescr ) original . clone ( ) ; remaining . addConstraint ( new ExprConstraintDescr ( "this == " + BASE_IDENTIFIER ) ) ; remaining . setResource ( original . getResource ( ) ) ; return Collections . singletonList ( ( BaseDescr ) remaining ) ; } return Collections . emptyList ( ) ; }
Returns the remaining patterns from the forall CE