@@ -40,26 +40,26 @@ struct Variable : optional<T>
40
40
};
41
41
42
42
template <typename T>
43
- static void unbind1 (Variable<T>* t) {
43
+ static void unbind (Variable<T>* t) {
44
44
t->unbind ();
45
45
}
46
46
47
47
template <typename T>
48
- static void unbind1 (const T& t) {}
48
+ static void unbind (const T& t) {}
49
49
50
50
template <typename ... Ts>
51
- static void unbind1 (const tuple<Ts...> &tuple)
51
+ static void unbind (const tuple<Ts...> &tuple)
52
52
{
53
- apply ([](auto &&... args) { ((unbind1 (args), ...)); }, tuple);
53
+ apply ([](auto &&... args) { ((unbind (args), ...)); }, tuple);
54
54
}
55
55
56
56
template <typename T>
57
- static bool bind1 (const T& a, const T& b) {
57
+ static bool bind (const T& a, const T& b) {
58
58
return a == b;
59
59
}
60
60
61
61
template <typename T>
62
- static bool bind1 (const T& a, Variable<T>* b) {
62
+ static bool bind (const T& a, Variable<T>* b) {
63
63
if (b->isBound ()) {
64
64
return b->value () == a;
65
65
}
@@ -68,41 +68,41 @@ static bool bind1(const T& a, Variable<T>* b) {
68
68
}
69
69
70
70
template <typename GROUND_TYPE, typename ... Ts, size_t ... Is>
71
- static bool bind1 (const GROUND_TYPE &fact, tuple<Ts...> &atom, index_sequence<Is...>)
71
+ static bool bind (const GROUND_TYPE &fact, tuple<Ts...> &atom, index_sequence<Is...>)
72
72
{
73
- return ((bind1 (get<Is>(fact), get<Is>(atom))) and ...);
73
+ return ((bind (get<Is>(fact), get<Is>(atom))) and ...);
74
74
}
75
75
76
76
template <typename GROUND_TYPE, typename ... Ts>
77
- static bool bind1 (const GROUND_TYPE &fact, tuple<Ts...> &atom)
77
+ static bool bind (const GROUND_TYPE &fact, tuple<Ts...> &atom)
78
78
{
79
- return bind1 (fact, atom, make_index_sequence<tuple_size<GROUND_TYPE>::value>{});
79
+ return bind (fact, atom, make_index_sequence<tuple_size<GROUND_TYPE>::value>{});
80
80
}
81
81
82
82
template <typename T>
83
- static void ground1 (const Variable<T>* s, T &v)
83
+ static void ground (const Variable<T>* s, T &v)
84
84
{
85
85
assert (s->isBound ());
86
86
v = s->value ();
87
87
}
88
88
89
89
template <typename T>
90
- static void ground1 (const T &s, T &v)
90
+ static void ground (const T &s, T &v)
91
91
{
92
92
v = s;
93
93
}
94
94
95
95
template <typename RELATION_TYPE, typename ... Ts, size_t ... Is>
96
- static void ground1 (const tuple<Ts...> &atom, typename RELATION_TYPE::Ground &groundAtom, index_sequence<Is...>)
96
+ static void ground (const tuple<Ts...> &atom, typename RELATION_TYPE::Ground &groundAtom, index_sequence<Is...>)
97
97
{
98
- ((ground1 (get<Is>(atom), get<Is>(groundAtom))), ...);
98
+ ((ground (get<Is>(atom), get<Is>(groundAtom))), ...);
99
99
}
100
100
101
101
template <typename RELATION_TYPE, typename ... Ts>
102
- static typename RELATION_TYPE::Ground ground1 (const tuple<Ts...> &atom)
102
+ static typename RELATION_TYPE::Ground ground (const tuple<Ts...> &atom)
103
103
{
104
104
typename RELATION_TYPE::Ground groundAtom;
105
- ground1 <RELATION_TYPE>(atom, groundAtom, make_index_sequence<tuple_size<typename RELATION_TYPE::Ground>::value>{});
105
+ ground <RELATION_TYPE>(atom, groundAtom, make_index_sequence<tuple_size<typename RELATION_TYPE::Ground>::value>{});
106
106
return groundAtom;
107
107
}
108
108
@@ -436,7 +436,7 @@ ostream & operator<<(ostream &out, const State<RELATIONs...>& state) {
436
436
template <typename RULE_INSTANCE_TYPE>
437
437
static void unbind (const typename RULE_INSTANCE_TYPE::BodyType &atoms)
438
438
{
439
- apply ([](auto &&... args) { ((unbind1 (args)), ...); }, atoms);
439
+ apply ([](auto &&... args) { ((unbind (args)), ...); }, atoms);
440
440
}
441
441
442
442
template <size_t I, typename RULE_INSTANCE_TYPE, typename RULE_TYPE>
@@ -451,7 +451,7 @@ static bool bindBodyAtomsToSlice(typename RULE_INSTANCE_TYPE::BodyType &atoms,
451
451
// get the atom
452
452
auto &atom = get<I>(atoms);
453
453
// try to bind the atom with the fact
454
- success = bind1 (fact.second , atom);
454
+ success = bind (fact.second , atom);
455
455
}
456
456
return success;
457
457
}
@@ -548,7 +548,7 @@ static RelationSet<typename RULE_TYPE::RuleType::HeadRelationType> applyRule(
548
548
if (bindBodyAtomsToSlice<RULE_TYPE, typename RULE_TYPE::RuleType>(rule.body , slice))
549
549
{
550
550
// successful bind, therefore add (grounded) head atom to new state
551
- derivedFacts.set .insert ({iteration + 1 , ground1 <HeadRelationType>(rule.head )});
551
+ derivedFacts.set .insert ({iteration + 1 , ground <HeadRelationType>(rule.head )});
552
552
}
553
553
}
554
554
}
0 commit comments