-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solution for 2023-12-24, part 2 (Z3)
- Loading branch information
Showing
3 changed files
with
232 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
src/main/kotlin/biz/koziolek/adventofcode/year2023/day24/day24part2.z3.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
(declare-const x1 Int) | ||
(declare-const y1 Int) | ||
(declare-const z1 Int) | ||
(declare-const vx1 Int) | ||
(declare-const vy1 Int) | ||
(declare-const vz1 Int) | ||
|
||
(declare-const x2 Int) | ||
(declare-const y2 Int) | ||
(declare-const z2 Int) | ||
(declare-const vx2 Int) | ||
(declare-const vy2 Int) | ||
(declare-const vz2 Int) | ||
|
||
(declare-const x3 Int) | ||
(declare-const y3 Int) | ||
(declare-const z3 Int) | ||
(declare-const vx3 Int) | ||
(declare-const vy3 Int) | ||
(declare-const vz3 Int) | ||
|
||
(declare-const x Int) | ||
(declare-const y Int) | ||
(declare-const z Int) | ||
(declare-const vx Int) | ||
(declare-const vy Int) | ||
(declare-const vz Int) | ||
(declare-const time1 Int) | ||
(declare-const time2 Int) | ||
(declare-const time3 Int) | ||
|
||
(declare-const ans Int) | ||
|
||
(assert (= x1 327367788702047)) | ||
(assert (= y1 294752664325632)) | ||
(assert (= z1 162080199489440)) | ||
(assert (= vx1 20)) | ||
(assert (= vy1 51)) | ||
(assert (= vz1 36)) | ||
|
||
(assert (= x2 349323332347395)) | ||
(assert (= y2 429135322811787)) | ||
(assert (= z2 397812423558610)) | ||
(assert (= vx2 -96)) | ||
(assert (= vy2 -480)) | ||
(assert (= vz2 -782)) | ||
|
||
(assert (= x3 308103110384633)) | ||
(assert (= y3 244954649487980)) | ||
(assert (= z3 207561383118617)) | ||
(assert (= vx3 220)) | ||
(assert (= vy3 463)) | ||
(assert (= vz3 -401)) | ||
|
||
(assert (= (+ x1 (* vx1 time1)) (+ x (* vx time1)))) | ||
(assert (= (+ y1 (* vy1 time1)) (+ y (* vy time1)))) | ||
(assert (= (+ z1 (* vz1 time1)) (+ z (* vz time1)))) | ||
(assert (> time1 0)) | ||
|
||
(assert (= (+ x2 (* vx2 time2)) (+ x (* vx time2)))) | ||
(assert (= (+ y2 (* vy2 time2)) (+ y (* vy time2)))) | ||
(assert (= (+ z2 (* vz2 time2)) (+ z (* vz time2)))) | ||
(assert (> time2 0)) | ||
|
||
(assert (= (+ x3 (* vx3 time3)) (+ x (* vx time3)))) | ||
(assert (= (+ y3 (* vy3 time3)) (+ y (* vy time3)))) | ||
(assert (= (+ z3 (* vz3 time3)) (+ z (* vz time3)))) | ||
(assert (> time3 0)) | ||
|
||
(assert (= ans (+ x (+ y z)))) | ||
|
||
(check-sat) | ||
(get-objectives) | ||
(get-model) | ||
(get-value (vx)) | ||
(get-value (vy)) | ||
(get-value (vz)) | ||
(get-value (ans)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters