Impulse Graph C++ Engine 2.4.0
High-Performance Zero-Copy C-ABI Kernel and C++20 Fluent VM Engine
Loading...
Searching...
No Matches
impulse_datalog.hpp
Go to the documentation of this file.
1
8
9#ifndef IMPULSE_DATALOG_HPP
10#define IMPULSE_DATALOG_HPP
11
12#include "impulse_compiler.hpp"
13#include <string>
14#include <vector>
15#include <unordered_map>
16#include <unordered_set>
17#include <memory>
18#include <sstream>
19#include <stdexcept>
20#include <algorithm>
21
23
25 std::string from;
26 std::string to;
27 bool is_negated{false};
28};
29
31public:
32 static constexpr size_t MAX_PARSE_DEPTH = 256;
33
34 static bool validate(const std::vector<DependencyEdge>& edges, std::string& error_msg) {
35 std::unordered_set<std::string> predicates;
36 std::unordered_map<std::string, std::vector<std::pair<std::string, bool>>> adj;
37
38 for (const auto& edge : edges) {
39 predicates.insert(edge.from);
40 predicates.insert(edge.to);
41 adj[edge.from].push_back({edge.to, edge.is_negated});
42 }
43
44 std::unordered_set<std::string> in_stack;
45 std::vector<std::pair<std::string, bool>> path;
46 std::unordered_set<std::string> memo_safe;
47
48 for (const auto& pred : predicates) {
49 if (memo_safe.find(pred) == memo_safe.end()) {
50 bool reaches_stack = false;
51 if (!dfs_check(pred, adj, in_stack, path, memo_safe, error_msg, reaches_stack, 0)) {
52 return false;
53 }
54 }
55 }
56 return true;
57 }
58
59 static bool is_recursive(const std::string& predicate, const std::vector<DependencyEdge>& edges) {
60 std::unordered_map<std::string, std::vector<std::string>> adj;
61 for (const auto& e : edges) {
62 if (!e.is_negated) {
63 adj[e.from].push_back(e.to);
64 }
65 }
66 std::unordered_set<std::string> visited;
67 std::vector<std::string> stack;
68 auto it = adj.find(predicate);
69 if (it != adj.end()) {
70 stack = it->second;
71 }
72 while (!stack.empty()) {
73 std::string cur = stack.back();
74 stack.pop_back();
75 if (cur == predicate) {
76 return true;
77 }
78 if (visited.insert(cur).second) {
79 auto nit = adj.find(cur);
80 if (nit != adj.end()) {
81 for (const auto& nxt : nit->second) {
82 stack.push_back(nxt);
83 }
84 }
85 }
86 }
87 return false;
88 }
89
90private:
91 static bool dfs_check(
92 const std::string& current,
93 const std::unordered_map<std::string, std::vector<std::pair<std::string, bool>>>& adj,
94 std::unordered_set<std::string>& in_stack,
95 std::vector<std::pair<std::string, bool>>& path,
96 std::unordered_set<std::string>& memo_safe,
97 std::string& error_msg,
98 bool& out_reaches_stack,
99 size_t depth = 0)
100 {
101 if (depth > MAX_PARSE_DEPTH) {
102 error_msg = "Datalog stratification recursion depth exceeded limit 256";
103 return false;
104 }
105
106 in_stack.insert(current);
107 bool reaches_stack = false;
108
109 auto it = adj.find(current);
110 if (it != adj.end()) {
111 for (const auto& edge : it->second) {
112 const std::string& next = edge.first;
113 bool is_negated = edge.second;
114 path.push_back({next, is_negated});
115
116 if (in_stack.find(next) != in_stack.end()) {
117 reaches_stack = true;
118 auto pos_it = std::find_if(path.begin(), path.end(), [&](const auto& p) { return p.first == next; });
119 if (pos_it != path.end()) {
120 bool has_negation = false;
121 for (auto iter = pos_it; iter != path.end(); ++iter) {
122 if (iter->second) { has_negation = true; break; }
123 }
124 if (has_negation) {
125 error_msg = "Non-stratifiable negation cycle detected involving predicate: " + next;
126 return false;
127 }
128 }
129 } else if (memo_safe.find(next) == memo_safe.end()) {
130 bool child_reaches_stack = false;
131 if (!dfs_check(next, adj, in_stack, path, memo_safe, error_msg, child_reaches_stack, depth + 1)) {
132 return false;
133 }
134 if (child_reaches_stack) {
135 reaches_stack = true;
136 }
137 }
138 path.pop_back();
139 }
140 }
141
142 in_stack.erase(current);
143 out_reaches_stack = reaches_stack;
144 if (!reaches_stack) {
145 memo_safe.insert(current);
146 }
147 return true;
148 }
149};
150
152public:
153 static std::pair<std::string, std::string> transform_query(const std::string& predicate, const std::string& bound_val) {
154 std::string magic_name = "m_" + predicate + "_b";
155 std::string magic_ast = "(magic:seed " + magic_name + " \"" + bound_val + "\")";
156 return {magic_name, magic_ast};
157 }
158
159 static std::pair<std::string, std::shared_ptr<impulse::compiler::ScmLaneInitSeeds>> transform_multi_seed(
160 const std::string& predicate,
161 const std::vector<uint64_t>& seeds,
162 uint16_t seed_reg = 0,
163 uint8_t width_flag = 0)
164 {
165 std::string magic_name = "m_" + predicate + "_lanes";
166 auto node = impulse::compiler::ScmLaneInitSeeds::from_inline_seeds(seeds, seed_reg, width_flag);
167 return {magic_name, node};
168 }
169
170 static std::shared_ptr<impulse::compiler::ScmLaneInitSeeds> transform_multi_seed(
171 const std::vector<uint64_t>& seeds,
172 uint16_t seed_reg = 0,
173 uint8_t width_flag = 0)
174 {
175 return impulse::compiler::ScmLaneInitSeeds::from_inline_seeds(seeds, seed_reg, width_flag);
176 }
177
178 static std::unordered_set<std::string> compute_reachable_predicates(
179 const std::string& query_predicate,
180 const std::vector<DependencyEdge>& edges)
181 {
182 std::unordered_set<std::string> reachable;
183 if (query_predicate.empty()) return reachable;
184 std::vector<std::string> queue;
185 reachable.insert(query_predicate);
186 queue.push_back(query_predicate);
187 while (!queue.empty()) {
188 std::string cur = queue.back();
189 queue.pop_back();
190 for (const auto& edge : edges) {
191 if (edge.from == cur && reachable.insert(edge.to).second) {
192 queue.push_back(edge.to);
193 }
194 }
195 }
196 return reachable;
197 }
198};
199
201public:
202 struct ParsedAtom {
203 std::string predicate;
204 std::vector<std::string> args;
205 bool negated{false};
206 bool reverse_direction{false};
207 };
208
209 struct ParsedRule {
210 std::string head_predicate;
211 std::vector<std::string> head_args;
212 std::vector<ParsedAtom> body;
213 };
214
215 static std::shared_ptr<impulse::compiler::ScmProgram> parse(const std::string& source) {
216 return compile_internal(source, {}, {}, 0, {});
217 }
218
219 static std::shared_ptr<impulse::compiler::ScmProgram> parse_multi_seed(
220 const std::string& source,
221 const std::vector<uint64_t>& seeds)
222 {
223 return compile_internal(source, seeds, {}, 0, {});
224 }
225
226 static std::shared_ptr<impulse::compiler::ScmProgram> parse_groups(
227 const std::string& source,
228 const std::vector<uint64_t>& node_group_pairs,
229 uint16_t num_groups)
230 {
231 return compile_internal(source, {}, node_group_pairs, num_groups, {});
232 }
233
234 static std::shared_ptr<impulse::compiler::ScmProgram> parse_allow_deny_split(
235 const std::string& source,
236 const std::vector<uint64_t>& allow_seeds,
237 const std::vector<uint64_t>& deny_seeds)
238 {
239 size_t half = std::max(allow_seeds.size(), deny_seeds.size());
240 if (half == 0 || half > 32) {
241 throw std::invalid_argument("Allow/deny split requires between 1 and 32 lanes per half");
242 }
243 std::vector<uint64_t> combined;
244 combined.reserve(half * 2);
245 for (size_t i = 0; i < half; ++i) {
246 combined.push_back(i < allow_seeds.size() ? allow_seeds[i] : 0ULL);
247 }
248 for (size_t i = 0; i < half; ++i) {
249 combined.push_back(i < deny_seeds.size() ? deny_seeds[i] : 0ULL);
250 }
251 auto base = compile_internal(source, combined, {}, 0, {});
252 std::vector<impulse::compiler::AstPtr> steps;
253 for (const auto& st : base->steps) {
254 if (st->kind() == impulse::compiler::NodeKind::COLLECT) {
255 steps.push_back(impulse::compiler::ScmLanePruneMask::allow_deny_split(static_cast<uint16_t>(half)));
256 }
257 steps.push_back(st);
258 }
259 return std::make_shared<impulse::compiler::ScmProgram>(std::move(steps));
260 }
261
262private:
263 static std::string trim_str(const std::string& s) {
264 size_t a = s.find_first_not_of(" \t\r\n");
265 if (a == std::string::npos) return "";
266 size_t b = s.find_last_not_of(" \t\r\n");
267 return s.substr(a, b - a + 1);
268 }
269
270 static std::string strip_inline_comment(const std::string& line) {
271 std::string out = line;
272 size_t slash = out.find("//");
273 if (slash != std::string::npos) out = out.substr(0, slash);
274 size_t pct = out.find('%');
275 if (pct != std::string::npos) out = out.substr(0, pct);
276 return out;
277 }
278
279 static std::vector<std::string> split_top_level_atoms(const std::string& body) {
280 std::vector<std::string> out;
281 int depth = 0;
282 size_t start = 0;
283 for (size_t i = 0; i < body.size(); ++i) {
284 char c = body[i];
285 if (c == '(') depth++;
286 else if (c == ')') depth = std::max(0, depth - 1);
287 else if (c == ',' && depth == 0) {
288 std::string token = trim_str(body.substr(start, i - start));
289 if (!token.empty()) out.push_back(token);
290 start = i + 1;
291 }
292 }
293 if (start < body.size()) {
294 std::string token = trim_str(body.substr(start));
295 if (!token.empty()) out.push_back(token);
296 }
297 return out;
298 }
299
300 static ParsedAtom parse_atom(const std::string& raw) {
301 std::string t = trim_str(raw);
302 bool neg = false;
303 if (t.starts_with("!")) {
304 neg = true;
305 t = trim_str(t.substr(1));
306 } else if (t.starts_with("not ") || t.starts_with("not\t") || t.starts_with("NOT ") || t.starts_with("NOT\t")) {
307 neg = true;
308 t = trim_str(t.substr(4));
309 }
310
311 bool rev = false;
312 if (t.starts_with("^") || t.starts_with("~")) {
313 rev = true;
314 t = trim_str(t.substr(1));
315 }
316
317 size_t lp = t.find('(');
318 size_t rp = t.rfind(')');
319 std::string pred;
320 std::vector<std::string> args;
321 if (lp != std::string::npos) {
322 pred = trim_str(t.substr(0, lp));
323 if (rp != std::string::npos && rp > lp + 1) {
324 std::string arg_str = t.substr(lp + 1, rp - lp - 1);
325 std::istringstream as(arg_str);
326 std::string tok;
327 while (std::getline(as, tok, ',')) {
328 std::string clean = trim_str(tok);
329 if (!clean.empty()) args.push_back(clean);
330 }
331 }
332 } else {
333 pred = trim_str(t);
334 }
335 pred.erase(std::remove_if(pred.begin(), pred.end(), ::isspace), pred.end());
336 return {pred, args, neg, rev};
337 }
338
339 static bool try_parse_u64(const std::string& tok, uint64_t& out) {
340 std::string clean = trim_str(tok);
341 if (clean.empty()) return false;
342 for (char c : clean) {
343 if (!std::isdigit(static_cast<unsigned char>(c))) return false;
344 }
345 out = std::stoull(clean);
346 return true;
347 }
348
349 static void parse_fact_or_directive(
350 const std::string& line,
351 std::vector<uint64_t>& seeds,
352 std::vector<uint64_t>& group_pairs,
353 std::vector<uint64_t>& deny_nodes,
354 uint16_t& allow_deny_half)
355 {
356 std::string s = line;
357 while (!s.empty() && (s.back() == '.' || std::isspace(static_cast<unsigned char>(s.back())))) {
358 s.pop_back();
359 }
360 if (!s.empty() && s.front() == '.') {
361 s = trim_str(s.substr(1));
362 }
363 if (s.empty()) return;
364
365 ParsedAtom atom = parse_atom(s);
366 std::string lower_pred = atom.predicate;
367 std::transform(lower_pred.begin(), lower_pred.end(), lower_pred.begin(),
368 [](unsigned char c) { return static_cast<char>(std::tolower(c)); });
369
370 if (lower_pred == "seed" || lower_pred == "seeds") {
371 for (const auto& a : atom.args) {
372 uint64_t v = 0;
373 if (try_parse_u64(a, v)) seeds.push_back(v);
374 }
375 } else if (lower_pred == "group" || lower_pred == "groups") {
376 if (atom.args.size() >= 2) {
377 uint64_t u = 0, g = 0;
378 if (try_parse_u64(atom.args[0], u) && try_parse_u64(atom.args[1], g)) {
379 group_pairs.push_back(u);
380 group_pairs.push_back(g);
381 }
382 }
383 } else if (lower_pred == "denied" || lower_pred == "deny") {
384 for (const auto& a : atom.args) {
385 uint64_t v = 0;
386 if (try_parse_u64(a, v)) deny_nodes.push_back(v);
387 }
388 } else if (lower_pred == "rebac_allow_deny" || lower_pred == "allow_deny_split") {
389 if (!atom.args.empty()) {
390 uint64_t v = 0;
391 if (try_parse_u64(atom.args[0], v)) allow_deny_half = static_cast<uint16_t>(v);
392 }
393 }
394 }
395
396 static std::shared_ptr<impulse::compiler::ScmProgram> compile_internal(
397 const std::string& source,
398 const std::vector<uint64_t>& explicit_seeds,
399 const std::vector<uint64_t>& explicit_group_pairs,
400 uint16_t explicit_num_groups,
401 const std::vector<uint64_t>& explicit_deny_nodes)
402 {
403 std::vector<uint64_t> seeds = explicit_seeds;
404 std::vector<uint64_t> group_pairs = explicit_group_pairs;
405 std::vector<uint64_t> deny_nodes = explicit_deny_nodes;
406 uint16_t allow_deny_half = 0;
407
408 std::vector<ParsedRule> rules;
409 std::vector<DependencyEdge> edges;
410
411 std::istringstream stream(source);
412 std::string raw_line;
413 while (std::getline(stream, raw_line)) {
414 std::string trimmed = trim_str(strip_inline_comment(raw_line));
415 if (trimmed.empty() || trimmed.starts_with("//") || trimmed.starts_with("%") ||
416 trimmed.starts_with("#") || trimmed.starts_with(".decl") || trimmed.starts_with("?-")) {
417 continue;
418 }
419
420 size_t arrow_pos = trimmed.find(":-");
421 if (arrow_pos == std::string::npos) {
422 parse_fact_or_directive(trimmed, seeds, group_pairs, deny_nodes, allow_deny_half);
423 continue;
424 }
425
426 std::string head_str = trim_str(trimmed.substr(0, arrow_pos));
427 std::string body_str = trim_str(trimmed.substr(arrow_pos + 2));
428 while (!body_str.empty() && (body_str.back() == '.' || std::isspace(static_cast<unsigned char>(body_str.back())))) {
429 body_str.pop_back();
430 }
431
432 ParsedAtom head_atom = parse_atom(head_str);
433 if (head_atom.predicate.empty()) continue;
434
435 auto raw_terms = split_top_level_atoms(body_str);
436 std::vector<ParsedAtom> body_atoms;
437 for (const auto& rt : raw_terms) {
438 ParsedAtom atom = parse_atom(rt);
439 if (!atom.predicate.empty()) {
440 body_atoms.push_back(atom);
441 edges.push_back({head_atom.predicate, atom.predicate, atom.negated});
442 }
443 }
444 rules.push_back({head_atom.predicate, head_atom.args, std::move(body_atoms)});
445 }
446
447 std::string strat_err;
448 if (!StratificationValidator::validate(edges, strat_err)) {
449 throw std::runtime_error("Datalog Stratification Error: " + strat_err);
450 }
451
452 uint16_t max_group_plus_one = explicit_num_groups;
453 for (size_t i = 1; i < group_pairs.size(); i += 2) {
454 uint16_t g1 = static_cast<uint16_t>(group_pairs[i] + 1);
455 if (g1 > max_group_plus_one) max_group_plus_one = g1;
456 }
457 bool multi_lane = !seeds.empty() || !group_pairs.empty() || allow_deny_half > 0;
458
459 std::unordered_map<std::string, std::vector<ParsedRule>> rules_by_head;
460 std::vector<std::string> head_order;
461 for (const auto& r : rules) {
462 if (rules_by_head.find(r.head_predicate) == rules_by_head.end()) {
463 head_order.push_back(r.head_predicate);
464 }
465 rules_by_head[r.head_predicate].push_back(r);
466 }
467
468 std::unordered_set<std::string> recursive_preds;
469 for (const auto& hp : head_order) {
471 recursive_preds.insert(hp);
472 }
473 }
474
475 std::vector<impulse::compiler::AstPtr> steps;
476 if (!group_pairs.empty()) {
478 group_pairs, std::max<uint16_t>(1, max_group_plus_one)));
479 } else if (!seeds.empty() || allow_deny_half > 0) {
481 }
482
483 std::unordered_set<std::string> emitted_recursive_rels;
484 std::vector<std::string> negated_preds;
485
486 for (const auto& rule : rules) {
487 bool rule_is_recursive = recursive_preds.count(rule.head_predicate) > 0;
488 for (const auto& atom : rule.body) {
489 if (atom.negated) {
490 negated_preds.push_back(atom.predicate);
491 continue;
492 }
493 if (atom.predicate == rule.head_predicate) {
494 continue;
495 }
496 if (rules_by_head.count(atom.predicate) > 0 && recursive_preds.count(atom.predicate) == 0) {
497 // Derived non-recursive IDB predicate already expanded by its own rule
498 continue;
499 }
500 auto dir = atom.reverse_direction
503
504 if (multi_lane) {
505 if (!rule_is_recursive || emitted_recursive_rels.insert(atom.predicate).second) {
506 steps.push_back(std::make_shared<impulse::compiler::ScmLaneWalk>(
507 atom.predicate, -1, dir, rule_is_recursive, rule_is_recursive ? 0x04 : 0x00));
508 }
509 } else {
510 if (rule_is_recursive) {
511 if (emitted_recursive_rels.insert(atom.predicate).second) {
512 auto inner_walk = (dir == impulse::compiler::WalkDirection::REVERSE_CSC)
514 : impulse::compiler::ScmWalk::forward(atom.predicate);
515 steps.push_back(std::make_shared<impulse::compiler::ScmFixpoint>(
517 }
518 } else {
521 : impulse::compiler::ScmWalk::forward(atom.predicate);
522 steps.push_back(w);
523 }
524 }
525 }
526 }
527
528 if (multi_lane) {
529 if (allow_deny_half > 0) {
530 steps.push_back(impulse::compiler::ScmLanePruneMask::allow_deny_split(allow_deny_half));
531 } else if (!deny_nodes.empty()) {
533 } else if (!negated_preds.empty()) {
535 }
536 } else if (!negated_preds.empty()) {
537 if (steps.empty()) {
538 steps.push_back(impulse::compiler::ScmWalk::forward("default"));
539 }
540 impulse::compiler::AstPtr pos_node = (steps.size() == 1)
541 ? steps[0]
542 : std::make_shared<impulse::compiler::ScmProgram>(steps);
543 steps.clear();
544 for (const auto& neg_pred : negated_preds) {
546 pos_node, impulse::compiler::ScmWalk::forward(neg_pred));
547 }
548 steps.push_back(pos_node);
549 }
550
551 if (steps.empty()) {
552 steps.push_back(impulse::compiler::ScmWalk::forward("default"));
553 }
554 steps.push_back(impulse::compiler::ScmCollect::bitset());
555 IMPULSE_ASSERT(!steps.empty());
557 return std::make_shared<impulse::compiler::ScmProgram>(steps);
558 }
559};
560
561} // namespace impulse::datalog
562
563#endif // IMPULSE_DATALOG_HPP
static std::shared_ptr< ScmCollect > bitset(uint16_t reg=0)
Definition impulse_scm_ast.hpp:654
static std::shared_ptr< ScmLaneInitGroups > from_inline_pairs(std::vector< uint64_t > pairs, uint16_t ngroups, uint16_t preg=0)
Definition impulse_scm_ast.hpp:423
static std::shared_ptr< ScmLaneInitSeeds > from_inline_seeds(std::vector< uint64_t > seeds, uint16_t sreg=0, uint8_t wflag=0)
Definition impulse_scm_ast.hpp:399
static std::shared_ptr< ScmLanePruneMask > from_register(uint16_t mask_reg=0, uint8_t m=0)
Definition impulse_scm_ast.hpp:526
static std::shared_ptr< ScmLanePruneMask > allow_deny_split(uint16_t half_lanes)
Definition impulse_scm_ast.hpp:538
static std::shared_ptr< ScmLanePruneMask > from_inline_deny(std::vector< uint64_t > deny_nodes, uint16_t mask_reg=0)
Definition impulse_scm_ast.hpp:530
static std::shared_ptr< ScmProgram > of(Args &&... args)
Definition impulse_scm_ast.hpp:805
static std::shared_ptr< ScmSetOp > diff(AstPtr l, AstPtr r)
Definition impulse_scm_ast.hpp:775
static std::shared_ptr< ScmWalk > forward(std::string rel, AstPtr pred=nullptr)
Definition impulse_scm_ast.hpp:322
static std::shared_ptr< ScmWalk > reverse(std::string rel, AstPtr pred=nullptr)
Definition impulse_scm_ast.hpp:330
Definition impulse_datalog.hpp:200
static std::shared_ptr< impulse::compiler::ScmProgram > parse(const std::string &source)
Definition impulse_datalog.hpp:215
static std::shared_ptr< impulse::compiler::ScmProgram > parse_groups(const std::string &source, const std::vector< uint64_t > &node_group_pairs, uint16_t num_groups)
Definition impulse_datalog.hpp:226
static std::shared_ptr< impulse::compiler::ScmProgram > parse_multi_seed(const std::string &source, const std::vector< uint64_t > &seeds)
Definition impulse_datalog.hpp:219
static std::shared_ptr< impulse::compiler::ScmProgram > parse_allow_deny_split(const std::string &source, const std::vector< uint64_t > &allow_seeds, const std::vector< uint64_t > &deny_seeds)
Definition impulse_datalog.hpp:234
Definition impulse_datalog.hpp:151
static std::pair< std::string, std::string > transform_query(const std::string &predicate, const std::string &bound_val)
Definition impulse_datalog.hpp:153
static std::pair< std::string, std::shared_ptr< impulse::compiler::ScmLaneInitSeeds > > transform_multi_seed(const std::string &predicate, const std::vector< uint64_t > &seeds, uint16_t seed_reg=0, uint8_t width_flag=0)
Definition impulse_datalog.hpp:159
static std::unordered_set< std::string > compute_reachable_predicates(const std::string &query_predicate, const std::vector< DependencyEdge > &edges)
Definition impulse_datalog.hpp:178
static std::shared_ptr< impulse::compiler::ScmLaneInitSeeds > transform_multi_seed(const std::vector< uint64_t > &seeds, uint16_t seed_reg=0, uint8_t width_flag=0)
Definition impulse_datalog.hpp:170
Definition impulse_datalog.hpp:30
static bool validate(const std::vector< DependencyEdge > &edges, std::string &error_msg)
Definition impulse_datalog.hpp:34
static constexpr size_t MAX_PARSE_DEPTH
Definition impulse_datalog.hpp:32
static bool is_recursive(const std::string &predicate, const std::vector< DependencyEdge > &edges)
Definition impulse_datalog.hpp:59
#define IMPULSE_ASSERT(cond)
Definition impulse_assert.h:168
#define IMPULSE_AUDIT_ASSERT(cond)
Definition impulse_assert.h:223
Zero-Dependency C++20 Optimizing Compiler Pipeline & ImpScheme IR for Impulse Graph.
std::shared_ptr< ImpScmNode > AstPtr
Definition impulse_scm_ast.hpp:159
@ COLLECT
Definition impulse_scm_ast.hpp:95
@ FORWARD_CSR
Definition impulse_scm_ast.hpp:124
@ REVERSE_CSC
Definition impulse_scm_ast.hpp:125
Definition impulse_datalog.hpp:22
Definition impulse_datalog.hpp:202
bool negated
Definition impulse_datalog.hpp:205
std::string predicate
Definition impulse_datalog.hpp:203
bool reverse_direction
Definition impulse_datalog.hpp:206
std::vector< std::string > args
Definition impulse_datalog.hpp:204
Definition impulse_datalog.hpp:209
std::vector< std::string > head_args
Definition impulse_datalog.hpp:211
std::vector< ParsedAtom > body
Definition impulse_datalog.hpp:212
std::string head_predicate
Definition impulse_datalog.hpp:210
Definition impulse_datalog.hpp:24
std::string to
Definition impulse_datalog.hpp:26
std::string from
Definition impulse_datalog.hpp:25
bool is_negated
Definition impulse_datalog.hpp:27