Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
pp:l10 [2021/05/23 21:08] aghiculescu |
pp:l10 [2021/05/25 15:44] (current) roxana_elena.stiuca [Introduction to Prolog programming] |
||
|---|---|---|---|
| Line 7: | Line 7: | ||
| 2. Write a query which returns all student names which were born before 1990. | 2. Write a query which returns all student names which were born before 1990. | ||
| - | 3. Write a query which returns all student names (not ids) which were admitted before 2005. | + | 3. Write a query which returns all student names which were admitted before 2005. |
| 4. Define a predicate under18/1 which describes those student ids which had at most 18 years when admitted. | 4. Define a predicate under18/1 which describes those student ids which had at most 18 years when admitted. | ||
| Line 13: | Line 13: | ||
| Hint: use =< | Hint: use =< | ||
| - | 5 Define a predicate which is satisfied if a student Ids failed to pass AT MOST two different lectures. | + | 5. Define a predicate which is satisfied if a student Ids failed to pass at least two different lectures. |
| - | 6. Define a predicate which is satisfied if at least one student graduated it. | + | 6. Define a predicate which is satisfied if at least one student graduated the lecture. |
| Consider the following representation of natural numbers (from our last lecture): | Consider the following representation of natural numbers (from our last lecture): | ||
| Line 75: | Line 75: | ||
| studies(9,aa). | studies(9,aa). | ||
| studies(10,pp). | studies(10,pp). | ||
| - | studies(11,lfa). | + | studies(11,lfa). |
| %grade(Id,Lecture,Grade) | %grade(Id,Lecture,Grade) | ||
| + | grade(10,pp,4). | ||
| grade(9,pp,6). | grade(9,pp,6). | ||
| grade(10,aa,4). | grade(10,aa,4). | ||