aboutsummaryrefslogtreecommitdiff
path: root/include/atp/core
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 /include/atp/core
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 'include/atp/core')
-rw-r--r--include/atp/core/clause.h16
-rw-r--r--include/atp/core/literal.h6
-rw-r--r--include/atp/core/symbol_table.h8
-rw-r--r--include/atp/core/term.h6
-rw-r--r--include/atp/core/term_bank.h10
5 files changed, 23 insertions, 23 deletions
diff --git a/include/atp/core/clause.h b/include/atp/core/clause.h
index 7e0cbff..6387adf 100644
--- a/include/atp/core/clause.h
+++ b/include/atp/core/clause.h
@@ -33,20 +33,20 @@ namespace atp {
/// A clause: a disjunction of literals plus provenance for proof reconstruction.
struct Clause {
- ClauseId id = kInvalidId;
- std::vector<Literal> literals;
+ ClauseId id_ = kInvalidId;
+ std::vector<Literal> literals_;
// Provenance (for proof trace)
- InferenceRule rule = InferenceRule::kInput;
- ClauseId parent1 = kInvalidId;
- ClauseId parent2 = kInvalidId;
- uint16_t depth = 0; ///< Derivation depth (for BFS scheduling)
+ InferenceRule rule_ = InferenceRule::kInput;
+ ClauseId parent1_ = kInvalidId;
+ ClauseId parent2_ = kInvalidId;
+ uint16_t depth_ = 0; ///< Derivation depth (for BFS scheduling)
/// True if the clause has no literals (contradiction).
- [[nodiscard]] bool isEmpty() const { return literals.empty(); }
+ [[nodiscard]] bool isEmpty() const { return literals_.empty(); }
/// Number of literals.
- [[nodiscard]] size_t size() const { return literals.size(); }
+ [[nodiscard]] size_t size() const { return literals_.size(); }
};
} // namespace atp
diff --git a/include/atp/core/literal.h b/include/atp/core/literal.h
index 212c281..e58b185 100644
--- a/include/atp/core/literal.h
+++ b/include/atp/core/literal.h
@@ -27,11 +27,11 @@ namespace atp {
/// A literal: a polarity flag plus the TermId of the atom.
struct Literal {
- TermId atom; ///< TermId of the predicate application
- bool is_positive; ///< true = positive, false = negated
+ TermId atom_; ///< TermId of the predicate application
+ bool is_positive_; ///< true = positive, false = negated
/// Complement: flip polarity, same atom.
- [[nodiscard]] Literal complement() const { return {.atom = atom, .is_positive = !is_positive}; }
+ [[nodiscard]] Literal complement() const { return {.atom_ = atom_, .is_positive_ = !is_positive_}; }
bool operator==(const Literal& other) const = default;
};
diff --git a/include/atp/core/symbol_table.h b/include/atp/core/symbol_table.h
index 30453fc..a646f78 100644
--- a/include/atp/core/symbol_table.h
+++ b/include/atp/core/symbol_table.h
@@ -33,10 +33,10 @@ namespace atp {
/// Metadata associated with an interned symbol.
struct SymbolInfo {
- std::string name;
- SymbolKind kind = SymbolKind::kFunction;
- uint16_t arity = 0;
- SortId sort = kUnsorted; ///< Result sort (for sorted logic)
+ std::string name_;
+ SymbolKind kind_ = SymbolKind::kFunction;
+ uint16_t arity_ = 0;
+ SortId sort_ = kUnsorted; ///< Result sort (for sorted logic)
};
/// Interns symbol names so that each unique string is stored exactly once.
diff --git a/include/atp/core/term.h b/include/atp/core/term.h
index 2be01e7..d35c753 100644
--- a/include/atp/core/term.h
+++ b/include/atp/core/term.h
@@ -33,11 +33,11 @@ namespace atp {
/// A term is a function/predicate application: f(t1, t2, ..., tn).
/// Variables are 0-arity terms whose symbol has SymbolKind::kVariable.
struct Term {
- SymbolId symbol_id; ///< Index into the SymbolTable
- std::vector<TermId> args; ///< Argument sub-term IDs
+ SymbolId symbol_id_; ///< Index into the SymbolTable
+ std::vector<TermId> args_; ///< Argument sub-term IDs
/// Number of arguments.
- [[nodiscard]] uint16_t arity() const { return static_cast<uint16_t>(args.size()); }
+ [[nodiscard]] uint16_t arity() const { return static_cast<uint16_t>(args_.size()); }
};
} // namespace atp
diff --git a/include/atp/core/term_bank.h b/include/atp/core/term_bank.h
index f909e2f..3339ceb 100644
--- a/include/atp/core/term_bank.h
+++ b/include/atp/core/term_bank.h
@@ -61,17 +61,17 @@ class TermBank {
private:
struct TermKey {
- SymbolId symbol;
- std::vector<TermId> args;
+ SymbolId symbol_;
+ std::vector<TermId> args_;
bool operator==(const TermKey& other) const = default;
};
struct TermKeyHash {
size_t operator()(const TermKey& key) const {
- size_t seed = std::hash<uint32_t>{}(key.symbol);
- for (TermId arg : key.args) {
- seed ^= std::hash<uint32_t>{}(arg) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ size_t seed = std::hash<uint32_t>{}(key.symbol_);
+ for (const TermId kArg : key.args_) {
+ seed ^= std::hash<TermId>{}(kArg) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
return seed;
}