| CARVIEW |
Select Language
HTTP/2 200
date: Sun, 28 Dec 2025 21:39:09 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"eeb3d35536998b1f06ec4afb8e336fcd"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com marketplace-screenshots.githubusercontent.com/ copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com github.githubassets.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=AFhbfkUWFtjkuZfblzbGvk7jO02RNO5L4yd7DPAOekrje%2BT%2FiCG%2BvQvqL%2Fy2DmRTSz5EFXwuOWsZIXGHIATFS3yhPLmdF%2Bq2qXBi7yNkssqn3A3jw0jLK%2Bm6CG4evF3bXufRAGZURSz%2Bz%2BusRYTj3O9SW8JC0YT1aeq%2BTY9wuB%2FcKm9kodKHza%2Br3NZyBD9DQCTlewzReoPQrZ%2FshjKwbJKvUJ6X3KZ8t1y%2Ft%2FtLmJldMA62HEm1hlFlJ7WLac7D89bQe23HaHCg3UGzofidRQ%3D%3D--6lnUx8odSzpk2vM6--PYj9x90M5yCuxyVxIrKiPQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1020772855.1766957949; Path=/; Domain=github.com; Expires=Mon, 28 Dec 2026 21:39:09 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 28 Dec 2026 21:39:09 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 8BDA:21D903:5501664:66B339E:6951A37D
GitHub - nmakes/lcs-project: Final project (written in prolog) for the course CS F214 Logic in Computer Science
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 0
nmakes/lcs-project
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
======================================= Prolog Assignment. Submitted by: Naveen Venkat (2015A7PS078P) Jay Virendra Pokarna (2015A7PS067P) ======================================= =============================== Q1. A simple expression reducer =============================== This prolog program simplifies (reduces) a given SOP or POS expression. For eg. 2*x*6*y + x*9*3 + x*y*1 = 27*x + 13*x*y (x+8+2)*(7+y+x+9) = (x+10)*(16+x+y) This is represented in the model as follows: s([ p([2,6,xy]), p([x,9,3]), p([xy,1]) ]) and p([ s([x,8,2]), s([7,y,x,9]) ]) NOTE: 1. x,y used above are variables. 2. The s() predicate takes a list and represents the sum of the list elements. 3. The p() predicate takes a list and represents the product of the list elements. 4. A variable x in mathematics can be represented by s([0,x]) or p([1,x]) in this program. 5. There must be at least one number in the list. IMPORTANT NOTE: When giving an input expression, the product of variables x*y*z is to be written as a single variable xyz in the list of the product predicate. -- To get the reduced expression, we use the reduce predicate which is of the form reduce(Expr, Result). This will set the Result variable to the reduced form of the expression represented by Expr. Hence, ?- reduce(s([ p([2,6,xy]), p([x,9,3]), p([xy,1]) ]), RESULT). RESULT = s([p([xy, 12]), p([x, 27]), p([xy, 1])]). ?- reduce(p([ s([x,8,2]), s([7,y,x,9]) ]), RESULT). RESULT = p([s([x, 10]), s([y, x, 16])]). -- Equality of two expressions can be tested by using the equal predicate defined. For eg. ?- equal(s([p([3,x])]), s([p([1,x]), p([3,x])])). false. ========================== Q2. Student Knowledge base ========================== This program will give the details about a student and the courses availible at BITS. This has also covered various registration norms, like late registration etc. We have given a sample set of data in the program itself. For this sample data, some of the queries that can be asked are as follows: ?- eligiblePs1(namo). false. ?- allowedToRegister(jay,c(g,512,4,eee)). false. ?- registerForC(jay, c(f,351,3,cs)). false. -- Some of the predicates and their meanings: c(A,B,C,D): Represents a course. A - first / higher degree B - course number C - no of units D - Department clearedC(X,c(A,B,C,D),N,U): Represents student X clearing course c(A,B,C,D). X - Name of Student c(A,B,C,D) - course N - the semester in which it is offered. U - grade in that course notClearedC(X, c(A,B,C,D),N): Represents student X not clearing course c(A,B,C,D). X - Name of Student c(A,B,C,D) - course N - the semester in which it is offered. prereq(Student, c(A,B,C,D)): Checks if Student can do a course c(A,B,C,D) which has prerequisites. studentDiscipline(X,Y,Z,A): X - name of student Y- first / higher degree Z - department A - first degree (1) / dual degree(2) -- duesPaid(X): X has paid dues. feesPaid(X): X has paid fees. gradeSheetWithheldPrecedingSemester(X): Grade sheet of X is withheld. incompleteReportPrecedingSemester(X): X has an incomplete report in preceding semester. registrationOffCampusComplete(X): Registration has been completed Off campus. registrationOnCampusComplete(X): Registration has been completed Off campus. registrationPhdGuided(X): Registration has been completed by PHD. -- debarredSemester(X): Student X is debarred from registering in the semester. gradeAwaitedReportPrecedingSemester(X): X has grade report awaited in preceding semester. hasARCDeanApproval(X): Student X has ARC dean approval. hasWILPDeanApproval(X): Student X has WILP Dean approval. hasPSDeanApproval(X): Student X has PS Dean approval. hasPHDdeanApproval(X): Student X has PHD Dean approval. hasARdeanApproval(X): Student X has AR Dean approval. hasIDdeanApproval(X): Student X has ID Dean approval. -- issuesPS(X): Late registration in PS for X issuesOFFCampus(X): Late registration in OFFCampus for X issuesThesis(X): Late registration in Thesis for X issuesDissertation(X): Late registration in Dissertation for X faceDifficultyDEANPS(X): PS Dean faces difficulty. faceDifficultyDEANAR(X): AR Dean faces difficulty. lateRegistration(X): Late registration for X. -- deanARCDecidesFine(X): Dean ARCD decides a fine for X. registrationAlteredByStudent(X): Registration altered by student X. registrationAlteredByOtherEvents(X): Registration altered by other events for student X. isAmendedRegistration(X): X has an amended registration. isRevisedRegistration(X): X has an revised registration. isOrignalRegistration(X): Checks whether X has an orignal registration. registeredEarly(X): X has an early registration. departedNormalSemesterPattern(X,Y): Student X has departed from normal semester pattern for course Y. satisfyPrereq(X,Y): Student X satisfies prerequisites for courses Y. clearedAllCsInSem(X,N): Student X has cleared all courses in sem N. clearedAllCsTillSem(X,N): Student X has cleared all courses till sem N. eligiblePs1(X): Student X is eligible for PS1. eligiblePs2(X,N): Student X is eligible for PS2 in sem N( different for single and dual degree as they have PS2’s in different years). eligibleTs(X,N): Student X is eligible for TS in sem N( different for single and dual degree as they have TS in different years ). eligiblePrescribedSem(X,N): Student X is eligible for prescribed sem no N. cDiscipline(X,Y): Returns branch of Student X. cDegree(X,Y): Returns degree of Student X. hasSameDiscipline(X,Y): Student X belongs to same discipline as course Y. hasSameDegree(X,Y): Student X belongs to same degree as course Y. allowedToRegister(X,Y): Student X is allowed to register for course Y. shouldBeExaminedC(X,Y,N) : Student X should be examined for course Y in sem N. timetableClash(X): Student X has a timetabe clash. replaceableBy(X,Y): Course X can be replaced by course Y. hasCeased(X): X course has been ceased to be offered.
About
Final project (written in prolog) for the course CS F214 Logic in Computer Science
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
You can’t perform that action at this time.