Skip to content

Commit 978b10e

Browse files
committed
Merge branch 'b2-aspic-completeness'
2 parents 099db66 + eb816ee commit 978b10e

209 files changed

Lines changed: 6738 additions & 3529 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bench/asp_vs_sat.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ def main() -> None:
3030
with out_path.open("w", newline="", encoding="utf-8") as handle:
3131
writer = csv.DictWriter(
3232
handle,
33-
fieldnames=["family", "size", "semantics", "backend", "status", "extensions", "seconds"],
33+
fieldnames=[
34+
"family",
35+
"size",
36+
"semantics",
37+
"backend",
38+
"status",
39+
"extensions",
40+
"seconds",
41+
],
3442
)
3543
writer.writeheader()
3644
writer.writerows(rows)
@@ -48,7 +56,17 @@ def _run_aba(size: int, timeout: float) -> list[dict[str, str]]:
4856
semantics=semantics,
4957
timeout_seconds=timeout,
5058
)
51-
rows.append(_row("aba", size, semantics, backend, result.status, len(result.extensions), start))
59+
rows.append(
60+
_row(
61+
"aba",
62+
size,
63+
semantics,
64+
backend,
65+
result.status,
66+
len(result.extensions),
67+
start,
68+
)
69+
)
5270
return rows
5371

5472

@@ -66,7 +84,17 @@ def _run_aspic(size: int, timeout: float) -> list[dict[str, str]]:
6684
semantics=semantics,
6785
timeout_seconds=timeout,
6886
)
69-
rows.append(_row("aspic", size, semantics, backend, result.status, len(result.extensions), start))
87+
rows.append(
88+
_row(
89+
"aspic",
90+
size,
91+
semantics,
92+
backend,
93+
result.status,
94+
len(result.extensions),
95+
start,
96+
)
97+
)
7098
return rows
7199

72100

bench/instance_gen.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def aba_chain(size: int, *, body_size: int = 1) -> ABAFramework:
1919
contraries = tuple(Literal(GroundAtom(f"c{index}")) for index in range(size))
2020
rules: set[Rule] = set()
2121
for index, contrary in enumerate(contraries):
22-
body = tuple(assumptions[(index + offset + 1) % size] for offset in range(body_size))
22+
body = tuple(
23+
assumptions[(index + offset + 1) % size] for offset in range(body_size)
24+
)
2325
rules.add(Rule(body, contrary, "strict", f"r_{index}"))
2426
return ABAFramework(
2527
language=frozenset((*assumptions, *contraries)),
@@ -37,7 +39,11 @@ def aspic_chain(size: int, *, defeasible_ratio: float = 1.0):
3739
defeasible_cutoff = int(max(0, min(1, defeasible_ratio)) * max(0, size - 1))
3840
for index in range(size - 1):
3941
if index < defeasible_cutoff:
40-
defeasible_rules.add(Rule((literals[index],), literals[index + 1], "defeasible", f"d_{index}"))
42+
defeasible_rules.add(
43+
Rule(
44+
(literals[index],), literals[index + 1], "defeasible", f"d_{index}"
45+
)
46+
)
4147
else:
4248
strict_rules.add(Rule((literals[index],), literals[index + 1], "strict"))
4349
system = ArgumentationSystem(

experiments/iccma-census/aggregate_census.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,31 @@ def main() -> int:
5757
print(f"MISSING run outputs for: {missing}")
5858
print(f"\n{'family':12} {'subtrack':8} {'solved':>6} {'timeout':>7} {'other':>6}")
5959
tot = defaultdict(int)
60-
for (fam, st) in sorted(cells):
60+
for fam, st in sorted(cells):
6161
c = cells[(fam, st)]
6262
solved = c.get("solved", 0)
6363
timeout = c.get("timeout", 0)
6464
other = sum(v for k, v in c.items() if k not in ("solved", "timeout"))
65-
othertxt = "" if not other else " ".join(f"{k}={v}" for k, v in c.items() if k not in ("solved", "timeout"))
65+
othertxt = (
66+
""
67+
if not other
68+
else " ".join(
69+
f"{k}={v}" for k, v in c.items() if k not in ("solved", "timeout")
70+
)
71+
)
6672
print(f"{fam:12} {st:8} {solved:>6} {timeout:>7} {other:>6} {othertxt}")
6773
tot["solved"] += solved
6874
tot["timeout"] += timeout
6975
tot["other"] += other
7076
total_rows = tot["solved"] + tot["timeout"] + tot["other"]
71-
print(f"\nTOTAL rows={total_rows} solved={tot['solved']} timeout={tot['timeout']} other={tot['other']}")
77+
print(
78+
f"\nTOTAL rows={total_rows} solved={tot['solved']} timeout={tot['timeout']} other={tot['other']}"
79+
)
7280
if total_rows:
7381
frac = tot["solved"] / total_rows
74-
print(f"budget-artifact fraction (solved@600 / sampled timeouts) = {tot['solved']}/{total_rows} = {frac:.3f}")
82+
print(
83+
f"budget-artifact fraction (solved@600 / sampled timeouts) = {tot['solved']}/{total_rows} = {frac:.3f}"
84+
)
7585
return 0
7686

7787

experiments/iccma-census/select_sample.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ def select(csv_path: Path) -> dict:
107107
}
108108
)
109109
for instance in picked:
110-
entries.append({"family": family, "subtrack": subtrack, "instance": instance})
110+
entries.append(
111+
{"family": family, "subtrack": subtrack, "instance": instance}
112+
)
111113

112114
return {
113115
"source_csv": csv_path.name,
@@ -127,7 +129,9 @@ def main() -> int:
127129
args = parser.parse_args()
128130
manifest = select(args.csv)
129131
args.out.parent.mkdir(parents=True, exist_ok=True)
130-
args.out.write_text(json.dumps(manifest, indent=2, sort_keys=True) + "\n", encoding="utf-8")
132+
args.out.write_text(
133+
json.dumps(manifest, indent=2, sort_keys=True) + "\n", encoding="utf-8"
134+
)
131135
print(f"wrote {args.out} ({manifest['total_selected']} rows)")
132136
for stratum in manifest["strata"]:
133137
if stratum["selected"] < stratum["requested"]:

0 commit comments

Comments
 (0)