ϵ">]>
Literature.
[1] J. Komara. Specification and Verification of Programs. Downloadable lecture notes available through the web page of the course.
[2] J. Komara and P. J. Voda. Metamathematics of Computer Programming. 2001.
Exercise. Your task is to use CL as a simple calculator for the evaluation of arithmetic expressions in the form of so-called queries. The window Query which appears at the end is designed for the input of queries. The result of a given query will be displayed in the window Results.
Examples of simple queries:
Addition. Query: . CL-syntax is: . Result: true for .
Modified subtraction. Query: . CL-syntax is: . Result: true for .
Multiplication. Query: . CL-syntax is: . Result: true for .
Integer (Euclidean) division. Query: . CL-syntax is: . Result: true for .
Remainder after integer division. Query: . CL-syntax is: . Result: true for .
Further apply these queries:
The last two examples illustrate the following properties of arithmetic operators:
Exercise. It is possible to evaluate also compound queries (conjunctions of simple queries). For instance
CL-syntax is:
Result: true for , , and .
Examples of syntactically incorrect queries (when reading the queries from left to right):
. The variable has not been assigned a value.
. The variable has not been assigned a value.
. The variable has not been assigned a value.
Exercise. Your next task is to use CL for the evaluation of arithmetic comparison relations.
Examples of simple queries:
Query: . CL-syntax: . Result: true.
Query: . CL-syntax: . Result: false.
Query: . CL-syntax: . Result: true.
Query: . CL-syntax: . Result: false.
Query: . CL-syntax: . Result: false.
Query: . CL-syntax: . Result: true.
Example of a compound query:
Query: . Result: true.
Examples of syntactically incorrect queries:
. The variable has not been assigned a value.
. The variable has not been assigned a value.