Edit on GitHub

pytact.scripts.check_axioms

Find all axioms in the dataset (used to find false hypotheses in packages)

 1"""Find all axioms in the dataset (used to find false hypotheses in packages)
 2"""
 3
 4from pathlib import Path
 5import sys
 6from pytact.data_reader import data_reader, Original, ManualSectionConstant
 7import pytact.graph_api_capnp_cython as apic
 8
 9def main():
10    dataset_path = Path(sys.argv[1]).resolve()
11    with data_reader(dataset_path) as data:
12        for f in data.values():
13            for d in f.definitions():
14                if not isinstance(d.status, Original):
15                    continue
16                if isinstance(d.kind, ManualSectionConstant):
17                    continue
18                if apic.EdgeClassification(d.node.children[0][0]).name == 'CONST_UNDEF':
19                    print(d.kind)
20                    print(d.name)
21                    print(d.type_text)
22                    print(d.term_text)
23
24if __name__ == "__main__":
25    exit(main())
def main():
10def main():
11    dataset_path = Path(sys.argv[1]).resolve()
12    with data_reader(dataset_path) as data:
13        for f in data.values():
14            for d in f.definitions():
15                if not isinstance(d.status, Original):
16                    continue
17                if isinstance(d.kind, ManualSectionConstant):
18                    continue
19                if apic.EdgeClassification(d.node.children[0][0]).name == 'CONST_UNDEF':
20                    print(d.kind)
21                    print(d.name)
22                    print(d.type_text)
23                    print(d.term_text)