@@ -80,7 +80,7 @@ bool bind(const T& a, const T& b) {
8080}
8181
8282template <typename T>
83- bool bind (const T& a, Variable<T>* b) {
83+ bool bind (const T& a, Variable<T>* const b) {
8484 if (b->isBound ()) {
8585 return b->value () == a;
8686 }
@@ -89,13 +89,13 @@ bool bind(const T& a, Variable<T>* b) {
8989}
9090
9191template <typename GROUND_TYPE, typename ... Ts, size_t ... Is>
92- bool bind (const GROUND_TYPE &fact, tuple<Ts...> &atom, index_sequence<Is...>)
92+ bool bind (const GROUND_TYPE &fact, const tuple<Ts...> &atom, index_sequence<Is...>)
9393{
9494 return ((bind (get<Is>(fact), get<Is>(atom))) and ...);
9595}
9696
9797template <typename GROUND_TYPE, typename ... Ts>
98- bool bind (const GROUND_TYPE &fact, tuple<Ts...> &atom)
98+ bool bind (const GROUND_TYPE &fact, const tuple<Ts...> &atom)
9999{
100100 return bind (fact, atom, make_index_sequence<tuple_size<GROUND_TYPE>::value>{});
101101}
@@ -548,7 +548,7 @@ void unbind(const typename RULE_INSTANCE_TYPE::BodyType &atoms)
548548}
549549
550550template <size_t I, typename RULE_INSTANCE_TYPE, typename RULE_TYPE>
551- bool bindBodyAtomsToSlice (typename RULE_INSTANCE_TYPE::BodyType &atoms,
551+ bool bindBodyAtomsToSlice (const typename RULE_INSTANCE_TYPE::BodyType &atoms,
552552 const typename RULE_TYPE::SliceType &slice)
553553{
554554 auto factPtr = get<I>(slice);
@@ -565,14 +565,14 @@ bool bindBodyAtomsToSlice(typename RULE_INSTANCE_TYPE::BodyType &atoms,
565565}
566566
567567template <typename RULE_INSTANCE_TYPE, typename RULE_TYPE, size_t ... Is>
568- bool bindBodyAtomsToSlice (typename RULE_INSTANCE_TYPE::BodyType &atoms,
568+ bool bindBodyAtomsToSlice (const typename RULE_INSTANCE_TYPE::BodyType &atoms,
569569 const typename RULE_TYPE::SliceType &slice, index_sequence<Is...>)
570570{
571571 return ((bindBodyAtomsToSlice<Is, RULE_INSTANCE_TYPE, RULE_TYPE>(atoms, slice)) and ...);
572572}
573573
574574template <typename RULE_INSTANCE_TYPE, typename RULE_TYPE>
575- bool bindBodyAtomsToSlice (typename RULE_INSTANCE_TYPE::BodyType &atoms, const typename RULE_TYPE::SliceType &slice)
575+ bool bindBodyAtomsToSlice (const typename RULE_INSTANCE_TYPE::BodyType &atoms, const typename RULE_TYPE::SliceType &slice)
576576{
577577 // for each atom, bind with corresponding relation type in slice
578578 return bindBodyAtomsToSlice<RULE_INSTANCE_TYPE, RULE_TYPE>(atoms, slice, make_index_sequence<tuple_size<typename RULE_INSTANCE_TYPE::BodyType>::value>{});
0 commit comments