Logic programming and the specification of circuits