Abstract: The Extended Theory of Trees and Algebraic (Co)datatypes Fabian Zaiser, Luke Ong University of Oxford, United Kingdom Abstract The first-order theory of algebraic datatypes (and codatatypes) is an important theory implemented in many SMT solvers. It is related to the theory of finite and infinite trees, which has been studied since the eighties, especially by the logic programming community. Following Djelloul, Dao and Frühwirth, we consider an extension of the latter theory with an additional predicate for finiteness of trees, which is useful for expressing properties about (not just datatypes but also) codatatypes. Based on their work, we present a simplification procedure that determines whether any given (not necessarily closed) formula is satisfiable, returning a simplified formula which enables one to read off all possible models. Our extension makes the algorithm usable for algebraic (co)datatypes, which was impossible in their original work due to restrictive assumptions. To this end, we clarify the relationship between the two theories and describe a translation procedure. We find that trees are in some ways more expressive than (co)datatypes while preserving decidability, which makes them interesting for SMT applications. We also provide a prototype implementation of our simplification procedure and evaluate it on instances from the SMT-LIB. The full article (DOI: 10.4204/EPTCS.320.14) is published in the proceedings of the 2020 ETAPS workshop Horn Clauses for Verification and Synthesis. Keywords theory of trees, decision procedure, first-order theory, algebraic datatypes, inductive datatypes, coinduc- tive datatypes SMT’21: 19th International Workshop on Satisfiability Modulo Theories, July 18–19, 2021, Online " fabian.zaiser@cs.ox.ac.uk (F. Zaiser); luke.ong@cs.ox.ac.uk (L. Ong)  0000-0001-5158-2002 (F. Zaiser); 0000-0001-7509-680X (L. Ong) © 2021 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0). CEUR Workshop Proceedings http://ceur-ws.org ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org) 65