Created
February 13, 2023 07:48
-
-
Save veer66/562380a7ad28167ebece953e7514c435 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year(math, 60). | |
year(ai, 62). | |
year(english, 65). | |
str_rev(S, T) :- string_codes(S, SCODES), reverse(SCODES, TCODES), string_codes(T, TCODES). | |
can_register(STUDENT_ID, SUBJECT) :- str_rev(STUDENT_ID, REV_STUDENT_ID), | |
sub_string(REV_STUDENT_ID, 0, 2, _, REV_YEAR_STR), | |
str_rev(REV_YEAR_STR, YEAR_STR), | |
number_string(YEAR, YEAR_STR), | |
year(SUBJECT, REQ_YEAR), | |
YEAR =< REQ_YEAR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment