MCPcopy Create free account

hub / github.com/adamchalmers/carroll / functions

Functions98 in github.com/adamchalmers/carroll

↓ 59 callersMethodeval
Evaluates the logic tree rooted at this node against a supplied model. Model is an assignment of truth values to atoms (dict of string -> boo
nodes.py:19
↓ 20 callersFunctionparse
Starts parsing a logical expression (supplied as a string). Returns a tree of Nodes.
parsing.py:8
↓ 12 callersFunctiontruth_table
Generates truth table rows from a proposition string.
truthtable.py:38
↓ 11 callersFunctionmeaning_of
Returns the type of node this symbol represents.
symbols.py:21
↓ 8 callersFunctionall_equal
(iterable)
truthtable.py:72
↓ 8 callersFunctionequivalent
(exp1, exp2)
truthtable.py:80
↓ 7 callersFunctionprint_sat_info
(table)
truthtable.py:84
↓ 5 callersFunctionfind_atoms
Returns a list of atoms in a proposition string.
truthtable.py:51
↓ 5 callersFunctiongen_truths
Yields all possible maps of variables to truth values.
truthtable.py:55
↓ 3 callersMethodatoms
Return a set of characters which are atoms in this expression.
nodes.py:36
↓ 2 callersFunctionserialize_argument_trees
Takes in a list of parse tree expressions [A, B, C, ... Z]. Outputs one parse tree ((A&B&C&...) -> Z). Last expression is the conclusion,
proofs.py:6
↓ 2 callersFunctionto_cnf
(expression)
normal_forms.py:15
↓ 2 callersFunctionto_dnf
Converts a proposition string into a DNF string.
normal_forms.py:5
↓ 2 callersFunctionvalid_proof
Takes in a list of parse tree expressions [A, B, C, ... Z]. Outputs one parse tree ((A&B&C&...) -> Z). Last expression is the conclusion,
proofs.py:16
↓ 1 callersFunction_parse
Recursive-descent parsing algorithm for logic expressions. Returns a tree of Nodes.
parsing.py:18
↓ 1 callersMethodcheck_valid
Ensures the children nodes are valid. Raises LogicError if they're not.
nodes.py:25
↓ 1 callersMethodcheck_valid_specific
Overridden by children nodes to implement custom child-checking logic. Should raise LogicError if children are invalid.
nodes.py:31
↓ 1 callersFunctioncli
Carroll is a command line tool for analysing propositional logic (also known as boolean functions or expressions).
carroll.py:11
↓ 1 callersFunctiontruth_to_str
Produce a nice-formatted string of a truth assignment, e.g. " A ~B C".
truthtable.py:65
Method__eq__
(self, other)
truthtable.py:19
Method__init__
(self, model, value)
truthtable.py:12
Method__init__
(self, *children)
nodes.py:15
Method__str__
(self)
truthtable.py:16
Methodatoms
(self)
nodes.py:97
Methodcheck_valid_specific
(self, children)
nodes.py:91
Functioncnf
Converts an expression to conjunctive normal form.
carroll.py:38
Functiondnf
Converts an expression to disjunctive normal form.
carroll.py:32
Functionequiv
Checks whether two expressions are logically equivalent.
carroll.py:19
Methodeval
(self, model)
nodes.py:55
Methodeval
(self, model)
nodes.py:59
Methodeval
(self, model)
nodes.py:63
Methodeval
(self, model)
nodes.py:69
Methodeval
(self, model)
nodes.py:75
Methodeval
(self, model)
nodes.py:80
Methodeval
(self, model)
nodes.py:89
Functionfrom_tree
Generates a truth table from a parse tree.
truthtable.py:45
Methodl
(self)
nodes.py:44
Functionmodel_to_clause
(model, truth, symbol)
normal_forms.py:24
Functionprint_truth_table
Outputs the truth table for an expression to stdout.
truthtable.py:23
Functionproof
Checks a proof for validity.
carroll.py:43
Methodr
(self)
nodes.py:48
Functionsetup_tf_nodes
()
nodes.py:101
Functiontable
Outputs a truth table for a logical expression.
carroll.py:26
Functionteardown
()
nodes.py:109
Functiontest_all_equal
()
truthtable.py:170
Functiontest_atom_parse
()
parsing.py:63
Functiontest_atoms_uppercase
()
nodes.py:205
Functiontest_basic_cnf
()
normal_forms.py:50
Functiontest_basic_dnf
()
normal_forms.py:38
Functiontest_check_valid
()
nodes.py:208
Functiontest_complex_and_parse
()
parsing.py:80
Functiontest_complex_or_parse
()
parsing.py:98
Functiontest_complex_parse
()
parsing.py:109
Functiontest_compound_node_eval
()
nodes.py:172
Functiontest_dnf_parse
()
parsing.py:127
Functiontest_equiv_complex
()
truthtable.py:163
Functiontest_equiv_simple
()
truthtable.py:154
Functiontest_error_parse
()
parsing.py:48
Functiontest_find_atoms
()
truthtable.py:128
Functiontest_find_atoms
()
nodes.py:217
Functiontest_gen_truths_base
()
truthtable.py:100
Functiontest_gen_truths_recursive
()
truthtable.py:104
Functiontest_gen_truths_recursive_long
()
truthtable.py:114
Functiontest_if_nodes
()
nodes.py:128
Functiontest_iff_nodes
()
nodes.py:154
Functiontest_invalid_proof
()
proofs.py:42
Functiontest_longer_cnf
()
normal_forms.py:56
Functiontest_longer_dnf
()
normal_forms.py:44
Functiontest_many_ands
()
nodes.py:180
Functiontest_many_ors
()
nodes.py:189
Functiontest_multiple_and_parse
()
parsing.py:87
Functiontest_multiple_iff_nodes
()
nodes.py:161
Functiontest_multiple_operand_fail
()
parsing.py:132
Functiontest_multiple_operand_parse
()
parsing.py:121
Functiontest_multiple_or_parse
()
parsing.py:104
Functiontest_multiple_xor_nodes
()
nodes.py:142
Functiontest_not_all_equal
()
truthtable.py:177
Functiontest_not_equiv_complex
()
truthtable.py:167
Functiontest_not_equiv_simple
()
truthtable.py:158
Functiontest_not_parse
()
parsing.py:68
Functiontest_parse_if
()
parsing.py:135
Functiontest_parse_iff
()
parsing.py:141
Functiontest_parse_xor
()
parsing.py:147
Functiontest_sat_info_harder
()
truthtable.py:188
Functiontest_sat_info_simple
()
truthtable.py:182
Functiontest_serialize_argtree_simple
()
proofs.py:26
Functiontest_simple_and_parse
()
parsing.py:74
Functiontest_simple_find_atoms
()
nodes.py:212
Functiontest_simple_or_parse
()
parsing.py:92
Functiontest_single_atom
()
nodes.py:202
Functiontest_single_node_eval
()
nodes.py:113
Functiontest_single_not
()
nodes.py:197
Functiontest_spaces_parse
()
parsing.py:59
Functiontest_symbol_mapping
()
symbols.py:25
Functiontest_truth_table_and
()
truthtable.py:134
Functiontest_truth_table_or
()
truthtable.py:144
Functiontest_valid_proof
()
proofs.py:38
Functiontest_xor_nodes
()
nodes.py:135