public void add ( Pattern p ) { if ( ! hasLabel ( p . getLabel ( 0 ) ) ) throw new IllegalArgumentException ( "The label of first " + "element of parameter index \"" + p . getLabel ( 0 ) + "\" not found in this pattern." ) ; for ( MappedConst mc : p . getConstraints ( ) ) { add ( mc . getConstr ( ) , p . convertIndsToLabels ( mc . getInds ( ) ) ) ; } }
Appends the constraints in the parameter pattern to the desired location . Indexes in the constraint mappings are translated so that 0 is translated to ind0 and others are translated to orig + indAppend - 1 . All slots of this pattern should already be full before calling this method . This method makes room for the new variables . Labels in the parameter pattern is transferred to this pattern . If there are equivalent labels then these slots are mapped .