Skip to content

Commit 15b848a

Browse files
committed
Fixed bugs
1 parent dcf2706 commit 15b848a

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $ cmake -DCMAKE_BUILD_TYPE=Release -B build
1010
$ cmake --build build
1111
$ cmake --install build
1212
```
13-
**NOTE:** [CMake](https://cmake.org/) >= 3.11 and [Boost C++ Libraries](https://www.boost.org/) >= 1.72.0 are required.
13+
**NOTE:** [CMake](https://cmake.org/) >= 3.20 and [Boost C++ Libraries](https://www.boost.org/) >= 1.72.0 are required.
1414

1515
## Usage
1616
Open your terminal and type:
@@ -19,7 +19,7 @@ $ qasp [OPTIONS] SOURCES...
1919
```
2020
Or read from *stdin*
2121
```shell script
22-
$ cat SOURCES | qasp
22+
$ cat SOURCE | qasp
2323
```
2424
**NOTE:** type ```qasp --help``` for more information.
2525

@@ -34,7 +34,7 @@ d :- b.
3434
%@constraints
3535
:- c, not d.
3636
```
37-
Calculate if exists an *answer set* of **@exists fragment** such that for each *answer set* of **@forall fragmemt** is a *coherent* solution.
37+
Calculate if exists an *answer set* of **@exists program** such that for each *answer set* of **@forall program** is a *coherent* solution.
3838
```shell script
3939
$ qasp program.asp
4040
```

src/qasp/Program.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ namespace qasp {
114114
ProgramType __type;
115115
std::string __source;
116116
std::string __ground;
117-
Assumptions __assumptions;
118117
std::vector<Program> __subprograms;
119-
std::unordered_map<std::string, Atom> __atoms;
120-
atom_index_t __atoms_index_offset;
121-
bool __last;
118+
119+
std::unordered_map<std::string, Atom> __atoms {};
120+
atom_index_t __atoms_index_offset = 0;
121+
Assumptions __assumptions {};
122+
bool __last = false;
122123

123124

124125
inline const atom_index_t map_index(const Atom& atom) const { __PERF_INC(mapping);

src/qasp/QaspSolver.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ bool QaspSolver::get_coherent_answer(const Program& program, const std::vector<A
130130
// FIXME: evalute if checking can be anticipated
131131
bool should_not_check = !program.last();
132132

133+
LOG(__FILE__, TRACE) << "PROGRAM LAST: " << program.last() << std::endl;
134+
133135

134136
size_t incoherencies = 0;
135137

src/qasp/QaspSolver.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ namespace qasp {
6464
Qasp __qasp;
6565
Program __program;
6666
ProgramModel __model;
67-
std::optional<Program> __constraint;
68-
std::vector<AnswerSet> __solution;
67+
std::optional<Program> __constraint {};
68+
std::vector<AnswerSet> __solution {};
6969

7070
void init();
7171
bool check(const AnswerSet& answer) const;

src/qasp/grounder/Grounder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace qasp::grounder {
4141
virtual std::string execute(const std::string& source) const = 0;
4242

4343
private:
44-
qasp::utils::Cache<std::size_t, std::string> cache;
44+
qasp::utils::Cache<std::size_t, std::string> cache {};
4545

4646

4747
};

src/qasp/utils/Cache.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace qasp::utils {
6565

6666
private:
6767

68-
std::mutex m_lock;
68+
std::mutex m_lock {};
6969

7070
};
7171

src/qasp/utils/Executor.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ namespace qasp::utils {
7070
std::atomic<bool> __alive;
7171

7272

73-
std::deque<std::tuple<std::function<R(T...)>, T...> pending;
74-
std::deque<std::thread> units;
73+
std::deque<std::tuple<std::function<R(T...)>, T...> pending {};
74+
std::deque<std::thread> units {};
7575

76-
std::condition_variable cv_status;
76+
std::condition_variable cv_status {};
7777

78-
std::mutex mx_status;
79-
std::mutex mx_pending;
78+
std::mutex mx_status {};
79+
std::mutex mx_pending {};
8080

8181

8282
inline void init() {

0 commit comments

Comments
 (0)