Connect++ 0.7.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
TableauProofNode Class Reference

Class for representing nodes in a tableau proof. More...

#include <TableauProof.hpp>

Collaboration diagram for TableauProofNode:

Public Member Functions

 TableauProofNode ()
 Basic constructor.
 
 TableauProofNode (Literal &_lit)
 Nearly all the work here is done by constructors.
 
 TableauProofNode (Clause &_c)
 Nearly all the work here is done by constructors.
 
 TableauProofNode (Clause &_c, Literal &_lit)
 Nearly all the work here is done by constructors.
 
 ~TableauProofNode ()
 Usual destructor for this sort of thing. Remember to delete what needs deleting.
 
string path_to_tptp_string ()
 
string parent_to_tptp_string ()
 
string make_path_string ()
 
string lemmas_to_string ()
 

Private Attributes

TableauNodeType type
 
TableauProofNodeparent
 
ClauseNum t
 A node in the tableau is identified by ‘t : l’.
 
ClauseNum t_child
 Nodes maintain the t value for children.
 
LitNum l
 A node in the tableau is identified by ‘t : l’.
 
LitNum l_child
 Nodes maintain the l value for children.
 
Clause c_output
 A node is associated with a clause.
 
Clause c_remaining
 Starts equal to c. At each step in constructing the tableau a single literal is dealt with in a child. This keeps track of the remaining clause.
 
size_t matrix_id
 Some nodes need to produce output referring to a clause in the matrix.
 
Literal lit
 Literal associated with the node.
 
vector< PathPair > p
 Paths are stored both as collections of literals and collections of t:l pairs. Both are needed for construction and producing output.
 
vector< Literalpath
 Paths are stored both as collections of literals and collections of t:l pairs. Both are needed for construction and producing output.
 
Substitution sub
 Substitution associated with reduction, extension or lemma.
 
size_t depth
 Where are we in the tree? Used for backtracking.
 
bool needs_lemma_link
 Used in producing LaTex output to indicate that a link has to be added.
 
bool needs_reduction_link
 Used in producing LaTex output to indicate that a link has to be added.
 
PathPair reduction_node
 Which node is associated with this one?
 
size_t lemma_reduction_node
 Which node is associated with this one?
 
vector< size_t > lemma_list
 Lemma lists are kept as both numbers and pointer to other nodes. Both are needed.
 
vector< TableauProofNode * > lemma_list_p
 
TableauProofNodelemma
 Lemma associated with a reduction or extension.
 
size_t lemma_number
 Numerical identifier for a lemma.
 
bool lemma_is_used
 Used in producing LaTeX output so that only used lemmas are displayed.
 
vector< TableauProofNode * > children
 Children of this node.
 

Friends

class TableauProof
 

Detailed Description

Class for representing nodes in a tableau proof.

See the documentation for TableauProof for details.

Definition at line 53 of file TableauProof.hpp.

Constructor & Destructor Documentation

◆ TableauProofNode() [1/4]

TableauProofNode::TableauProofNode ( )
inline

Basic constructor.

Definition at line 159 of file TableauProof.hpp.

160 : type(TableauNodeType::False)
161 , parent(nullptr)
162 , t(0)
163 , t_child(0)
164 , l(0)
165 , l_child(0)
166 , c_output()
167 , c_remaining()
168 , matrix_id(0)
169 , lit()
170 , p()
171 , path()
172 , sub()
173 , depth(0)
174 , needs_reduction_link(false)
175 , needs_lemma_link(false)
178 , lemma_list()
179 , lemma_list_p()
180 , lemma(nullptr)
181 , lemma_number(0)
182 , lemma_is_used(false)
183 , children()
184 {}
bool needs_lemma_link
Used in producing LaTex output to indicate that a link has to be added.
size_t matrix_id
Some nodes need to produce output referring to a clause in the matrix.
Clause c_output
A node is associated with a clause.
Substitution sub
Substitution associated with reduction, extension or lemma.
LitNum l
A node in the tableau is identified by ‘t : l’.
ClauseNum t_child
Nodes maintain the t value for children.
PathPair reduction_node
Which node is associated with this one?
ClauseNum t
A node in the tableau is identified by ‘t : l’.
vector< Literal > path
Paths are stored both as collections of literals and collections of t:l pairs. Both are needed for co...
vector< size_t > lemma_list
Lemma lists are kept as both numbers and pointer to other nodes. Both are needed.
bool lemma_is_used
Used in producing LaTeX output so that only used lemmas are displayed.
vector< TableauProofNode * > children
Children of this node.
vector< PathPair > p
Paths are stored both as collections of literals and collections of t:l pairs. Both are needed for co...
bool needs_reduction_link
Used in producing LaTex output to indicate that a link has to be added.
TableauProofNode * lemma
Lemma associated with a reduction or extension.
Literal lit
Literal associated with the node.
LitNum l_child
Nodes maintain the l value for children.
size_t depth
Where are we in the tree? Used for backtracking.
size_t lemma_reduction_node
Which node is associated with this one?
size_t lemma_number
Numerical identifier for a lemma.
Clause c_remaining
Starts equal to c. At each step in constructing the tableau a single literal is dealt with in a child...

