Update table-making command
@@ -17,15 +17,26 @@ def to_table(filename):
info["time"] = entry["time"]
info["num_rules"] = entry["num_rules"]
info["unsound"] = "unsound: " + str(entry["post_unsound"])
- info["cvec"] = entry["params"]["important_cvec_offsets"]
- info["fuzz"] = entry["params"]["num_fuzz"]
- info["smt"] = entry["params"]["use_smt"]
+ info["cvec"] = entry["num_consts"]
+ info["fuzz"] = entry["v_fuzz"]
+ info["smt"] = entry["v_smt"] == "YES"
entries.append(info)
# now we must begin to construct something of a table
# the columns of the table are the fuzz/smt, so we should
# collect/group
# should I group by...?
+
+ make_table(list(filter(lambda x: x["domain"] == 32, entries)))
+ make_table(list(filter(lambda x: x["domain"] == 4, entries)))
+
+
+# \multirow{3}*{1} & success & success & success \\
+# & 0.07563307 & 0.067024701 & 0.718618355 \\
+# & unsound: 1 & unsound: 0 & unsound: 0 \\
+
+def make_table(entries):
+ entries = entries # I don't know about arguments and I don't plan to
num_fuzz = len(set([x["fuzz"] for x in entries]))
entries.sort(key=lambda x: x["cvec"])
@@ -34,11 +45,9 @@ def to_table(filename):
# print(entries)
for cvecs in entries_by_cvec:
# SMT goes at the back
- cvecs.sort(key=lambda x: (float("inf") if x["smt"] else x["fuzz"]))
+ cvecs.sort(key=lambda x: (float("inf") if x["smt"] else int(x["fuzz"])))
print(entries_by_cvec)
- print(num_fuzz)
-
# how many columns do we need? fuzz + smt + domain (fuzz includes smt)
cols = num_fuzz + 2
@@ -50,6 +59,7 @@ def to_table(filename):
# add headers
fuzzes = list(set([x["fuzz"] for x in entries]))
+ fuzzes.sort(key=lambda x: int(x))
fuzzes.remove(0) # setting we used for SMT
headers = ["cvec"] + fuzzes + ["SMT"]
table_tex += " & ".join([str(x) for x in headers])
@@ -64,17 +74,12 @@ def to_table(filename):
for row in rows:
for entry in loe:
- print(len(loe))
table_tex += " & "
table_tex += str(entry[row])
table_tex += " \\\\"
table_tex += "\n\\hline \\end{tabular}\\end{center}"
print(table_tex)
-# \multirow{3}*{1} & success & success & success \\
-# & 0.07563307 & 0.067024701 & 0.718618355 \\
-# & unsound: 1 & unsound: 0 & unsound: 0 \\
-
to_table("all.json")
