LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
LMCAS::QuantifierNode类 参考

#include </home/runner/work/docs/docs/LMCAS/src/internal/symbolic_ast/sets.hpp>

类 LMCAS::QuantifierNode 继承关系图:
LMCAS::QuantifierNode 的协作图:

Public 类型

enum class  Type { ForAll , Exists }

Public 成员函数

void accept (LMCAS::detail::SymbolicVisitor &visitor) const override
const std::string & bound_var () const noexcept
std::shared_ptr< const SymbolicNode > clone () const override
int compare (const SymbolicNode &other) const
 与另一个节点进行全序比较.
const std::shared_ptr< const SymbolicNode > & domain () const noexcept
bool equals (const SymbolicNode &other) const
 判断两个节点是否结构相等.
std::size_t hash () const
 获取节点哈希值(带缓存).
virtual bool is_number () const
virtual bool is_one () const
virtual bool is_positive () const
virtual bool is_zero () const
const std::shared_ptr< const SymbolicNode > & predicate () const noexcept
Type quantifier_type () const noexcept
int type_priority () const override

Protected 成员函数

int compare_same_type (const SymbolicNode &other) const override
std::size_t compute_hash () const override

Protected 属性

std::atomic< std::size_t > cached_hash {0}
std::atomic< bool > hash_computed {false}

Private 成员函数

 QuantifierNode (Type qt, std::string var, std::shared_ptr< const SymbolicNode > dom, std::shared_ptr< const SymbolicNode > pred)
 构造量词节点。

Private 属性

const std::string bound_var_
const std::shared_ptr< const SymbolicNode > domain_
 LMCAS_AST_NODE_FACTORY_FRIEND
const std::shared_ptr< const SymbolicNode > predicate_
const Type quantifier_type_

详细描述

在文件 sets.hpp 第 5 行定义.

成员枚举类型说明

◆ Type

enum class LMCAS::QuantifierNode::Type
strong
枚举值
ForAll 

全称量词 forall。

Exists 

存在量词 exists。

在文件 sets.hpp 第 7 行定义.

7 {
8 ForAll, /**< 全称量词 forall。 */
9 Exists /**< 存在量词 exists。 */
10 };

构造及析构函数说明

◆ QuantifierNode()

LMCAS::QuantifierNode::QuantifierNode ( Type qt,
std::string var,
std::shared_ptr< const SymbolicNode > dom,
std::shared_ptr< const SymbolicNode > pred )
inlineprivate

构造量词节点。

参数
qt量词类型
var约束变量名
dom定义域表达式
pred谓词表达式

在文件 sets.hpp 第 27 行定义.

29 : quantifier_type_(qt), bound_var_(std::move(var)),
30 domain_(std::move(dom)), predicate_(std::move(pred)) {
31 if (!domain_ || !predicate_) {
32 throw std::invalid_argument("QuantifierNode domain and predicate cannot be null");
33 }
34 if (bound_var_.empty()) {
35 throw std::invalid_argument("QuantifierNode bound variable cannot be empty");
36 }
37 }
const std::shared_ptr< const SymbolicNode > predicate_
const std::string bound_var_
const std::shared_ptr< const SymbolicNode > domain_
const Type quantifier_type_

引用了 bound_var_, domain_, predicate_ , 以及 quantifier_type_.

被这些函数引用 compare_same_type().

这是这个函数的调用关系图:

成员函数说明

◆ accept()

void LMCAS::QuantifierNode::accept ( LMCAS::detail::SymbolicVisitor & visitor) const
inlineoverridevirtual

实现了 LMCAS::SymbolicNode.

在文件 sets.hpp 第 73 行定义.

73{ LMCAS::detail::SymbolicVisitor::DepthGuard guard(visitor); visitor.visit(*this); }
virtual void visit(const NumberNode &node)=0

引用了 LMCAS::detail::SymbolicVisitor::visit().

函数调用图:

◆ bound_var()

const std::string & LMCAS::QuantifierNode::bound_var ( ) const
inlinenoexcept

在文件 sets.hpp 第 41 行定义.

41{ return bound_var_; }

引用了 bound_var_.

被这些函数引用 LMCAS::anonymous_namespace{expr_serialization.cpp}::Writer::visit().

这是这个函数的调用关系图:

◆ clone()

std::shared_ptr< const SymbolicNode > LMCAS::QuantifierNode::clone ( ) const
inlineoverridevirtual

实现了 LMCAS::SymbolicNode.

在文件 sets.hpp 第 75 行定义.

75 {
77 quantifier_type_, bound_var_, domain_->clone(), predicate_->clone());
78 }
std::shared_ptr< const Node > make_node(Args &&... args)

