diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2020-11-28 16:19:19 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2020-11-28 16:19:19 +0000 |
commit | b0d5501f1f23aa46a217497ed899ec51aa571f1f (patch) | |
tree | 8f673d753a933a685d689aa5febbb7bf0b2aeaec /src/qm.h | |
parent | 12e75ea93823cee60843a967d5f38e53622c3125 (diff) | |
download | Quine-McCluskey-b0d5501f1f23aa46a217497ed899ec51aa571f1f.tar.gz Quine-McCluskey-b0d5501f1f23aa46a217497ed899ec51aa571f1f.zip |
began work on merging terms in turn
Diffstat (limited to 'src/qm.h')
-rw-r--r-- | src/qm.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/qm.h b/src/qm.h new file mode 100644 index 0000000..2b001bb --- /dev/null +++ b/src/qm.h @@ -0,0 +1,39 @@ +#ifndef QM_C +#define QM_C + +typedef struct { + char var; + bool not_; +} Variable; + +typedef struct { + unsigned int numVars; + Variable vars[26]; +} DNFTerm; + +typedef struct { + unsigned int numTerms; + DNFTerm terms[100]; + char notChar; +} DNF; + +typedef struct { + DNFTerm term; + unsigned int simplifiedIndexes[100]; + unsigned int numIndexes; +} SimplifiedTableItem; + +unsigned int strcnt(const char* str, const char cnt); +void setupMergeTable(SimplifiedTableItem simplifiedTable[], DNF* dnf); +void mergeTermsInTurn(SimplifiedTableItem simplifiedTable[], unsigned int* length); +bool canMergeTerms(const DNFTerm* term1, const DNFTerm* term2); +DNFTerm mergeTerms(const DNFTerm* term1, const DNFTerm* term2); +bool termInTable(const SimplifiedTableItem simplifiedTable[], const unsigned int* length, const DNFTerm* term); +bool termsAreEqual(const DNFTerm* term1, const DNFTerm* term2); +DNF parseDNFStr(const char* inpStr); +DNFTerm parseDNFTerm(const char* termStr, const char notChar, const int relIndex); +void printDNFTerm(const DNFTerm* term); +void printForm(const DNF* form); +void printForm2(const DNF* form); + +#endif
\ No newline at end of file |