A Theory of Formal Choreographic Languages (Logical Methods in Computer Science, 2023)