We consider the problem of automatically establishing that a given syntax-guided-synthesis (SyGuS) problem is unrealizable (i.e., has no solution). Existing techniques have quite limited ability to establish unrealizability for general SyGuS instances in which the grammar describing the search space contains infinitely many programs. By encoding the synthesis problem's grammar G as a nondeterministic program PG, we reduce the unrealizability problem to a reachability problem such that, if a standard program-analysis tool can establish that a certain assertion in PG always holds, then the synthesis problem is unrealizable.Our method can be used to augment existing SyGuS tools so that they can establish that a successfully synthesized program q is optimal with respect to some syntactic cost-e.g., q has the fewest possible if-thenelse operators. Using known techniques, grammar G can be transformed to generate the set of all programs with lower costs than q-e.g., fewer conditional expressions. Our algorithm can then be applied to show that the resulting synthesis problem is unrealizable. We implemented the proposed technique in a tool called nope. nope can prove unrealizability for 59/132 variants of existing linear-integer-arithmetic SyGuS benchmarks, whereas all existing SyGuS solvers lack the ability to prove that these benchmarks are unrealizable, and time out on them.1 Grammar G2 only generates terms that are equivalent to some linear function of x and y; however, the maximum function cannot be described by a linear function. 2 The synthesis problem presented above is one that is generated by a recent tool called QSyGuS, which extends SyGuS with quantitative syntactic objectives [10]. The advantage of using quantitative objectives in synthesis is that they can be used to produce higher-quality solutions-e.g., smaller, more readable, more efficient, etc. The synthesis problem (ψmax2(f, x, y), G2) arises from a QSyGuS problem in which the goal is to produce an expression that (i) satisfies the specification ψmax2(f, x, y), and (ii) uses the smallest possible number of if-then-else operators. Existing SyGuS solvers can easily produce a solution that uses one if-then-else operator, but cannot prove that no better solution exists-i.e., (ψmax2(f, x, y), G2) is unrealizable.