How to use propositions and quantifiers in system specifications
System specifications
System specifications demonstrate the requirements of a system and work as a mindmap for software engineers during the system development phase. System and software engineers take the requirements in natural language. Translating them into logical expressions is essential in producing hardware and software systems specifications.
Propositions and quantifiers
Logical propositions and quantifiers prove beneficial in representing system specifications.
Let’s see how we can logically express specifications in the following examples.
Example 1
Let’s express the following specification using logical connectives:
- : The user cannot log in when the password is incorrect.
Here is one way to translate this. Consider:
- : The user can log in.
- : The password is incorrect.
Now:
- The user cannot log in.
Subsequently, we can represent the specification by the conditional statement .
Example 2
For the following example, we’ll use predicates and quantifiers to express the given two system specifications.
- : Every username containing more than two underscores will be considered invalid.
- : If a user is logged in, all the available features will be shown.
Let and be two predicates for the first specification .
- : The username contains more than underscores, where has the domain of all the usernames, and is a positive integer.
- : The username will be considered invalid.
Then, we can represent the specification as follows:
For the second specification, , consider the following predicates:
- : User is logged in, where has the domain of all the users.
- : The feature is shown to the user, where has the domain of all the features.
Then we can represent the specification as follows:
Consistency of specifications
One of the significant benefits of translating system specifications into logical expressions is to check for the consistency of specifications. That is, there should not be any conflicting requirements. We can use compound propositions and quantifiers to express the specifications and then find an assignment of truth values that make all the specifications true. Consequently, we can develop a system that satisfies all the requirements.