You can write a minikanren program that will generate quines.
> We will teach attendees how to use the relational (logic) language miniKanren to write several relational interpreters and reducers capable of automatically synthesizing recursive, symbolic programs, including quines (programs that evaluate to themselves) and fixpoint combinators (such as the famous Y-combinator). https://www.thestrangeloop.com/2014/program-synthesis-using-...
- miniKanren, live and untagged: quine generation via relational interpreters (programming pearl) (http://webyrd.net/quines/quines.pdf) by William E. Byrd, Eric Holk, and Daniel P. Friedman