◆ TableauProofNode() [2/4]

TableauProofNode::TableauProofNode ( Literal & _lit)
inline

Nearly all the work here is done by constructors.

Definition at line 188 of file TableauProof.hpp.

189 : TableauProofNode() {
190 type = TableauNodeType::Connection;
191 lit = _lit;
192 }
TableauProofNode()
Basic constructor.

◆ TableauProofNode() [3/4]

TableauProofNode::TableauProofNode ( Clause & _c)
inline

Nearly all the work here is done by constructors.

Definition at line 196 of file TableauProof.hpp.

197 : TableauProofNode() {
198 type = TableauNodeType::Start;
199 c_output = _c;
200 c_remaining = _c;
201 }

◆ TableauProofNode() [4/4]

TableauProofNode::TableauProofNode ( Clause & _c,
Literal & _lit )
inline

Nearly all the work here is done by constructors.

Definition at line 205 of file TableauProof.hpp.

206 : TableauProofNode() {
207 type = TableauNodeType::Extension;
208 lit = _lit;
209 c_output = _c;
210 c_remaining = _c;
211 }

◆ ~TableauProofNode()

TableauProofNode::~TableauProofNode ( )
inline

Usual destructor for this sort of thing. Remember to delete what needs deleting.

Definition at line 216 of file TableauProof.hpp.

216 {
217 delete lemma;
218 for (TableauProofNode* child : children)
219 delete child;
220 }
Class for representing nodes in a tableau proof.

Member Function Documentation

◆ lemmas_to_string()

string TableauProofNode::lemmas_to_string ( )

Definition at line 72 of file TableauProof.cpp.

72 {
73 string s;
74 for (size_t l : lemma_list) {
75 s += to_string(l);
76 s += "\\ ";
77 }
78 return s;
79 }

◆ make_path_string()

string TableauProofNode::make_path_string ( )

Definition at line 58 of file TableauProof.cpp.

58 {
59 string s;
60 if (!params::tptp_proof_show_paths) {
61 s += "parent(";
62 s += parent_to_tptp_string();
63 }
64 else {
65 s += "path(";
66 s += path_to_tptp_string();
67 }
68 s += ")";
69 return s;
70}

◆ parent_to_tptp_string()

string TableauProofNode::parent_to_tptp_string ( )

Definition at line 49 of file TableauProof.cpp.

49 {
50 string s("t");
51 PathPair p2(parent->p.back());
52 s += to_string(p2.first);
53 s += ":";
54 s += to_string(p2.second);
55 return s;
56}

◆ path_to_tptp_string()

string TableauProofNode::path_to_tptp_string ( )

Definition at line 30 of file TableauProof.cpp.

30 {
31 string s("[");
32 vector<PathPair> p2(parent->p);
33
34 for (int i = p2.size() - 1; i >= 0; i--) {
35 if (i > 0) {
36 s += "t";
37 }
38 s += to_string(p2[i].first);
39 s += ":";
40 s += to_string(p2[i].second);
41 if (i > 0) {
42 s += ",";
43 }
44 }
45 s += "]";
46 return s;
47}

Friends And Related Symbol Documentation

◆ TableauProof

