-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.pl
More file actions
347 lines (296 loc) · 10.4 KB
/
code.pl
File metadata and controls
347 lines (296 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
:-dynamic ask_name/1.
:-dynamic ask_minor/1.
:-dynamic ask_subminor/1.
:-dynamic ask_branch/1.
:-dynamic ask_choice/1.
:-dynamic ask_choice2/1.
:-dynamic ask_btp/1.
:- nl,write('Type "suggest." to get started.'),nl,nl.
print_intro():-
write('STUDENT ADVISOR SYSTEM FOR CHOOSING ELECTIVES IN IIIT DELHI.'),nl,
write('Responser must have already completed 4 semesters and passed all courses.'),nl.
print_minor_intro(X,Y):-
Y==20,
write("You need total of "),write(Y),write(" credits to get "),write(X),write(" minor."),nl,
write("where 16 credits earned by regular courses and rest 4 credits earned by IP/IS."), nl.
print_minor_intro(X,Y):-
Y==24,
write("You need total of "),write(Y),write(" credits to get "),write(X),write(" minor."),nl,
write("where 16 credits earned by regular courses and rest 4 credits earned by elective courses and rest 4 credits by BTP."), nl.
% prints list
printlist([]).
printlist([X|List]) :-
write(X),nl,
printlist(List).
% removes l2 from l1
remove_list([], _, []).
remove_list([X|Tail], L2, Result):- member(X, L2), !, remove_list(Tail, L2, Result).
remove_list([X|Tail], L2, [X|Result]):- remove_list(Tail, L2, Result).
% list concatination
list_concat([],L,L).
list_concat([X1|L1],L2,[X1|L3]) :- list_concat(L1,L2,L3).
% ENT MINOR
ent_core(["Entrepreneurial Khichadi", "New Venture Planning", "Entrepreneurial Communication"]).
ent_core_electives(["Product Development", "Designing Human Centered Systems", "Ideation", "Creative Thinking","Innovation"]).
ent_electives(["Marketing","Entrepreneurial Finance", "Microeconomics", "SocialEntrepreneurship"]).
prof_ent(["Tavpritesh","Pankaj Vajpayee","Payal C Mukherjee","Rakesh Chaturvedi"]).
% BIO MINOR
bio_core(["Biophysics","Cell Biology & Biochemistry", "Foundations of Modern Biology","Chemoinformatics","NB","ACB","MLBA","BDMH","CGAS"]).
prof_bio(["Tavpritesh","Raghava","Arjun Ray","Debarka Sengupta","Ganesh Bagler","Jaspreet Kaur Dhanjal"]).
% ECO MINOR
prof_eco(["Aasim Khan","Gaurav Arora","Kiriti Kanjilal","Souvik Dutta","Gayatri Nair"]).
eco_core(["Econometrics1", "Microeconomics", "Game theory"]).
eco_electives(["Market Design","Behavioural Economics","Foundations of Finance","Valuation and Portfolio Management","Derivatives and Risk Management","Spatial Statistics and Spatial Econometrics"]).
suggest:-
print_intro,
write("Enter your name ?"),nl,
consult('facts.pl'),
ask_name(NAME),nl,
write(NAME),nl,
write("Dear "), write(NAME),write(", Please answer the following questions to get set of electives which can be done."),nl,
write(NAME),write(", do you want to pursue minor in Entrepreneurship, Economics, Computational Biology (y/n) ?"),nl,
ask_minor(X),nl,
write(X),nl,
minor(X,NAME).
subminor(C,NAME):-
C=='ent',
print_minor_intro(C,24),
write(NAME),write(", Mandatory courses for you are "),nl,
ent_core(L1),ent_core_electives(L2),ent_electives(L3),
write(L1),nl,
write("Elective core courses for you are "),nl,
write(L2),nl,
write(" List of electives courses where you need to choose only 1 "),nl,
write(L3),nl,
prof_ent(L4),
write("Contact any of these prof to complete IP/IS"),nl,
printlist(L4).
subminor(C,NAME):-
C=='eco',
print_minor_intro(C,20),
write(NAME),write(" Core courses for you are "),nl,
eco_core(L1),eco_electives(L2),prof_eco(L3),
write(L1),nl,
write("Choose any one out of these courses"),nl,
write(L2),nl,
write("Contact any of these prof to complete IP/IS"),nl,
printlist(L3).
subminor(C,NAME):-
C=='bio',
print_minor_intro(C,20),
write(" Introduction to Quantitative Biology (IQB) is the only mandatory course."),nl,nl,
write(NAME),write(", You need to complete any three 3xx-5xx level courses, some are listed below"),nl,
bio_core(L1),prof_bio(L2),
write(L1),nl,
write("Contact any of these prof to complete IP/IS"),nl,
printlist(L2).
minor(X,NAME):-
X=='y',
write(" For detailed information refer to minor regulations document on website"),nl,
write(NAME),write(", Select the field you want your minors in:- Entrepreneurship, Economics, Computational Biology (ent/eco/bio) ?"),nl,
ask_subminor(C),nl,
write(C),
subminor(C,NAME).
minor(X,NAME):- X=='n',
write(NAME),write("What are your interests ?"),nl,
write("1. Data Science "),nl,
write("2. AI "),nl,
write("3. Design "),nl,
write("4. Networks Sytems Security"),nl,
write("5. Social sciences"),nl,
write("6. Software Devlopment"),nl,
ask_choice(CHOICE),nl,
write(CHOICE),nl,
write("Are you interested in doing BTP in the same? (y/n)"),nl,
ask_btp(BTP),nl,
write(BTP),nl,
write("Which branch are you in ?(cse/ece/csx)"),nl,
ask_branch(BRANCH),nl,
write(BRANCH),nl,
getelectives(BRANCH,CHOICE,Finalchoices),nl,
(
BTP == 'n'->
write(NAME),write(", Here are the list of electives for you"),nl,
write(Finalchoices);
BTP=='y'->
write(NAME),write(", Here are the list of electives for you"),nl,
write(", Since you are not from CSE branch, first 5 are CSE manatory courses are also given."),nl,
write(Finalchoices),nl,
write("Also, this is the list of profs you can contact to get BTP done"),nl,
btp_profs(L),
printlist(L)
),
write("Finished").
btp_profs(["Tavpritish Sethi","Raghava Mutharaju","TanmoyChakroborty","Jainendra Shukla","Sambuddho","Mukkulika","Pankaj Jalote","Mukesh Mohania","Rajiv Ratn","Arun Balaji"]).
cse_mandatory(["DSA","OS","DBMS","CN","OOPD"]).
datascience(["DMG","BDA","MLN","DS","BDMH"]).
ai(["ML","RL","NLP","DL","IR","AI","CV"]).
design(["DDV","DPP","WARDI","I3DD"]).
nss(["PN","NSS","FCS","NAD","NSC","CA","SE"]).
social_sciences(["TE","MB","FF","ATP","CMM","CP","CISP","ST"]).
software_devlopment(["MC","SDOS","MAD","CLDC","CMP","AOS","IBC"]).
% CSX
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='csx'),(CHOICE==1),
cse_mandatory(L1),datascience(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='csx'),(CHOICE==2),
cse_mandatory(L1),ai(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='csx'),(CHOICE==3),
cse_mandatory(L1),design(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='csx'),(CHOICE==4),
cse_mandatory(L1),nss(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='csx'),(CHOICE==5),
cse_mandatory(L1),social_sciences(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='csx'),(CHOICE==6),
cse_mandatory(L1),software_devlopment(L2),
list_concat(L1,L2,Finalchoices).
% ECE
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='ece'),(CHOICE==1),
cse_mandatory(L1),datascience(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='ece'),(CHOICE==2),
cse_mandatory(L1),ai(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='ece'),(CHOICE==3),
cse_mandatory(L1),design(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='ece'),(CHOICE==4),
cse_mandatory(L1),nss(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='ece'),(CHOICE==5),
cse_mandatory(L1),social_sciences(L2),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='ece'),(CHOICE==6),
cse_mandatory(L1),software_devlopment(L2),
list_concat(L1,L2,Finalchoices).
% CSE ELECTIVES
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='cse'),(CHOICE==6),
write("Enter another choice of interest as well"),nl,
write("Make sure you dont enter "),write(CHOICE),write(" again"),nl,
ask_choice2(CHOICE2),nl,
write(CHOICE2),nl,
(
CHOICE2 == 1 ->
datascience(L1),software_devlopment(L2);
CHOICE2 == 2 ->
ai(L1),software_devlopment(L2);
CHOICE2 == 3 ->
design(L1),software_devlopment(L2);
CHOICE2 == 4 ->
nss(L1),software_devlopment(L2);
CHOICE2 == 5 ->
social_sciences(L1),software_devlopment(L2)
),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='cse'),(CHOICE==5),
write("Enter another choice of interest as well"),nl,
write("Make sure you dont enter "),write(CHOICE),write(" again"),nl,
ask_choice2(CHOICE2),
write(CHOICE2),nl,
(
CHOICE2 == 1 ->
datascience(L1),social_sciences(L2);
CHOICE2 == 2 ->
ai(L1),social_sciences(L2);
CHOICE2 == 3 ->
design(L1),social_sciences(L2);
CHOICE2 == 4 ->
nss(L1),social_sciences(L2);
CHOICE2 == 6 ->
software_devlopment(L1),social_sciences(L2)
),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='cse'),(CHOICE==4),
write("Enter another choice of interest as well"),nl,
write("Make sure you dont enter "),write(CHOICE),write(" again"),nl,
ask_choice2(CHOICE2),
write(CHOICE2),nl,
(
CHOICE2 == 1 ->
datascience(L1),nss(L2);
CHOICE2 == 2 ->
ai(L1),nss(L2);
CHOICE2 == 3 ->
design(L1),nss(L2);
CHOICE2 == 6 ->
software_devlopment(L1),nss(L2);
CHOICE2 == 5 ->
social_sciences(L1),nss(L2)
),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='cse'),(CHOICE==3),
write("Enter another choice of interest as well"),nl,
write("Make sure you dont enter "),write(CHOICE),write(" again"),nl,
ask_choice2(CHOICE2),
write(CHOICE2),nl,
(
CHOICE2 == 1 ->
datascience(L1),design(L2);
CHOICE2 == 2 ->
ai(L1),design(L2);
CHOICE2 == 6 ->
software_devlopment(L1),design(L2);
CHOICE2 == 4 ->
nss(L1),design(L2);
CHOICE2 == 5 ->
social_sciences(L1),design(L2)
),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='cse'),(CHOICE==2),
write("Enter another choice of interest as well"),nl,
write("Make sure you dont enter "),write(CHOICE),write(" again"),nl,
ask_choice2(CHOICE2),
write(CHOICE2),nl,
(
CHOICE2 == 1 ->
datascience(L1),ai(L2);
CHOICE2 == 2 ->
ai(L1),ai(L2);
CHOICE2 == 3 ->
design(L1),ai(L2);
CHOICE2 == 4 ->
nss(L1),ai(L2);
CHOICE2 == 5 ->
social_sciences(L1),ai(L2)
),
list_concat(L1,L2,Finalchoices).
getelectives(BRANCH,CHOICE,Finalchoices):-
(BRANCH=='cse'),(CHOICE==1),
write("Enter another choice of interest as well"),nl,
write("Make sure you dont enter "),write(CHOICE),write(" again"),nl,
ask_choice2(CHOICE2),
write(CHOICE2),nl,
(
CHOICE2 == 2 ->
ai(L1),datascience(L2);
CHOICE2 == 3 ->
design(L1),datascience(L2);
CHOICE2 == 4 ->
nss(L1),datascience(L2);
CHOICE2 == 5 ->
social_sciences(L1),datascience(L2);
CHOICE2 == 6 ->
software_devlopment(L1),datascience(L2)
),
list_concat(L1,L2,Finalchoices).