Ideas of Order: A Formal Approach to Architecture