Implement equality for schedules and patterns