======
Quiz
======

-----------------------
Quiz - Formal Methods
-----------------------

Which statement is correct?

   A. A formal method analyses code.
   B. :answer:`A formal method has no missing alarms.`
   C. A formal method has no false alarms.
   D. Static analysis of programs should be automatic, precise and sound.

.. container:: animate

   Explanations

   A. Formal methods can also apply to requirements, models, data, etc.
   B. Correct
   C. To achieve soundness, it may be impossible to avoid false alarms.
   D. Pick any two!

--------------
Quiz - SPARK
--------------

Which statement is correct?

   A. SPARK is a recent programming language.
   B. SPARK is based on proof.
   C. SPARK analysis can be applied to any Ada program.
   D. :answer:`SPARK requires annotating the code with specifications`.

.. container:: animate

   Explanations

   A. SPARK is a subset of Ada dating back to the 80s.
   B. SPARK is also based on flow analysis which is a form of abstract interpretation.
   C. SPARK subset restricts the features of Ada for proof.
   D. Correct

--------------------------
Quiz - SPARK in Practice
--------------------------

Which statement is correct?

   A. :answer:`There are 5 levels of software assurance with SPARK.`
   B. Proving absence of run-time errors is hard with SPARK.
   C. Full functional correctness is impossible to prove with SPARK.
   D. SPARK code cannot be mixed with other programming languages.

.. container:: animate

   Explanations

   A. Correct
   B. AoRTE is a common objective with SPARK because it is simple.
   C. Full functional correctness is hard but can be achieved.
   D. SPARK code can be interfaced with code in Ada/C/C++, etc.

