Professional Documents
Culture Documents
C OMSATS University Islamabad, Lahore Campus: Sessional-1 Sessional-II Terminal Examination - Spring 2021
C OMSATS University Islamabad, Lahore Campus: Sessional-1 Sessional-II Terminal Examination - Spring 2021
Question 1:
[Marks: 2+2=4]
In a class management system, [Student] is type for the students. Further, size : N represents the size of a class.
The sets, registered, passed : ℙ Student are declared as variables. Write predicates to formalize the following
statements.
i. The number of registered students must not exceeds the size of the class.
ii. Only the registered students can be passed.
In the library management system, [Book] is type for the books owned by the library. The sets on_loan,
on_shelves, books, novels, reference: ℙ Book are declared as variables. Write predicates to formalize the
following statements using the set variables: on_loan, on_shelves, books, novels, reference.
a) The number of books which are on loan can’t exceed the number of books on shelves.
b) Every book in the library is either on loan or on the shelves.
1
c) No book can be on loan and on the shelves.
d) The number of reference books can’t exceed integer value Limit.
e) No novel can be a reference book.