Skip to content
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

Feature/overflow #463

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
[submodule "third_party/variant"]
path = third_party/variant
url = ../../mpark/variant.git
[submodule "third_party/wide-integer"]
path = third_party/wide-integer
url = ../../ckormanyos/wide-integer.git
2 changes: 1 addition & 1 deletion libgringo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ set(source
# ]]]

add_library(libgringo STATIC ${header} ${source})
target_link_libraries(libgringo PUBLIC libpotassco libreify tsl::ordered_map tsl::hopscotch_map tsl::sparse_map tl::optional mpark::variant)
target_link_libraries(libgringo PUBLIC libpotassco libreify tsl::ordered_map tsl::hopscotch_map tsl::sparse_map tl::optional mpark::variant math::wide_integer)
target_include_directories(libgringo
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
Expand Down
7 changes: 2 additions & 5 deletions libgringo/gringo/term.hh
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private:
};

struct IETerm {
int coefficient{0};
int64_t coefficient{0};
VarTerm const *variable{nullptr};
};
using IETermVec = std::vector<IETerm>;
Expand All @@ -203,7 +203,7 @@ void subIETerm(IETermVec &terms, IETerm const &term);

struct IE {
IETermVec terms;
int bound;
int64_t bound;
};
using IEVec = std::vector<IE>;

Expand Down Expand Up @@ -259,10 +259,7 @@ public:
void compute();

private:
enum class UpdateResult { changed, unchanged, overflow };
using SubSolvers = std::forward_list<IESolver>;
UpdateResult update_bound_(IETerm const &term, int64_t slack, int num_unbounded);
bool update_slack_(IETerm const &term, int64_t &slack, int &num_unbounded);

IESolver *parent_;
IEContext &ctx_;
Expand Down
Loading