Skip to content

Commit 59b1073

Browse files
authored
Merge pull request #132 from werifu/fix_to_dot
fix: toDot => to_dot
2 parents aebd9be + e2b6f0c commit 59b1073

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

debug/engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test(filename, debug=None, trace=None):
5555
print(target)
5656

5757
with open("engine_debug.dot", "w") as f:
58-
print(target.toDot(), file=f)
58+
print(target.to_dot(), file=f)
5959

6060

6161
if __name__ == "__main__":

problog/web/server_debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def run_ground(model):
161161

162162
handle, filename = tempfile.mkstemp(".dot")
163163
with open(filename, "w") as f:
164-
f.write(formula.toDot())
164+
f.write(formula.to_dot())
165165
print(formula)
166166
result = subprocess.check_output(["dot", "-Tsvg", filename]).decode("utf-8")
167167
content_type = "application/json"

step-by-step.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def main(filename, with_dot, knowledge):
7373

7474
if dotprefix != None:
7575
with open(dotprefix + "gp.dot", "w") as f:
76-
print(gp.toDot(), file=f)
76+
print(gp.to_dot(), file=f)
7777

7878
print("\n=== Acyclic Ground Program ===")
7979
with Timer("acyclic"):
@@ -82,15 +82,16 @@ def main(filename, with_dot, knowledge):
8282

8383
if dotprefix != None:
8484
with open(dotprefix + "agp.dot", "w") as f:
85-
print(gp.toDot(), file=f)
85+
print(gp.to_dot(), file=f)
8686

8787
if knowledge == "sdd":
8888
print("\n=== SDD compilation ===")
8989
with Timer("compile"):
9090
nnf = SDD.createFrom(gp)
9191

9292
if dotprefix != None:
93-
nnf.saveSDDToDot(dotprefix + "sdd.dot")
93+
with open(dotprefix + "sdd.dot", "w") as f:
94+
print(nnf.sdd_to_dot(None), file=f)
9495

9596
else:
9697
print("\n=== Conversion to CNF ===")
@@ -103,7 +104,7 @@ def main(filename, with_dot, knowledge):
103104

104105
if dotprefix != None:
105106
with open(dotprefix + "nnf.dot", "w") as f:
106-
print(nnf.toDot(), file=f)
107+
print(nnf.to_dot(), file=f)
107108

108109
print("\n=== Evaluation result ===")
109110
with Timer("evaluate"):

0 commit comments

Comments
 (0)