• 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

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.

1 de 2

(2)

Exercise 2

On the counter we have a 10-liter pitcher full of milk, an empty seven-liter pitcher, and an empty three-liter pitcher.

The pitchers are unmarked, and your task is to divide the 10 liters of milk so that both the 10 liter pitcher and the seven-liter pitcher are each holding exactly five liter (from now on the "Equilibrium condition"). Model the problem as a nuXmv model and check if a valid trace exists using LTL specifications.

Some suggestions to encode the problem:

• If you decide to pour the content of one pitcher to another one, you can stop either when the first pitcher becomes empty or when the second pitcher becomes full. You cannot stop in the middle of the procedure.

• The operatormin(arg1, arg2) can be used to set the value of a variable as the minimum between two options. You can use it to encode the previous condition.

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 steps from the initial state).

2 de 2

Riferimenti

Documenti correlati

In the second stage the class sequence, generated by the first one, is computed in order to minimize the delays between the actual and estimated take-off time of each

 Design and implement a Kalman filter providing an estimate of the population in each class, by using the input data u(t) and the measurements y(t)..  Plot the obtained estimates

This paper reports an experimental study of transient natural convection heat and mass transfer between two large cylindrical reservoirs connected through a short

The walk begins at vertex 0 and continues until every vertex has been visited and the walk returns to vertex 0.. Indeed the already visited verteces are contiguous, the starting

[r]

To drill a cube is to partition it into 27 congruent subcubes and remove the closed central cube along with the 6 remaining subcubes sharing a face with that cube, resulting in a

[r]

Government Printing Office , Social Security Administration (US)..