• Non ci sono risultati.

Formal Methods - lab exam Facsimile di prova Exercise 1

N/A
N/A
Protected

Academic year: 2021

Condividi "Formal Methods - lab exam Facsimile di prova Exercise 1"

Copied!
2
0
0

Testo completo

(1)

Formal Methods - lab exam Facsimile di prova

Exercise 1

You are the owner of one of the most prestigious concert halls in New York. In the last days you received a lot of requests from different bands to book the hall on the 4th of July and you are unsure about being able to accept them all. Some organization rules are the following:

• Bands can book the hall from 18.00 to 24.00.

• Bands can reserve one or more slots of 1 hours, the slots being 18.00-19.00, 19.00-20.00, 20.00-21.00 and so on.

This is the list of all the requests received until now:

• The Beagles: from 19.00 to 21.00 or from 22.00 to 24.00

• AC/DC++: 3 consecutive hours, no matter when.

• Rolling Stonks: from 18.00 to 19.00 or from 23.00 to 24.00

• Kanji West: 1 hour among all the slots, excluding the first slot and the last one.

Use OptiMathSAT to encode the problem as a SAT problem (make sure not to use non-Boolean data types) and see if you can satisfy the requests of all the customers.

• If you can satisfy everyone, write a comment reporting the valid schedule.

• Otherwise slightly modify the problem so that you can return a schedule where the maximum amount of bands can perform live. Take into account that AC/DC++ must perform no matter what, given their popularity.

1 de 2

(2)

Exercise 2

Four students took a test where every question had two possible answers, A or B. Each question was worth 10 points, for a total of 100 points. There is no penalty for giving a wrong answer. The students’ test results were posted as seen below:

As you can see, the teacher forgot to tally John’s score. John was heading to the teacher’s office when Mary called him back, saying they could figure out his score using the results from the other tests. Can you figure out John’s score?

Use MathSAT to encode the problem as a SMT problem and find the solution. Once obtained, report it on as a comment at the end of the file. Is the answer key reported as a solution unique (meaning that there is no other possible answer assignment reaching the same score)? Add some constraints to test its uniqueness and write in a comment the result:

• If the solution is unique, write how you assumed it.

• If the solution is not unique, write how you assumed it and report a second solution in the comments.

2 de 2

Riferimenti

Documenti correlati

HUVECs were seeded on immobilized FG or gremlin, stained for VEGFR2 (green), β 3 integrin (blue) and GM1 ganglioside (red) and acquired using a LSM510 Meta confocal

Nella Storia del Paese il 1916 rappresenta una contested date legata sì alla memoria dell’Insurrezione, ma anche a quella del contributo di tanti giovani irlandesi che arruolatisi

Once written the model, test the property and write as a comment in the file the number of steps necessary to reach the condition (use a support variable to store the number of

Of those surveyed, only 12% said that communication with the general public is truly relevant, whereas a limited 10% said that the relation with general journalists is

I pubblici con cui gli scienziati e i tecnici del Regno Unito ritengono più facile comunicare sono i giornalisti scientifici e gli uomini dell’industria (29%

The main idea, in the application of elastic wavelets to the evolution of solitary waves, consists not only in the wavelet representation of the wave, but also in the assumption

outh picks up the story as Coetzee, in his late teens, seeks an escape from his dilemmas in literature: “For he will be

Indeed, consider the example in Figure 1: if the iterative solution method visits the feasible coloring c 1 and if the upper bound on the number of colors which may be used is 3,