We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ae3423 commit 62ae6d6Copy full SHA for 62ae6d6
day24/src/day24.cr
@@ -18,6 +18,12 @@ def parse_input(raw : String) : Tuple(Vars, Circuit)
18
{vars, circuit}
19
end
20
21
+# This is a lot more complicated than it'd have to be. My hope was that using
22
+# the Z3 solver for part 1 (instead of just parsing and interpreting the graph
23
+# directly) would pay off in part 2, but as it turns out expressing the
24
+# additions as Z3 constraints would have been a fair bit more involved than just
25
+# scanning the connections for some simple rules (see `is_wrong`).
26
+
27
def translate_to_z3(vars : Vars, circuit : Circuit) : String
28
[
29
*vars.map { |v| "(declare-const #{v[0]} (_ BitVec #{BITS}))" },
0 commit comments