引用了 bound_var_, domain_, LMCAS::detail::make_node(), predicate_ , 以及 quantifier_type_.

函数调用图:

◆ compare()

int LMCAS::SymbolicNode::compare ( const SymbolicNode & other) const
inlineinherited

与另一个节点进行全序比较.

参数
other待比较的节点
返回
小于返回 -1,等于返回 0,大于返回 1

在文件 base.hpp 第 183 行定义.

183 {
184 if (type_priority() != other.type_priority()) {
185 return type_priority() < other.type_priority() ? -1 : 1;
186 }
187 return compare_same_type(other);
188 }
virtual int compare_same_type(const SymbolicNode &other) const =0
virtual int type_priority() const =0

引用了 SymbolicNode(), compare_same_type() , 以及 type_priority().

被这些函数引用 LMCAS::anonymous_namespace{symbolic_cancel.cpp}::combine_fraction_terms() , 以及 LMCAS::endpoints_equivalent().

函数调用图:
这是这个函数的调用关系图:

◆ compare_same_type()

int LMCAS::QuantifierNode::compare_same_type ( const SymbolicNode & other) const
inlineoverrideprotectedvirtual

实现了 LMCAS::SymbolicNode.

在文件 sets.hpp 第 60 行定义.

60 {
61 const auto& o = static_cast<const QuantifierNode&>(other);
62 if (quantifier_type_ != o.quantifier_type_) {
63 return static_cast<int>(quantifier_type_) < static_cast<int>(o.quantifier_type_) ? -1 : 1;
64 }
65 int cmp = bound_var_.compare(o.bound_var_);
66 if (cmp != 0) return cmp;
67 cmp = domain_->compare(*o.domain_);
68 if (cmp != 0) return cmp;
69 return predicate_->compare(*o.predicate_);
70 }
QuantifierNode(Type qt, std::string var, std::shared_ptr< const SymbolicNode > dom, std::shared_ptr< const SymbolicNode > pred)
构造量词节点。

引用了 QuantifierNode(), LMCAS::SymbolicNode::SymbolicNode(), bound_var_, domain_, predicate_ , 以及 quantifier_type_.

函数调用图:

◆ compute_hash()

std::size_t LMCAS::QuantifierNode::compute_hash ( ) const
inlineoverrideprotectedvirtual

实现了 LMCAS::SymbolicNode.

在文件 sets.hpp 第 50 行定义.

50 {
51 std::size_t seed = 0;
53 hash_combine(seed, static_cast<std::size_t>(quantifier_type_));
54 hash_combine(seed, std::hash<std::string>{}(bound_var_));
55 hash_combine(seed, domain_->hash());
56 hash_combine(seed, predicate_->hash());
57 return seed;
58 }
int type_priority() const override
void hash_combine(std::size_t &seed, std::size_t value)
将一个哈希值混合到种子中,用于组合多个字段的哈希.

引用了 bound_var_, domain_, LMCAS::hash_combine(), predicate_, quantifier_type_ , 以及 type_priority().

函数调用图:

◆ domain()

const std::shared_ptr< const SymbolicNode > & LMCAS::QuantifierNode::domain ( ) const
inlinenoexcept

在文件 sets.hpp 第 42 行定义.

42{ return domain_; }

引用了 domain_.

被这些函数引用 LMCAS::anonymous_namespace{expr_serialization.cpp}::Writer::visit() , 以及 LMCAS::anonymous_namespace{mixed_transcendental_classification.cpp}::TranscendentalDetector::visit().

这是这个函数的调用关系图:

◆ equals()

bool LMCAS::SymbolicNode::equals ( const SymbolicNode & other) const
inlineinherited

判断两个节点是否结构相等.

参数
other待比较的节点
返回
相等返回 true

在文件 base.hpp 第 195 行定义.

195 {
196 if (this == &other) return true;
197 if (hash() != other.hash()) return false;
198 if (type_priority() != other.type_priority()) return false;
199 return compare_same_type(other) == 0;
200 }
std::size_t hash() const
获取节点哈希值(带缓存).

引用了 SymbolicNode(), compare_same_type(), hash() , 以及 type_priority().

被这些函数引用 LMCAS::complementary_square(), LMCAS::anonymous_namespace{relation_store.cpp}::expr_equals(), LMCAS::match_recursive(), LMCAS::tf_remove_exp_factor() , 以及 LMCAS::tf_substitute_expr().

函数调用图:
这是这个函数的调用关系图:

◆ hash()

std::size_t LMCAS::SymbolicNode::hash ( ) const
inlineinherited

获取节点哈希值(带缓存).

返回
哈希值

