Esempio n. 1
0
def test_function_definition():
    formulator = InductiveFormationFormulator()
    print_node(formulator())
from ddq.util.print_tree import print_node
from ddq.util.find_in_list import find_instance_of
from ddq.topics.set_theory.topic import topic
from ddq.topics.set_theory.non_membership import NonMembeshipDefinition

ST = topic()
definition = find_instance_of(ST.get_definitions(), NonMembeshipDefinition)
print_node(definition.get_formula())
Esempio n. 3
0
from ddq.util.print_tree import print_node
from ddq.util.find_in_list import find_instance_of
from ddq.topics.set_theory.topic import topic
from ddq.topics.set_theory.empty_set import EmptySetAxiom

ST = topic()
axiom = find_instance_of(ST.get_axioms(), EmptySetAxiom)
print_node(axiom.get_formula())
Esempio n. 4
0
from pprint import pprint
from ddq.node import Node
from ddq.inductor import Inductor
from ddq.fol.topic import FOL
from ddq.topics.set_theory.topic import ST
from ddq.util.print_tree import print_node


topics = {
    "FOL": FOL,
    "ST": ST
}

if len(sys.argv) > 1:
    try:
        thing = eval(sys.argv[1], topics)
        if isinstance(thing, SimpleNamespace):
            pprint(vars(thing))
        else:
            if not isinstance(thing, Node):
                thing = thing()
            print_node(thing)
    except Exception as e:
        if isinstance(thing, Inductor):
            logging.error("'{}' is an inductor, make sure to provide"
                          " an induction index e.g ST.InductiveFormation(3)\n"
                          .format(sys.argv[1]))
        logging.exception(str(e))
else:
    pprint(list(topics.keys()))
def test_function_definition():
    formulator = PredicativeFunctionDefinitionFormulator()
    print_node(formulator())