The logic part of group 4's PSE project.