
2285 ∗ **</f on t>**

2286 ∗ 2287 ∗ **</code>**

2288 ∗ 2289 ∗/

2290 **p u b l i c v o id** logical_tests_Powerse t ( **i n t** theSizeOfFrame ) {

2291

2292 **i n t** i ; 2293 finalPowerset fPset = new finalPowerset **( ) ;**

2294 i f ( fPset . size ( theSizeOfFrame **) !=** theSizeOfFrame ) {

2295 System . err . println ( **" E r r o r : : R e f e r e eTo o lb ox_Tu t o r i a l .**←֓

l o g i c a l _ t e s t s_ C l o s e d h y p e r p o w e r s e t ( i n t ) \n " +

2296 " Exceed a u t h o r i z e d bounds ! " ) ;

2297 System . exit **( 0 ) ;**

2298 }

2299 //

2300 System . out . println ( " \n\n ////// Test : Powe rse t − **s i z e = "** + theSizeOfFrame ←֓

+

2301 " //\n\n " ) ;

2302 finalPowerset [ ] atomPset = new finalPowerset [ theSizeOfFrame ] ;

2303 f o r ( i=0;i<theSizeOfFrame ; i**++) {**

2304 atomPset [ i ]= fPset . instanceNsize **( ) ;** 2305 atomPset [ i ] . atomic ( i ) ;

2306 }

2307 f o r ( i=0;i<theSizeOfFrame ; i**++) {**

2308 System . out . println ( " atomPset [ "+i**+" ] "** + 2309 **" = "** +atomPset [ i ] . state **( ) ) ;**

2310 }

2311 System . out . println ( " \n−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−\n " ) ; 2312 f o r ( i=0;i<theSizeOfFrame ; i**++) {** 2313 fPset . complement ( atomPset [ i **] ) ;**

2314 System . out . println ( " complement ( atomPset [ "+i**+" ] ) "** +

2315 **" = "** +fPset . state **( ) ) ;**

2316 }

2317 System . out . println ( " \n−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−\n " ) ;

2318 f o r ( i=0;i<theSizeOfFrame ; i**++) {**

2319 fPset . cocomplement ( atomPset [ i **] ) ;** 2320 System . out . println ( " cocomp lement ( atomPset [ "+i**+" ] ) "** +

2321 **" = "** +fPset . state **( ) ) ;**

2322 }

2323

2324 System . out . println ( " \n−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−\n " ) ;

2325

2326 System . out . println ( **" \n\n ////// Test : (A OR B) AND (B OR C) = B OR (A AND C**←֓

) " ) ;

2327 finalPowerset A = atomPset [ theSizeOfFrame **/ 4 ] .** clone **( ) ;**

2328 finalPowerset B = atomPset [ theSizeOfFrame **/ 2 ] .** clone **( ) ;**

2329 finalPowerset C = atomPset **[ ( 3** ∗ theSizeOfFrame **) / 4 ] .** clone **( ) ;**

2330 finalPowerset AUB = fPset . instanceNsize **( ) ;**

2331 finalPowerset BUC = fPset . instanceNsize **( ) ;**

2332 finalPowerset ANC = fPset . instanceNsize **( ) ;** 2333 finalPowerset left = fPset . instanceNsize **( ) ;**

2334 finalPowerset right = fPset . instanceNsize **( ) ;**

2335 AUB . or ( A , B ) ; 2336 BUC . or ( B , C ) ; 2337 ANC . and ( A , C ) ; 2338 left . and ( AUB , BUC ) ; 2339 right . or ( B , ANC ) ; 2340 **b o o l e an** isEqual=left . compareTo ( right **)==0;**

2341 System . out . println ( **"A = atomPset [ "+**theSizeOfFrame /4+ **" ] = "** + A . state **( ) ) ;**

2342 System . out . println ( **"B = atomPset [ "+**theSizeOfFrame /2+ **" ] = "** + B . state **( ) ) ;**

2343 System . out . println ( "C = atomPset [ " +(3∗ theSizeOfFrame **) /4+" ] = "** + C . state ( )←֓

) ;

2344 System . out . println ( **" (A OR B) AND (B OR C) = "** + left . state **( ) ) ;** 2345 System . out . println ( **"B OR (A AND C ) = "** + right . state **( ) ) ;**

2346 System . out . println ( **" i s E q u a l = "+**isEqual ) ;

2347

2348 }

2349 2350 /∗∗

2351 ∗ Compare d i f f e r e n t r e f e r e e f u n c t i o n s a p p l i e d t o th e f u s i o n o **f 3 bba .** 2352 ∗ **Both s am p l in g and r e l a x e d app r o a c h e s a r e c o n s i d e r e d .**

2353 ∗

2354 ∗ **Th is examp le works l i k e { @ l ink R e f e r e eTo o lb ox_Tu t o r i a l#**←֓
