This paper determines mechanisms to tackle errors when implementing Boolean functions in nano-circuits. Nanofabrics are expected to have very high defect rates as atomic variations directly impact such materials. This paper develops a coding mechanism that uses a combination of cheap but unreliable nano-device as the main function and reliable but expensive CMOS devices to implement the coding mechanism. The unique feature of this paper is that it exploits the don't-cares that naturally occur in Boolean functions to construct better codes. The reliable Boolean function problem is cast as a constraint satisfaction problem and then solved using a tree-based dynamic programming algorithm.