我已经用 or 运算符定义了一个规则,但它返回多个真或假。
isloanaccept(Name,Guarantor,LoanType,LoanAmount,LoanTenure)
:- customer(Name,bank(_),customertype(_),
citizen(Ci),age(Age),credit(C),
income(I),property(_),bankemployee(_)),
Ci == 'malaysian',
Age >= 18,
C > 500,
I > (LoanAmount / LoanTenure) / 12,
isguarantor(Guarantor,Name),
ispersonalloan(LoanType,LoanAmount,LoanTenure);
ishouseloan(LoanType,LoanAmount,LoanTenure);
isbusinessloan(LoanType,LoanAmount,LoanTenure);
iscarloan(LoanType,LoanAmount,LoanTenure).
实际上,我需要检查贷款类型是否满足特定的贷款要求并结合一般规则。
换句话说,我需要像这样定义上面的规则。
Ci == 'malaysian', Age >= 18,C > 500,
I > (LoanAmount / LoanTenure) / 12,
isguarantor(Guarantor,Name)
Or with (ispersonalloan(LoanType,LoanAmount,LoanTenure);
ishouseloan(LoanType,LoanAmount,LoanTenure);
isbusinessloan(LoanType,LoanAmount,LoanTenure);
iscarloan(LoanType,LoanAmount,LoanTenur)
它应该在命令行中返回 1 个真/假而不是多个语句。
在命令行中检查了规则后,每个 or 规则都返回 1 个我不想要的布尔值。我需要这样(一般规则和(多或规则))。
如何组合返回 1 个布尔值的几个或规则?
请帮忙。
谢谢。