在文件 base.hpp 第 168 行定义.

168 {
169 if (!hash_computed.load(std::memory_order_acquire)) {
170 std::size_t h = compute_hash();
171 cached_hash.store(h, std::memory_order_relaxed);
172 hash_computed.store(true, std::memory_order_release);
173 return h;
174 }
175 return cached_hash.load(std::memory_order_relaxed);
176 }
virtual std::size_t compute_hash() const =0
std::atomic< std::size_t > cached_hash
std::atomic< bool > hash_computed

引用了 cached_hash, compute_hash() , 以及 hash_computed.

被这些函数引用 LMCAS::MatrixNode::compute_hash(), LMCAS::VariableNode::compute_hash() , 以及 equals().

函数调用图:
这是这个函数的调用关系图:

◆ is_number()

virtual bool LMCAS::SymbolicNode::is_number ( ) const
inlinevirtualinherited

被 LMCAS::NumberNode 重载.

在文件 base.hpp 第 201 行定义.

201{ return false; }

◆ is_one()

virtual bool LMCAS::SymbolicNode::is_one ( ) const
inlinevirtualinherited

被 LMCAS::NumberNode 重载.

在文件 base.hpp 第 202 行定义.

202{ return false; }

◆ is_positive()

virtual bool LMCAS::SymbolicNode::is_positive ( ) const
inlinevirtualinherited

被 LMCAS::NumberNode 重载.

在文件 base.hpp 第 204 行定义.

204{ return false; }

◆ is_zero()

virtual bool LMCAS::SymbolicNode::is_zero ( ) const
inlinevirtualinherited

◆ predicate()

const std::shared_ptr< const SymbolicNode > & LMCAS::QuantifierNode::predicate ( ) const
inlinenoexcept

在文件 sets.hpp 第 43 行定义.

43 {
44 return predicate_;
45 }

引用了 predicate_.

被这些函数引用 LMCAS::anonymous_namespace{expr_serialization.cpp}::Writer::visit() , 以及 LMCAS::anonymous_namespace{mixed_transcendental_classification.cpp}::TranscendentalDetector::visit().

这是这个函数的调用关系图:

◆ quantifier_type()

Type LMCAS::QuantifierNode::quantifier_type ( ) const
inlinenoexcept

在文件 sets.hpp 第 40 行定义.

40{ return quantifier_type_; }

引用了 quantifier_type_.

被这些函数引用 LMCAS::anonymous_namespace{expr_serialization.cpp}::Writer::visit().

这是这个函数的调用关系图:

◆ type_priority()

int LMCAS::QuantifierNode::type_priority ( ) const
inlineoverridevirtual

实现了 LMCAS::SymbolicNode.

在文件 sets.hpp 第 47 行定义.

47{ return 102; }

被这些函数引用 compute_hash().

这是这个函数的调用关系图:

类成员变量说明

◆ bound_var_

const std::string LMCAS::QuantifierNode::bound_var_
private

在文件 sets.hpp 第 16 行定义.

被这些函数引用 QuantifierNode(), bound_var(), clone(), compare_same_type() , 以及 compute_hash().

◆ cached_hash

std::atomic<std::size_t> LMCAS::SymbolicNode::cached_hash {0}
mutableprotectedinherited

在文件 base.hpp 第 149 行定义.

被这些函数引用 SymbolicNode() , 以及 hash().

◆ domain_

const std::shared_ptr<const SymbolicNode> LMCAS::QuantifierNode::domain_
private

在文件 sets.hpp 第 17 行定义.

被这些函数引用 QuantifierNode(), clone(), compare_same_type(), compute_hash() , 以及 domain().

◆ hash_computed

std::atomic<bool> LMCAS::SymbolicNode::hash_computed {false}
mutableprotectedinherited

在文件 base.hpp 第 150 行定义.

被这些函数引用 SymbolicNode() , 以及 hash().

◆ LMCAS_AST_NODE_FACTORY_FRIEND

LMCAS::QuantifierNode::LMCAS_AST_NODE_FACTORY_FRIEND
private

在文件 sets.hpp 第 13 行定义.

◆ predicate_

const std::shared_ptr<const SymbolicNode> LMCAS::QuantifierNode::predicate_
private

在文件 sets.hpp 第 18 行定义.

被这些函数引用 QuantifierNode(), clone(), compare_same_type(), compute_hash() , 以及 predicate().

◆ quantifier_type_

const Type LMCAS::QuantifierNode::quantifier_type_
private

在文件 sets.hpp 第 15 行定义.

被这些函数引用 QuantifierNode(), clone(), compare_same_type(), compute_hash() , 以及 quantifier_type().


该类的文档由以下文件生成: