This thesis contains program coding module for generation logics test by Boolean gap
Delphi & Pascal (česká wiki)
Category: Programs in C, C++
Program: Prac_ndf.c, Booldif.zip
File exe: Booldif.exe
need: Adresar.c, Color.c, Derivac.c, Error.c, Funkcie.c, Help.c, Key.c, Line_edi.c, Main.c, Menu.c, Obsluha.c, Okno.c, Prac_ndf.c, Slovnik.c, Slov_fon.c, Statist.c, Util.c, Video.c, Vystupy.c, Adresar.h, Color.h, Define.h, Error.h, Funkcie.h, Glob.h, Key.h, Line_edi.h, Mbooldif.h, Menu.h, Okno.h, Slov_fon.h, Util.h, Video.h
Example: Example.zip, Bin_10_o.ndf, Bin_10_o.ndf, Bin_1and.ndf, Bin_2rad.ndf, Bin_3rad.ndf, Bin_4rad.ndf, Hard.ndf, I_reg_lo.ndf, Reg_jk.ndf, Scitac_s.ndf, Scp_1rad.ndf, Scp_2rad.ndf, Scp_2r_1.ndf, Scp_3rad.ndf, Scp_4r_2.ndf, Scp_6r_3.ndf, Scp_8r_4.ndf, Sc_1r_pj.ndf, Sc_1r_sj.ndf, Sc_1_aoi.ndf, Sc_2r_4.ndf, Sc_3r_6.ndf, Sc_7400n.ndf, Sc_aon.ndf, Simp3_a.ndf, Simp3_b.ndf, Simp4_a.ndf, Simp4_b.ndf, Simp4_c.ndf, Simp6_a.ndf, Test_vod.ndf, Zle.ndf
Manual: Prirucky.zip
Program: Prac_ndf.c, Booldif.zip
File exe: Booldif.exe
need: Adresar.c, Color.c, Derivac.c, Error.c, Funkcie.c, Help.c, Key.c, Line_edi.c, Main.c, Menu.c, Obsluha.c, Okno.c, Prac_ndf.c, Slovnik.c, Slov_fon.c, Statist.c, Util.c, Video.c, Vystupy.c, Adresar.h, Color.h, Define.h, Error.h, Funkcie.h, Glob.h, Key.h, Line_edi.h, Mbooldif.h, Menu.h, Okno.h, Slov_fon.h, Util.h, Video.h
Example: Example.zip, Bin_10_o.ndf, Bin_10_o.ndf, Bin_1and.ndf, Bin_2rad.ndf, Bin_3rad.ndf, Bin_4rad.ndf, Hard.ndf, I_reg_lo.ndf, Reg_jk.ndf, Scitac_s.ndf, Scp_1rad.ndf, Scp_2rad.ndf, Scp_2r_1.ndf, Scp_3rad.ndf, Scp_4r_2.ndf, Scp_6r_3.ndf, Scp_8r_4.ndf, Sc_1r_pj.ndf, Sc_1r_sj.ndf, Sc_1_aoi.ndf, Sc_2r_4.ndf, Sc_3r_6.ndf, Sc_7400n.ndf, Sc_aon.ndf, Simp3_a.ndf, Simp3_b.ndf, Simp4_a.ndf, Simp4_b.ndf, Simp4_c.ndf, Simp6_a.ndf, Test_vod.ndf, Zle.ndf
Manual: Prirucky.zip
This thesis contains program coding module for generation logics test by Boolean gap. Compile vector of fault for existent circuit, forth about all boughs herself chauffeur. Results is absolute gauge. Program application enables four modes It is implemented in the C programming language for the operating system MS-DOS, or another compatible with it. The program is suitable for an interactive way to communicate with the user, allowing a comfortable working environment are similar to Turbo Vision.
//************************************************************************// // DERIVAC.C // // Derivacia funkcie podle zadannej funkcie // // // // 2.9.1997 // //************************************************************************// #include "mbooldif.h" #include "glob.h" #include "util.h" //************************************************************************// // Pripravy derivaciu podla premennej vysledok rozklada do K,K0,K1 // // 2.9.1997 // //************************************************************************// int derivac_dF(zapis_NDF *h_fnc, int prem, zapis_NDF *K, zapis_NDF *K0, zapis_NDF *K1) { int i; // devcica char nadpis[80]; // taku premennu nemam znuluj(K,1);znuluj(K1,1);znuluj(K0,1); if (( prem >= h_fnc->pv_NDF ) || ( prem < 0 )) return(FALSE); K->pv_NDF=h_fnc->pv_NDF; K0->pv_NDF=h_fnc->pv_NDF; K1->pv_NDF=h_fnc->pv_NDF; for (i=1; i<=h_fnc->poc_NDF; i++) { if ( h_fnc->pNDF[i][prem] == nic ) { // Neobsahuje prem vobec dalsie_NDF( K,0 ); strcpy( K->pNDF[ K->poc_NDF ], h_fnc->pNDF[i] ); K->pNDF[ K->poc_NDF ][ prem ]=nic; } // Obsahuje a,b,c if ( h_fnc->pNDF[i][prem] == jclen ) { dalsie_NDF( K1,0 ); strcpy( K1->pNDF[ K1->poc_NDF ], h_fnc->pNDF[i] ); K1->pNDF[ K1->poc_NDF ][ prem ]=nic; } // Obsahuje A,B,C if ( h_fnc->pNDF[i][prem] == nclen ) { dalsie_NDF( K0,0 ); strcpy( K0->pNDF[ K0->poc_NDF ], h_fnc->pNDF[i] ); K0->pNDF[ K0->poc_NDF ][ prem ]=nic; } } // end for(i=1; sprintf( nadpis,"\n dF/d%s = ú(úűKü+Kűúü)\n ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ\n K = ", index ); uloz_NDF( K, nadpis, TmpSubor[3] ); uloz_NDF( K0, " Kü= ", TmpSubor[3] ); uloz_NDF( K1, " Kű= ", TmpSubor[3] ); return(TRUE); } //************************************************************************// // Robi negaciu znaku nclen->jclen a naopak // // 3.9.1997 // //************************************************************************// char neguj( char clen ) { if ( clen == nclen ) return( jclen ); if ( clen == jclen ) return( nclen ); return( clen ); } //************************************************************************// // Podla toho aka pozicia vyrobi z neho znak a,b,c alebo A,B,C // // 3.9.1997 // //************************************************************************// char bool_znak( char clen, int pozic ) { if ( clen == jclen ) return( 'a'+pozic ); if ( clen == nclen ) return( 'ŕ'+pozic ); return(' '); } //************************************************************************// // toto je pre K negacia vztahu (ab+cd) = (A+B)(C+D) // // z toho tazim a tak to robim // // 3.9.1997 // //************************************************************************// char *K_negovane( zapis_NDF *K ) { int x,y; char deriv_ret[max_ret]; char pom[max_ret]; strcpy( deriv_ret, "(" ); for (y=1; y<=K->poc_NDF; y++ ) { strcat( deriv_ret, "("); for (x=0; x<K->pv_NDF; x++ ) // je to a,b,c alebo A,B,C if (( K->pNDF[y][x] == jclen ) || ( K->pNDF[y][x] == nclen )) { strchar( deriv_ret, bool_znak( neguj( K->pNDF[y][x] ), x ) ); strchar( deriv_ret, '+' ); } // end for(x=1; x<= if ( deriv_ret[ strlen( deriv_ret ) -1 ] == '+' ) strdel( deriv_ret, strlen( deriv_ret ) -1 ); strchar( deriv_ret, ')' ); } // end for(y=1;y<=K strchar( deriv_ret, ')' ); strcpy( pom, deriv_ret ); odstran_zatvorky( pom,1 ); // negujem nic takze ma vzniknut 1 if( strlen( pom ) == 0 ) { strcpy( deriv_ret, "(" ); // bol to clen v ktorom sa nachadzala len premenna podla ktorej sa derivovalo if( K->poc_NDF != 0 ) strcat( deriv_ret, vstup_0 ); // tu nebolo nic else strcat( deriv_ret, vstup_1 ); strcat( deriv_ret, ")" ); } return( deriv_ret ); } //************************************************************************// // Sucin clenov // // 3.9.1997 // //************************************************************************// char *K_sucin( zapis_NDF *K ) { int x,y; char deriv_ret[max_ret]; char pom[max_ret]; strcpy( deriv_ret, "(" ); for (y=1; y<=K->poc_NDF; y++ ) { for (x=0; x<K->pv_NDF; x++ ) // je to a,b,c alebo A,B,C if (( K->pNDF[y][x] == jclen ) || ( K->pNDF[y][x] == nclen )) strchar( deriv_ret, bool_znak( K->pNDF[y][x], x ) ); strchar( deriv_ret, '+' ); } if ( deriv_ret[ strlen( deriv_ret ) -1 ] == '+' ) strdel( deriv_ret, strlen( deriv_ret ) -1 ); // chce nasobit nicim strchar( deriv_ret, ')' ); strcpy( pom, deriv_ret ); odstran_zatvorky( pom,1 ); // nasobim nicim takze ma vzniknut 0 if( strlen( pom ) == 0 ) { strcpy( deriv_ret, "(" ); // bol to clen v ktorom sa nachadzala len premenna podla ktorej sa derivovalo if( K->poc_NDF != 0 ) strcat( deriv_ret, vstup_1 ); // tu nebolo nic else strcat( deriv_ret, vstup_0 ); strcat( deriv_ret, ")" ); } return( deriv_ret ); } //************************************************************************// // Vysledkom tejto srandy by mala byt derivacia podla premennej // // 3.9.1997 // //************************************************************************// char *zderivuj_dF( zapis_NDF *K, zapis_NDF *K0, zapis_NDF *K1 ) { char deriv_ret[max_ret]; FILE *tmp,*fopen(); if (( Rezim == VYUK ) || ( Rezim == PREV)) tmp=fopen( strspoj( temp,TmpSubor[5]) ,"a+t" );// zapisuj inam, aby uzivatel nevidel else tmp=fopen( strspoj( temp,TmpSubor[3]) ,"a+t" ); // ak je to pre premennu ktora nieje vo f(), vtedy je K0={} K1={} // blbost co ?, aj to sa stava if ( ( K1->poc_NDF == 0 ) && ( K0->poc_NDF == 0 ) && ( K->poc_NDF == 0 ) ) { deriv_ret[0]='\0'; fprintf(tmp,"\n"); fprintf(tmp,"\n dF = {}\n\r"); fclose(tmp); return( deriv_ret ); } strcpy( deriv_ret, K_negovane(K) ); // df()= Kneg fprintf(tmp,"\n"); fprintf(tmp,"\n ú = %s", deriv_ret ); strcat( deriv_ret, " ( " ); // df()= Kneg( strcat( deriv_ret, K_negovane(K1) ); // df()= Kneg( K1neg fprintf(tmp,"\n ú(úű = %s", deriv_ret ); strcat( deriv_ret, " " ); // dame medzeru strcat( deriv_ret, K_sucin(K0) ); // df()= Kneg( K1neg K0 fprintf(tmp,"\n ú(úűKü = %s", deriv_ret ); strcat( deriv_ret, " + " ); // df()= Kneg( K1neg K0 + strcat( deriv_ret, K_sucin(K1) ); // df()= Kneg( K1neg K0 + K1 fprintf(tmp,"\n ú(úűKü+Kű = %s", deriv_ret ); strcat( deriv_ret, " " ); // dame medzeru strcat( deriv_ret, K_negovane(K0) ); // df()= Kneg( K1neg K0 + K1 K0neg strcat( deriv_ret, " )" ); // df()= Kneg( K1neg K0 + K1 K0neg ) fprintf(tmp,"\n ú(úűKü+Kűúü) = %s", deriv_ret ); fclose(tmp); return( deriv_ret ); } /*---------------------------------END--------------------------------------*/