Main problem formally specified