Title: Formal Approach to Gestalt Theory