friend class TableauProof
friend

Definition at line 226 of file TableauProof.hpp.

Member Data Documentation

◆ c_output

Clause TableauProofNode::c_output
private

A node is associated with a clause.

Definition at line 78 of file TableauProof.hpp.

◆ c_remaining

Clause TableauProofNode::c_remaining
private

Starts equal to c. At each step in constructing the tableau a single literal is dealt with in a child. This keeps track of the remaining clause.

Definition at line 84 of file TableauProof.hpp.

◆ children

vector<TableauProofNode*> TableauProofNode::children
private

Children of this node.

Definition at line 154 of file TableauProof.hpp.

◆ depth

size_t TableauProofNode::depth
private

Where are we in the tree? Used for backtracking.

Definition at line 113 of file TableauProof.hpp.

◆ l

LitNum TableauProofNode::l
private

A node in the tableau is identified by ‘t : l’.

Definition at line 70 of file TableauProof.hpp.

◆ l_child

LitNum TableauProofNode::l_child
private

Nodes maintain the l value for children.

Definition at line 74 of file TableauProof.hpp.

◆ lemma

TableauProofNode* TableauProofNode::lemma
private

Lemma associated with a reduction or extension.

Definition at line 141 of file TableauProof.hpp.

◆ lemma_is_used

bool TableauProofNode::lemma_is_used
private

Used in producing LaTeX output so that only used lemmas are displayed.

Definition at line 150 of file TableauProof.hpp.

◆ lemma_list

vector<size_t> TableauProofNode::lemma_list
private

Lemma lists are kept as both numbers and pointer to other nodes. Both are needed.

Definition at line 136 of file TableauProof.hpp.

◆ lemma_list_p

vector<TableauProofNode*> TableauProofNode::lemma_list_p
private

Definition at line 137 of file TableauProof.hpp.

◆ lemma_number

size_t TableauProofNode::lemma_number
private

Numerical identifier for a lemma.

Definition at line 145 of file TableauProof.hpp.

◆ lemma_reduction_node

size_t TableauProofNode::lemma_reduction_node
private

Which node is associated with this one?

Definition at line 131 of file TableauProof.hpp.

◆ lit

Literal TableauProofNode::lit
private

Literal associated with the node.

Definition at line 93 of file TableauProof.hpp.

◆ matrix_id

size_t TableauProofNode::matrix_id
private

Some nodes need to produce output referring to a clause in the matrix.

Definition at line 89 of file TableauProof.hpp.

◆ needs_lemma_link

bool TableauProofNode::needs_lemma_link
private

Used in producing LaTex output to indicate that a link has to be added.

Definition at line 118 of file TableauProof.hpp.

◆ needs_reduction_link

bool TableauProofNode::needs_reduction_link
private

Used in producing LaTex output to indicate that a link has to be added.

Definition at line 123 of file TableauProof.hpp.

◆ p

vector<PathPair> TableauProofNode::p
private

Paths are stored both as collections of literals and collections of t:l pairs. Both are needed for construction and producing output.

Definition at line 99 of file TableauProof.hpp.

◆ parent

TableauProofNode* TableauProofNode::parent
private

Definition at line 56 of file TableauProof.hpp.

◆ path

vector<Literal> TableauProofNode::path
private

Paths are stored both as collections of literals and collections of t:l pairs. Both are needed for construction and producing output.

Definition at line 105 of file TableauProof.hpp.

◆ reduction_node

PathPair TableauProofNode::reduction_node
private

Which node is associated with this one?

Definition at line 127 of file TableauProof.hpp.

◆ sub

Substitution TableauProofNode::sub
private

Substitution associated with reduction, extension or lemma.

Definition at line 109 of file TableauProof.hpp.

◆ t

ClauseNum TableauProofNode::t
private

A node in the tableau is identified by ‘t : l’.

Definition at line 61 of file TableauProof.hpp.

◆ t_child

ClauseNum TableauProofNode::t_child
private

Nodes maintain the t value for children.

Definition at line 65 of file TableauProof.hpp.

◆ type

TableauNodeType TableauProofNode::type
private

Definition at line 55 of file TableauProof.hpp.


The documentation for this class was generated from the following files: