Restructured to allow for bachelor of arts and bachelor of science degrees

parent 3f9d7231
_req(rhet1302,required).
_req(ecs3390,required).
_req(math2417,required).
_req(phys2325,required).
_req(phys2326,required).
_req(govt2305,required).
_req(govt2306,required).
_req(ecs3361,required).
_req(math2419,required).
_req(phys2125,required).
_req(phys2126,required).
_req(chem1111,required).
_req(chem1311,required).
_req(cs1325,required).
_req(ecs1100,required).
_req(math2419,required).
_req(math2420,required).
_req(mech1100,required).
_req(mech1208,required).
_req(mech2120,required).
_req(engr2300,required).
_req(mech2310,required).
_req(mech2320,required).
_req(mech2330,required).
_req(ecs3361,required).
_req(ecs3390,required).
_req(mech3105,required).
_req(mech3115,required).
_req(mech3120,required).
_req(mech3150,required).
_req(engr3300,required).
_req(mech3305,required).
_req(mech3310,required).
_req(mech3315,required).
_req(mech3320,required).
_req(engr3341,required).
_req(mech3350,required).
_req(mech3351,required).
_req(mech4110,required).
_req(mech4310,required).
_req(mech4381,required).
_req(mech4382,required).
_req(hist1301,americanHist).
_req(hist1302,americanHist).
_req(hist2301,americanHist).
_req(hist2331,americanHist).
_req(phil1301,lang).
_req(phil2316,lang).
_req(huma1301,lang).
_req(arab2312,lang).
_req(chin2312,lang).
_req(fren2312,lang).
_req(germ2312,lang).
_req(japn2312,lang).
_req(lit2331,lang).
_req(span2312,lang).
_req(ams2300,lang).
_req(ams2341,lang).
_req(ams3300,lang).
#include 'bio2015req.lp'.
#include 'bio2015req2.lp'.
#include 'bio2015grad.lp'.
#include 'bio2015audit.lp'.
ableToGraduate(Student):-
_metRequiredCourses(Student),
_meetsHours(Student,lang,3),
_meetsHours(Student,art,3),
_meetsHours(Student,americanHist,6),
_meetsHours(Student,mePrescribed,9),
_meetsElectiveHours(Student,6).
_audit(Student):-
_auditRequiredCourses(Student),
_auditHours(Student,lang,3),
_auditHours(Student,art,3),
_auditHours(Student,americanHist,6),
_auditHours(Student,mePrescribed,9),
_auditElectiveHours(Student,6).
_main(Student):-
ableToGraduate(Student).
_main(Student):-
_audit(Student).
_auditRequiredCourses(Student):-
_t(Student,rhet1302),
_t(Student,ecs3390),
_t(Student,math2417),
_t(Student,phys2325),
_t(Student,phys2326),
_t(Student,govt2305),
_t(Student,govt2306),
_t(Student,ecs3361),
_t(Student,math2419),
_t(Student,phys2125),
_t(Student,phys2126),
_t(Student,chem1111),
_t(Student,chem1311),
_t(Student,cs1325),
_t(Student,ecs1100),
_t(Student,math2419),
_t(Student,math2420),
_t(Student,mech1100),
_t(Student,mech1208),
_t(Student,mech2120),
_t(Student,engr2300),
_t(Student,mech2310),
_t(Student,mech2320),
_t(Student,mech2330),
_t(Student,ecs3361),
_t(Student,ecs3390),
_t(Student,mech3105),
_t(Student,mech3115),
_t(Student,mech3120),
_t(Student,mech3150),
_t(Student,engr3300),
_t(Student,mech3305),
_t(Student,mech3310),
_t(Student,mech3315),
_t(Student,mech3320),
_t(Student,engr3341),
_t(Student,mech3350),
_t(Student,mech3351),
_t(Student,mech4110),
_t(Student,mech4310),
_t(Student,mech4381),
_t(Student,mech4382).
_metRequiredCourses(Student):-
_t(Student,rhet1302),
_t(Student,ecs3390),
_t(Student,math2417),
_t(Student,phys2325),
_t(Student,phys2326),
_t(Student,govt2305),
_t(Student,govt2306),
_t(Student,ecs3361),
_t(Student,math2419),
_t(Student,phys2125),
_t(Student,phys2126),
_t(Student,chem1111),
_t(Student,chem1311),
_t(Student,cs1325),
_t(Student,ecs1100),
_t(Student,math2419),
_t(Student,math2420),
_t(Student,mech1100),
_t(Student,mech1208),
_t(Student,mech2120),
_t(Student,engr2300),
_t(Student,mech2310),
_t(Student,mech2320),
_t(Student,mech2330),
_t(Student,ecs3361),
_t(Student,ecs3390),
_t(Student,mech3105),
_t(Student,mech3115),
_t(Student,mech3120),
_t(Student,mech3150),
_t(Student,engr3300),
_t(Student,mech3305),
_t(Student,mech3310),
_t(Student,mech3315),
_t(Student,mech3320),
_t(Student,engr3341),
_t(Student,mech3350),
_t(Student,mech3351),
_t(Student,mech4110),
_t(Student,mech4310),
_t(Student,mech4381),
_t(Student,mech4382).
This diff is collapsed.
......@@ -7,7 +7,7 @@ import csv,sys
if len(sys.argv) != 2:
print("Usage: give transcript as argument")
print("Usage: python main_writer.py /path/to/transcript")
transcript = sys.argv[1]
......@@ -17,46 +17,42 @@ except IOError:
print("transcript not found")
sys.exit()
csvr = list(csv.reader(csvfile))
student = csvr[0][0] #name of student is first value on first line
major = csvr[0][1] #major is second value on first line
year = csvr[0][2] #degree plan year is third value on first line
spec = csvr[2][0] #specialization is first value on third line
csvr = list(csv.reader(transcript))
student = csvr[0][0]
(degree,major,year,spec) = csvr[1]
req = "%s/%s/%s%sreq.lp" % (major,year,major,year)
try:
req = '%s/%s/%s/%s%sreq.lp' % (degree,major,year,major,year)
try:
req = open(req)
req = req.read()
except:
print('requirements file not found')
sys.exit()
except:
print('requirements file not found')
sys.exit()
with open('main.lp','w') as main:
main.write("student(%s,%s).\n"%(student,major))
csvr = csvr[1]
taken = '_taken(%s,[' % student
courses = csvr[2] #list of courses student has taken
taken = '_taken(%s,[' % student
hasTaken = str()
for c in csvr:
for c in courses:
#include only those courses that could possibly
#counted as electives in the 'taken list' i.e.
#those that are not required.
if not ('_req(%s,required).' % c) in req:
taken += "%s," % c
hasTaken += '_hasTaken(%s,%s).\n' % (student, c)
hasTaken += '_hasTaken(%s,%s).\n' % (student, c)
main.write('\n')
taken = taken[:-1]
taken += ']).\n'
main.write(hasTaken+'\n')
main.write(taken+'\n')
#write the student's specialization as a fact if it is
#declared in the transcript
if spec != 'none':
main.write('_specialization(%s,%s).\n' %(student,spec))
main.write("#include 'counting.lp'.\n")
main.write("#include '%s/%s/%s%srules.lp'.\n" % (major,year,major,year))
main.write("#include '%s/%s/%s/%s%srules.lp'.\n" % (degree,major,year,major,year))
main.write('?- _main(%s).\n' % student)
bob,cs,2015
bob
bs,cs,2015,none
hist1301,hist1302,cs3162,cs3305,cs3340,cs3341,cs3345,cs3354,cs3376,cs3361,cs3390,cs4141,cs4337,cs4341,cs4347,cs4348,cs4349,cs4384,cs4485,math2413,math2418,cs1200,cs1337,cs2305,cs2336,chem1311,phys2125,phys2126,phys2325,phys2326,cs4314,cs4315,cs4334,huma1301,ahst2331
none
\ No newline at end of file
bob,me,2015
bob
bs,me,2015,none
hist1301,hist1302,cs3162,cs3305,cs3340,cs3341,cs3345,cs3354,cs3376,cs3361,cs3390,cs4141,cs4337,cs4341,cs4347,cs4348,cs4349,cs4384,cs4485,math2413,math2418,cs1200,cs1337,cs2305,cs2336,chem1311,phys2125,phys2126,phys2325,phys2326,cs4314,cs4315,cs4334,huma1301,ahst2331
none
\ No newline at end of file
jill,math,2015,
jill
bs,math,2015,none
cs1337,phys2125,phys2126,phys2325,phys2326,chem1311,chem1111,math2417,hist1301,hist1302,math2419,govt2305,govt2306,rhet1302,cs2305,cs2336,cs3305,cs3340,math2418,ahst2331,math3310,cs3345,cs3341,cs4V98,math2451,math3311,math3323,ecs1200,comm1311,econ2301,math2420,math3379,math4301,math4302,math4334,math3312,math3380,stat4351,stat4341,huma1301,math4341,math4355
none
\ No newline at end of file
sai,cs,2014
sai
bs,cs,2014,none
cs1337,phys2125,phys2126,phys2325,phys2326,chem1311,chem1111,math2417,hist1301,hist1302,math2419,govt2305,govt2306,rhet1302,cs2305,cs2336,cs3305,cs3340,math2418,ahst2331,math3310,cs3345,cs3341,cs4V98,math2451,math3311,math3323,ecs1200
none
\ No newline at end of file
sai,math,2015,
sai
bs,math,2015,applied
cs1337,phys2125,phys2126,phys2325,phys2326,chem1311,chem1111,math2417,hist1301,hist1302,math2419,govt2305,govt2306,rhet1302,cs2305,cs2336,cs3305,cs3340,math2418,ahst2331,math3310,cs3345,cs3341,cs4V98,math2451,math3311,math3323,ecs1200,ecs3390
applied
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment