
1253 ∗ **Test i f <i>l e f t </ i> and <i>r i g h t </ i> a r e e qu a l , and s t o r e the r e s u l t w i t h i n**

1254 ∗ **<i>i sE qu a l </ i >;<BR>** 1255 ∗ **</f on t>**

1256 ∗ **b o o l e an i s E q u a l= l e f t . compareTo ( r i g h t )==0;<BR>** 1257 ∗ <f o n t c o l o r ="#0000FF" s t y l e =" f on t−**f am i l y : g e o r g i a ">**

1258 ∗ **P r i n t p r o p o s i t i o n s <i>A , B ,C , l e f t , r i g h t </ i> and th e b o o l ean <i>i sE qu a l </ i >;<**←֓

BR>

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

1260 ∗ System . out . p r i n t l n ( "A = atomF["+ th eS i z eO fFram e /4+" ] = " **+ A . s t a t e ( ) ) ;<BR>** 1261 ∗ System . out . p r i n t l n ( "B = atomF["+ th eS i z eO fFram e /2+" ] = " **+ B . s t a t e ( ) ) ;<BR>**

1262 ∗ System . out . p r i n t l n ( "C = atomF [ "+ ( 3∗ **th eS i z eO fFram e ) /4+" ] = " + C . s t a t e ( ) ) ;<**←֓

BR>

1263 ∗ System . out . p r i n t l n ( " (A OR B) AND (B OR C) = " + l e f t . s t a t e ( ) ) **;<BR>** 1264 ∗ **System . out . p r i n t l n ( "B OR (A AND C ) = " + r i g h t . s t a t e ( ) ) ;<BR>**

1265 ∗ **System . out . p r i n t l n ( " i s E q u a l = "+ i s E q u a l ) ;<BR>**

1266 ∗ <f o n t c o l o r="#FF0000 " s t y l e =" f on t−**f am i l y : g e o r g i a ">**

1267 ∗ **A = atomF [ 1 ] = x 0 0 0 0 0 0 0 0 0 0 0 0 c c c c<BR>** 1268 ∗ **B = atomF [ 2 ] = x 0 0 0 0 0 0 0 0 0 0 0 0 f 0 f 0 <BR>**

1269 ∗ **C = atomF [ 3 ] = x 0 0 0 0 0 0 0 0 0 0 0 0 f f 0 0 <BR>**

1270 ∗ **(A OR B) AND (B OR C) = x 0 0 0 0 0 0 0 0 0 0 0 0 f c f 0 <BR>** 1271 ∗ **B OR (A AND C ) = x 0 0 0 0 0 0 0 0 0 0 0 0 f c f 0 <BR>**

1272 ∗ **i s E q u a l = t ru e<BR>**

1273 ∗ **</f on t>** 1274 ∗ **</code>** 1275 ∗

1276 ∗/

1277 **p u b l i c v o id** logical_tests_Freeb oo lea n ( **i n t** theSizeOfFrame ) {

1278

1279 **i n t** i ; 1280 finalFreeboolean fFb = new finalFreeboolean **( ) ;** 1281 i f ( fFb . size ( theSizeOfFrame **) !=** theSizeOfFrame ) {

1282 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 _ F r e e b o o l e a n ( i n t ) \n " +

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

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

1285 }

1286 System . out . println ( " \n\n ////// Test : F r e e b o o l e an − **s i z e = "** + ←֓

theSizeOfFrame +

1287 " //\n\n " ) ;

1288 finalFreeboolean [ ] atomF = new finalFreeboolean [ theSizeOfFrame ] ;

1289 f o r ( i=0;i<theSizeOfFrame ; i**++) {** 1290 atomF [ i ]= fFb . instanceNsize **( ) ;** 1291 atomF [ i ] . atomic ( i ) ;

1292 }

1293 fFb . zero **( ) ;**

1294 System . out . println ( **" z e r o = "+**fFb . state **( ) ) ;**

1295 fFb . one **( ) ;**

1296 System . out . println ( **" one = "+**fFb . state **( ) ) ;**

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

1298 System . out . println ( " atomF [ "+i**+" ] = "** +atomF [ i ] . state **( ) ) ;**

1299 }

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

1301 fFb . zero **( ) .** complement **( ) ;**

1302 System . out . println ( **" complement ( z e r o ) = "+**fFb . state **( ) ) ;** 1303 fFb . one **( ) .** complement **( ) ;** 1304 System . out . println ( **" complement ( one ) = "+**fFb . state **( ) ) ;** 1305 f o r ( i=0;i<theSizeOfFrame ; i**++) {** 1306 fFb . complement ( atomF [ i **] ) ;** 1307 System . out . println ( " complement ( atomF [ "+i**+" ] ) = "** +fFb . state **( ) ) ;**

1308 }

1309 System . out . println ( " \n−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−\n " ) ; 1310 fFb . zero **( ) .** cocomplement **( ) ;** 1311 System . out . println ( **" cocomp lement ( z e r o ) = "+**fFb . state **( ) ) ;** 1312 fFb . one **( ) .** cocomplement **( ) ;** 1313 System . out . println ( **" cocomp lement ( one ) = "+**fFb . state **( ) ) ;**

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

1315 fFb . cocomplement ( atomF [ i **] ) ;**

1316 System . out . println ( " cocomp lement ( atomF [ "+i**+" ] ) = "** +fFb . state **( ) ) ;**

1317 }

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

1319

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

) " ) ;

1321 finalFreeboolean A = atomF [ theSizeOfFrame **/ 4 ] .** clone **( ) ;**
