We propose a new high-level programming notation, called FIDO, that we have designed t o c oncisely express regular sets of strings or trees. In particular, it can be viewed as a domain-speci c language for the expression of nite-state automata on large alphabets of sometimes astronomical size. FIDO is based on a combination of mathematical logic and programming language concepts. This combination shares no similarities with usual logic programming languages. FIDO compiles into nitestate string or tree automata, so there i s n o c oncept of run-time. It has already been applied to a variety of problems of considerable complexity and practical interest. In the present paper, we motivate the need for a language like FIDO, and discuss our design and its implementation. We show how recursive data types, uni cation, implicit coercions, and subtyping can be merged with a variation of predicate logic, called the Monadic Second-order Logic M2L on trees. FIDO is translated rst into pure M2L via suitable encodings, and nally into nite-state automata through the MONA tool.