i need to write a rule which consists of sub rule.
Any idea how to achieve this ?
isloanaccept(Name, LoanAmount, LoanTenure)
:- customer(Name, bank(_),customertype(_),
citizen(malaysian),age(Age),credit(C),
income(I),property(car|house)),
Age >= 18,
C > 500,
I > (LoanAmount / LoanTenure) / 12.
lowerinterest(Senior) :- isseniorcitizen(Senior).
For instance, i need to check the customer type .
If customer type is VIP, interest lower.
If age is above 60, interest lower.
Please help.
Thanks.
Adding an extra argument to
isloanacceptis probably the easiest way.PS.: Please try to format Prolog code this way, that makes it a lot easier to read.