Solving problems using Z3Py.
Z3Py code to solve the scheduling problem is given as follows. There are seven jobs #1, #2, #3, #4, #5, #6 and #7. All jobs are executed by three people A, B, and C. Solutions of the scheduling problem must satisfy all of the following constraints.
- Each job should be executed by one of three persons A, B, and C without interruption.
- Each person can handle at most one job each time.
- Each job #𝑖 has running time 3 + 𝑖 if person C executes it, and 4 + 𝑖 otherwise.
- Only person B is allowed to execute jobs #1 and #7.
- Job #2 should run after jobs #5 and #6 have finished.
- Each job should be done in time 0 to 20.
Declare only three functions whose domains and ranges are both the set of integers.
- Function S maps each job to its start time.
- Function E maps each job to its end time.
- Function P maps each job to the person who executes it.
Z3Py code to establish the possibility that the following program causes a crash.
![Screenshot 2024-05-13 at 8 57 15 PM](https://private-user-images.githubusercontent.com/75387392/330190164-07f9436a-fc77-498e-8f57-56c23a400913.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMDY0MjAsIm5iZiI6MTczOTAwNjEyMCwicGF0aCI6Ii83NTM4NzM5Mi8zMzAxOTAxNjQtMDdmOTQzNmEtZmM3Ny00OThlLThmNTctNTZjMjNhNDAwOTEzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDA5MTUyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMzZjFjMzE0NDc5ZWVmZTZiY2UxNjVmZWUxMmFhMmYzMzA4YTdjZjM2NjU1NzIwOTIxZDM5NTJkMzE2NjRjNjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.VHabOwrf9-Q79292-_u7VCI--8ZbYclrZDQ0aOTxjXc)
Here, ‘←’ is an assignment operator, and ‘?1’ and ‘?2’ are unknown tests that may yield false or true in any situation.
Solve the magic squares problem using Z3Py, the task is to construct a magic square, given an incomplete N x N number grid square.