COMPILATION AND REGISTRATION OF SG DIAGRAMS