Skip to content

Commit 62ae6d6

Browse files
committed
Add note on Z3
1 parent 5ae3423 commit 62ae6d6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

day24/src/day24.cr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ def parse_input(raw : String) : Tuple(Vars, Circuit)
1818
{vars, circuit}
1919
end
2020

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+
2127
def translate_to_z3(vars : Vars, circuit : Circuit) : String
2228
[
2329
*vars.map { |v| "(declare-const #{v[0]} (_ BitVec #{BITS}))" },

0 commit comments

Comments
 (0)