MiniZinc is a constraint language that compiles to whatever solver you have — Gecode, Chuffed, OR-Tools, Gurobi.
01
Declare your variables and their domains up front. The language separates modeling (what the problem is) from solving (which engine attacks it) — a single .mzn model runs on every supported backend.
int: n = 4;
array[1..n] of var 0..1: x;
02
State constraints in something close to ordinary mathematics. MiniZinc handles the encoding to whatever the solver speaks underneath — clauses for SAT, linear forms for LP/MIP, propagators for CP.
Add an objective if you want optimization rather than feasibility. Drop the "solve minimize ..." line and you get back to plain SAT-as-IP: just find any solution.