(load "E:/Documents/AI/FuzzyCLIPS/bankfuzzy.clp") FuzzyCLIPS> Defining deftemplate: pay Defining deftemplate: savings Defining deftemplate: age Defining deftemplate: monthsloan Defining deftemplate: monthsemployer Defining deftemplate: approvedamount Defining defrule: highpaylongemployrule1 +j+j Defining defrule: longloanshortemployrule2 +j+j Defining defrule: shortloanmedemploypayhighrule3 +j+j+j Defining defrule: lowpayrule4 +j Defining defrule: get-crisp-value-and-print-rslt +j TRUE FuzzyCLIPS> (load "E:/Documents/AI/FuzzyCLIPS/bankfuzzystart1.clp") FuzzyCLIPS> Defining defrule: startup +j TRUE FuzzyCLIPS> (reset) ==> f-0 (initial-fact) CF 1.00 FuzzyCLIPS> (run 1) FIRE 1 startup: f-0 we are approving loans Fuzzy Value: pay Linguistic Value: low (+), medium (.), high (*), rich (-) 1.00+++++++ . * ----------- 0.95 0.90 .. * * 0.85 - 0.80 0.75 . . * * - 0.70 0.65 * * 0.60 - 0.55 . . 0.50 + * * 0.45 - 0.40 * * 0.35 . . - 0.30 0.25 * * 0.20 . . - 0.15 * * 0.10 0.05 - 0.00---------------------------------****************** |----|----|----|----|----|----|----|----|----|----| 0.00 2000.00 4000.00 6000.00 8000.00 10000.00 Universe of Discourse: From 0.00 to 10000.00 Fuzzy Value: savings Linguistic Value: low (+), medium (.), high (*), rich (-) 1.00+ . * ----------- 0.95 -- 0.90 ** - 0.85 -- 0.80 - 0.75 -- 0.70 * * - 0.65 -- 0.60 - 0.55 .. -- 0.50 * * - 0.45 -- 0.40 - 0.35 * -- 0.30 * - 0.25 -- 0.20 - 0.15 * -- 0.10 *- 0.05 -- 0.00-----------..************************************** |----|----|----|----|----|----|----|----|----|----| 0.00 200000.00 400000.00 600000.00 800000.00 1000000.00 Universe of Discourse: From 0.00 to 1000000.00 Fuzzy Value: age Linguistic Value: young (+), middle (.), old (*), elderly (-) 1.00++++++++++ . * -------- 0.95 .. ** - 0.90 0.85 + 0.80 . . * * - 0.75 0.70 + 0.65 . . * * - 0.60 0.55 + . . * * - 0.50 0.45 + 0.40 . .* *- 0.35 0.30 + 0.25 . *. -* 0.20 0.15 +. * . - * 0.10 0.05 0.00------------------------------------....*********** |----|----|----|----|----|----|----|----|----|----| 0.00 20.00 40.00 60.00 80.00 100.00 Universe of Discourse: From 0.00 to 100.00 Fuzzy Value: monthsloan Linguistic Value: short (+), medium (.), long (*), verylong (-) 1.00+ . * ------------- 0.95 * - 0.90 . * 0.85 * 0.80 * * - 0.75 * 0.70 . * 0.65 * * - 0.60 * 0.55 * - 0.50 . * 0.45 + * 0.40 * * - 0.35 * 0.30 . * 0.25 * * - 0.20 * 0.15 * - 0.10 .* * 0.05 0.00-------------------------------******************** |----|----|----|----|----|----|----|----|----|----| 0.00 80.00 160.00 240.00 320.00 400.00 Universe of Discourse: From 0.00 to 400.00 Fuzzy Value: monthsemployer Linguistic Value: short (+), medium (.), long (*), verylong (-) 1.00+ . * --------- 0.95 * * 0.90 - 0.85 * 0.80 + * * - 0.75 * 0.70 . . * * - 0.65 * 0.60 * * 0.55 * - 0.50 * * 0.45 . * - 0.40 . 0.35 * * 0.30 * - 0.25 * * 0.20 * - 0.15 . * * 0.10 . *- 0.05 * * 0.00----------------------------------.**************** |----|----|----|----|----|----|----|----|----|----| 0.00 72.00 144.00 216.00 288.00 360.00 Universe of Discourse: From 0.00 to 360.00 Fuzzy Value: approvedamount Linguistic Value: none (+), small (.), medium (*), large (-), verylarge (@) 1.00* - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 0.95 @ 0.90 - 0.85 0.80 - @ 0.75 0.70 0.65 @ 0.60 0.55 @ 0.50 - - 0.45 0.40 @ 0.35 0.30 0.25 @ 0.20 - 0.15 @ 0.10 - 0.05 0.00@@@@@@*-------------------------------------------- |----|----|----|----|----|----|----|----|----|----| 0.00 80000.00 160000.00 240000.00 320000.00 400000.00 Universe of Discourse: From 0.00 to 400000.00 ==> f-1 (pay ???) CF 1.00 ( (3499.0 0.0) (3500.0 1.0) (3501.0 0.0) ) ==> f-2 (savings ???) CF 1.00 ( (4.9e+004 0.0) (5e+004 1.0) (5.1e+004 0.0) ) ==> f-3 (age ???) CF 1.00 ( (30.9 0.0) (31.0 1.0) (31.1 0.0) ) ==> f-4 (monthsloan ???) CF 1.00 ( (8.9 0.0) (9.0 1.0) (9.1 0.0) ) ==> f-5 (monthsemployer ???) CF 1.00 ( (57.9 0.0) (58.0 1.0) (58.1 0.0) ) FuzzyCLIPS> (run 1) FIRE 1 highpaylongemployrule1: f-1,f-5 > debug in highpaylongemployrule1 how much pay? 3500.0 membership in high : 0.0625 how long with employer? 58.0 membership in long: 0.04615384615384616 ==> f-6 (approvedamount ???) CF 1.00 ( (3000.0 0.0) (4286.0 0.04762) (4.905e+004 0.04762) (5e+004 0.0) ) FuzzyCLIPS> (run 1) FIRE 1 get-crisp-value-and-print-rslt: f-6 Fuzzy Value: approvedamount Linguistic Value: ??? (+) 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.65 0.60 0.55 0.50 0.45 0.40 0.35 0.30 0.25 0.20 0.15 0.10 0.05 ++++++ 0.00+ ++++++++++++++++++++++++++++++++++++++++++++ |----|----|----|----|----|----|----|----|----|----| 0.00 80000.00 160000.00 240000.00 320000.00 400000.00 Universe of Discourse: From 0.00 to 400000.00 So far, would approve loan of: 26582.65582655827 dollars (wait until no more results and use LAST decision) FuzzyCLIPS> (run 1) FIRE 1 shortloanmedemploypayhighrule3: f-4,f-5,f-1 > debug in shortloanmedemploypayhighrule3 how long loan? 9.0 membership in short : 0.3333333333333334 how long with employer? 58.0 membership in medium: 0.08333333333333337 how much pay? 3500.0 membership in high: 0.0625 <== f-6 (approvedamount ???) CF 1.00 ( (3000.0 0.0) (4286.0 0.04762) (4.905e+004 0.04762) (5e+004 0.0) ) ==> f-7 (approvedamount ???) CF 1.00 ( (400.0 0.0) (500.9 0.06309) (3405.0 0.06309) (3474.0 0.01754) (4286.0 0.04762) (4.905e+004 0.04762) (5e+004 0.0) ) FuzzyCLIPS> (run 1) FIRE 1 get-crisp-value-and-print-rslt: f-7 Fuzzy Value: approvedamount Linguistic Value: ??? (+) 1.00 0.95 0.90 0.85 0.80 0.75 0.70 0.65 0.60 0.55 0.50 0.45 0.40 0.35 0.30 0.25 0.20 0.15 0.10 0.05+++++++ 0.00+ ++++++++++++++++++++++++++++++++++++++++++++ |----|----|----|----|----|----|----|----|----|----| 0.00 80000.00 160000.00 240000.00 320000.00 400000.00 Universe of Discourse: From 0.00 to 400000.00 So far, would approve loan of: 24657.17598640479 dollars (wait until no more results and use LAST decision) FuzzyCLIPS> (run 1) FuzzyCLIPS> (run 1) FuzzyCLIPS>