Лифп / Лабораторная работа №1
.docxМИНИСТЕРСТВО ОБРАЗОВАНИЯ И НАУКИ КЫРГЫЗСКОЙ РЕСПУБЛИКИ
КЫРГЫЗСКИЙ ГОСУДАРСТВЕННЫЙ ТЕХНИЧЕСКИЙ
УНИВЕРСИТЕТ ИМ. И. РАЗЗАКОВА
Лабораторная работа
Бишкек 2021
Построение динамической базы данных
Вариант №7
Найти всех студентов иностранцев, которые учатся на факультете, количество
кафедр которых меньше заданного.
Листинг кода:
Domains
Name, Faculty, Marital_status, Nationality = string.
Grade, Count_of_subject_debtors, Count_of_debt_debtors, Count_of_students, Count_of_cathedra=integer.
Average_mark = symbol.
Address, Date_of_birth, Group = symbol.
Contract = integer.
Paid = integer.
predicates
nondeterm student_info(Name, Grade, Faculty, Group, Average_mark, Contract, Paid).
nondeterm personal_info(Name, Address, Date_of_birth, Nationality, Marital_status).
nondeterm faculty_info(Faculty, Count_of_cathedra, Count_of_students, Count_of_debt_debtors, Count_of_subject_debtors).
nondeterm prav(Name, Nationality, Count_of_cathedra).
clauses
student_info(kudashov, 4, fit, is_18, "3,8", 51400, 30000).
student_info(shabyev, 2, ivt, pi_20, "4,2", 64300, 24000).
student_info(asanbekov, 5, fit, is_17, "4,5", 46100, 26700).
personal_info(kudashov, ulan_2, "31.02.2001", deutsch, married).
personal_info(shabyev, archa_beshik, "29.02.2003", kyrgyz, lone_wolf).
personal_info(asanbekov, sosnoviy, "28.02.1999", korean, engaged).
faculty_info(fit, 10, 243, 32, 83).
faculty_info(ivt, 100, 461, 158, 309).
prav(Name, Nationality, Count_of_cathedra):-personal_info(Name,_,_,Nationality,_),Nationality><"kyrgyz",
faculty_info(_,Count_of_cathedra,_,_,_),Count_of_cathedra<=10.
goal
prav(Name, Nationality, Count_of_cathedra).
Фото результат: