Datatype defining rewrite systems for naturals and integers (Logical Methods in Computer Science, 2021)