public void load ( final FormulaFactoryState state ) { int index = - 1 ; for ( int i = validStates . size ( ) - 1 ; i >= 0 && index == - 1 ; i -- ) if ( validStates . get ( i ) == state . id ( ) ) index = i ; if ( index == - 1 ) throw new IllegalArgumentException ( "The given formula factory state is not valid anymore." ) ; this . validStates . shrinkTo ( index + 1 ) ; shrinkMap ( this . posLiterals , state . state ( ) [ 0 ] ) ; shrinkMap ( this . negLiterals , state . state ( ) [ 1 ] ) ; shrinkSet ( this . generatedVariables , state . state ( ) [ 2 ] ) ; shrinkMap ( this . nots , state . state ( ) [ 3 ] ) ; shrinkMap ( this . implications , state . state ( ) [ 4 ] ) ; shrinkMap ( this . equivalences , state . state ( ) [ 5 ] ) ; shrinkMap ( this . ands2 , state . state ( ) [ 6 ] ) ; shrinkMap ( this . ands3 , state . state ( ) [ 7 ] ) ; shrinkMap ( this . ands4 , state . state ( ) [ 8 ] ) ; shrinkMap ( this . andsN , state . state ( ) [ 9 ] ) ; shrinkMap ( this . ors2 , state . state ( ) [ 10 ] ) ; shrinkMap ( this . ors3 , state . state ( ) [ 11 ] ) ; shrinkMap ( this . ors4 , state . state ( ) [ 12 ] ) ; shrinkMap ( this . orsN , state . state ( ) [ 13 ] ) ; shrinkMap ( this . pbConstraints , state . state ( ) [ 14 ] ) ; this . ccCounter = state . state ( ) [ 15 ] ; this . pbCounter = state . state ( ) [ 16 ] ; this . cnfCounter = state . state ( ) [ 17 ] ; clearCaches ( ) ; }
Loads a previously saved FormulaFactoryState . All formula factory states saved after the loaded one become invalid .