Custom Solver
NOUS supports custom solver scripts, allowing you to implement your own SAT solving strategy.
How It Works
Section titled “How It Works”- Select Custom as the solver in the Reasoning tab
- Provide the path to your solver script
- The miner calls your script with the formula on stdin
- Your script outputs the solution on stdout
Script Interface
Section titled “Script Interface”Your script receives a 3-SAT formula in DIMACS CNF format on stdin:
p cnf 256 9861 -2 3 0-4 5 -6 0...Your script must output a satisfying assignment as space-separated integers:
1 -2 3 4 -5 6 ... 256Positive means true, negative means false.
Example: Python Solver
Section titled “Example: Python Solver”#!/usr/bin/env python3import sysimport random
lines = sys.stdin.read().strip().split('\n')clauses = []n_vars = 0
for line in lines: if line.startswith('p cnf'): parts = line.split() n_vars = int(parts[2]) elif line and not line.startswith('c'): lits = [int(x) for x in line.split() if x != '0'] if lits: clauses.append(lits)
# Random assignment (replace with your strategy)assignment = {i: random.choice([True, False]) for i in range(1, n_vars + 1)}
# Outputresult = []for i in range(1, n_vars + 1): result.append(str(i) if assignment[i] else str(-i))print(' '.join(result))Tips for Competitive Solvers
Section titled “Tips for Competitive Solvers”- Study ProbSAT, WalkSAT, and DPLL algorithms
- The clause-to-variable ratio (3.85) is near the SAT phase transition — formulas are hard but solvable
- Machine learning approaches can learn patterns in the formula structure
- Pre-processing (unit propagation, pure literal elimination) can simplify formulas
- GPU-accelerated solvers may provide throughput advantages