aboutsummaryrefslogtreecommitdiff
path: root/src/infer/substitution.cc
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-04-07 03:59:58 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-04-07 03:59:58 +0800
commit5ab3efd522cf0221481684b5bbc9c2ac6bfc9919 (patch)
tree9c521dedd2bc49bdbac642a0640dd048b6d8e4a1 /src/infer/substitution.cc
parentbf4f464cec8b6515d9e5131d43847ef9b2fd21d1 (diff)
downloadratp-5ab3efd522cf0221481684b5bbc9c2ac6bfc9919.tar.gz
ratp-5ab3efd522cf0221481684b5bbc9c2ac6bfc9919.tar.xz
refactor: rename struct members to follow trailing underscore naming convention across core, search, and frontend components
Diffstat (limited to 'src/infer/substitution.cc')
-rw-r--r--src/infer/substitution.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/infer/substitution.cc b/src/infer/substitution.cc
index a7ce617..8710fb0 100644
--- a/src/infer/substitution.cc
+++ b/src/infer/substitution.cc
@@ -22,6 +22,8 @@
#include "atp/core/term_bank.h"
#include "atp/core/types.h"
+#include <vector>
+
namespace atp {
bool Substitution::bind(TermId var, TermId term) {
@@ -66,8 +68,8 @@ TermId Substitution::apply(TermId term, TermBank& bank) const {
// IMPORTANT: Copy symbol_id and args BEFORE recursing.
// Recursive apply() calls may trigger bank.makeTerm() → realloc → dangling ref.
const Term& t = bank.getTerm(term);
- SymbolId sym = t.symbol_id;
- std::vector<TermId> old_args(t.args); // copy!
+ SymbolId const sym = t.symbol_id_;
+ std::vector<TermId> const old_args(t.args_); // copy!
if (old_args.empty()) {
// Constant or 0-arity — no substitution needed
@@ -78,8 +80,8 @@ TermId Substitution::apply(TermId term, TermBank& bank) const {
std::vector<TermId> new_args;
new_args.reserve(old_args.size());
bool changed = false;
- for (TermId arg : old_args) {
- TermId new_arg = apply(arg, bank);
+ for (TermId const arg : old_args) {
+ TermId const new_arg = apply(arg, bank);
new_args.push_back(new_arg);
if (new_arg != arg) {
changed = true;
@@ -105,7 +107,7 @@ bool Substitution::occursIn(TermId var, TermId term, const TermBank& bank) const
}
const Term& t = bank.getTerm(term);
- for (TermId arg : t.args) {
+ for (TermId const arg : t.args_) {
if (occursIn(var, arg, bank)) {
return true;
}