-
Notifications
You must be signed in to change notification settings - Fork 19
Refactoring mintermization to MintermizationDomain #355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
martinhruska
wants to merge
20
commits into
devel
Choose a base branch
from
mintermization-refactor
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2df9bb1
Towards generalized mintermization
martinhruska b6cfacb
mintermization is ugly but working, needs to find out what to do with…
martinhruska b6f2227
removing static bdd_mng
martinhruska addb925
final encapsulation of bdd manager
martinhruska dddc8fb
Renamed MintermizationAlgebra to MintermizationDomain to make it comp…
martinhruska bab1ded
Merge branch 'devel' into mintermization-refactor
martinhruska a72b5b3
fixing constant problem in mintermization
martinhruska 0ff19bc
Merge branch 'devel' into mintermization-refactor
martinhruska c95e9be
proper constant handling in mintermization
martinhruska a669c69
fixing warning causing issues
martinhruska d4b9a5e
Templatization of mintermization
martinhruska 99a20ea
added forgotten files
martinhruska 8ce5282
Renamed MintermizationDomain to BDDDomain
martinhruska 2815fd6
Update tests/mintermization.cc
martinhruska fb8c9d4
removing debug flags from cmake
martinhruska a772b87
removed unnecessary include
martinhruska 6c745e3
Update include/mata/parser/mintermization.hh
martinhruska 637630c
Update include/mata/parser/mintermization.hh
martinhruska c1f4b16
making reviewrs happy
martinhruska eac2b49
Added documentation and removed obsolete struct OptionalValue
martinhruska File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* bdd-domain.hh -- Mintermization domain for BDD. | ||
* | ||
* This file is a part of libmata. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
|
||
#ifndef MATA_BDD_DOMAIN_HH | ||
#define MATA_BDD_DOMAIN_HH | ||
|
||
#include "mata/cudd/cuddObj.hh" | ||
|
||
namespace mata { | ||
struct BDDDomain { | ||
Cudd bdd_mng; // Manager of BDDs from lib cubdd, it allocates and manages BDDs. | ||
BDD val; | ||
|
||
BDDDomain() : bdd_mng(0), val(BDD()) {} | ||
|
||
BDDDomain(Cudd mng) : bdd_mng(mng), val(BDD()) {} | ||
|
||
BDDDomain(Cudd mng, BDD val) : bdd_mng(mng), val(val) {}; | ||
|
||
friend BDDDomain operator&&(const BDDDomain& lhs, const BDDDomain &rhs) { | ||
return {lhs.bdd_mng, lhs.val * rhs.val}; | ||
} | ||
|
||
friend BDDDomain operator||(const BDDDomain& lhs, const BDDDomain &rhs) { | ||
return {lhs.bdd_mng, lhs.val + rhs.val}; | ||
} | ||
|
||
friend BDDDomain operator!(const BDDDomain &lhs) { | ||
return {lhs.bdd_mng, !lhs.val}; | ||
} | ||
|
||
bool operator==(const BDDDomain &rhs) const { | ||
return this->val == rhs.val; | ||
} | ||
|
||
bool isFalse() const { | ||
return val.IsZero(); | ||
} | ||
|
||
BDDDomain get_true() const; | ||
BDDDomain get_false() const; | ||
BDDDomain get_var() const; | ||
}; | ||
} | ||
|
||
namespace std { | ||
template<> | ||
struct hash<struct mata::BDDDomain> { | ||
size_t operator()(const struct mata::BDDDomain &algebra) const noexcept { | ||
return hash<BDD>{}(algebra.val); | ||
} | ||
}; | ||
} | ||
|
||
#endif //LIBMATA_BDD_DOMAIN_HH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* bdd-domain.cc -- Mintermization domain for BDD. | ||
* | ||
* This file is a part of libmata. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
#include "mata/parser/bdd-domain.hh" | ||
|
||
struct mata::BDDDomain mata::BDDDomain::get_true() const { | ||
return BDDDomain(bdd_mng, bdd_mng.bddOne()); | ||
} | ||
|
||
struct mata::BDDDomain mata::BDDDomain::get_false() const { | ||
return BDDDomain(bdd_mng, bdd_mng.bddZero()); | ||
} | ||
|
||
struct mata::BDDDomain mata::BDDDomain::get_var() const { | ||
return BDDDomain(bdd_mng, bdd_mng.bddVar()); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.