This book constitutes the refereed proceedings of the 31st International Conference on Logic-Based Program Synthesis and Transformation, LOPSTR 2021, which …