Senin, 23 November 2009

Expert systems for mortgages


An expert system for mortgages is a computer program that contains the knowledge and analytical skills of human experts, related to mortgage banking. Loan departments are interested in expert systems for mortgages because of the growing cost of labor which makes the handling and acceptance of relatively small loans less profitable. They also see in the application of expert systems a possibility for standardized, efficient handling of mortgage loans, and appreciate that for the acceptance of mortgages there are hard and fast rules which do not always exist with other types of loans.
Since most interest rates for mortgages are controlled by the goverment, intense competition sees to it that a great deal in terms of business depends on the quality of service offered to clients - who shop around for the loan best suiting their needs. Expert systems for mortgages considers the key factors which enter the profitability equation. For instance, “part and parcel of the quality of a mortgage loans portfolio to the bank is the time which elapses between the first contact with the customer and the bank's offering of a loan. Another key ingredient is the fact that home loans have significant features which are not always exploited through classical DP approaches. The expert system corrects this failure” [1].
The expert system also capitalizes on regulatory possibilities. In France, the government subsidizes one type of loan which is available only on low-cost properties (the HLM) and to lower income families. Known as "frets Conventionnes", these carry a rate of interest lower than the rate on the ordinary property loan from a bank. The difficulty is that granting them is subject to numerous regulations, concerning both:
the home which is to be purchased, and
the financial circumstances of the borrower.
To assure that all conditions have been met, every application has to be first processed at branch level and then sent to a central office for checking, before going back to the branch, often with requests for more information from the applicant. This leads to frustrating delays. Expert system for mortgages takes care of these by providing branch employees with tools permitting them to process an application correctly, even if a bank employee does not have an exact knowledge of the screening procedure.

Jumat, 13 November 2009

OPERATOR AND ARITHMETIC

Practical Exercise 4
(1) This program is based on Animals Program 3, given in Chapter 2.
dog(fido). large(fido).
cat(mary). large(mary).
dog(rover). small(rover).
cat(jane). small(jane).
dog(tom). small(tom).
cat(harry).
dog(fred). large(fred).
cat(henry). large(henry).
cat(bill).
cat(steve). large(steve).
large(jim).
large(mike).
large_dog(X):- dog(X),large(X).
small_animal(A):- dog(A),small(A).
small_animal(B):- cat(B),small(B).
chases(X,Y):-
large_dog(X),small_animal(Y),
write(X),write(' chases '),write(Y),nl.

Convert the seven predicates used to operator form and test your revised program.
The output should be the same as the output from the program above. Include
directives to define the operators in your program.


(2) Define and test a predicate which takes two arguments, both numbers, and
calculates and outputs the following values: (a) their average, (b) the square root of
their product and (c) the larger of (a) and (b).

OPERATORS AND ARITHMATICS IN PROLOG

Operators and Arithmetics
Operators
Up to now, Prolog user usually use the notation for predicates by a number of arguments in parentheses.
Ex : likes(john,mary)
There is another alternative :
- Two arguments (a binary predicates) be converted to an infix operator
the functor be written between two arguments with no parentheses
Ex : john likes mary
- One argument (a unary predicate) be converted to :
1. Prefix operator  the functor be written before the argument with no parentheses
Ex : isa_dog fred
2. Postfix operator  the functor be written after the argument
Ex : fred isa_dog
Both of predicate (one or two arguments) can be converted to an operator by entering a goal using the op predicate at the system prompt. Ex :
?-op(150,xfy,likes).
This predicate takes three arguments :
1. 150 (operator precedence) : an integer from 0 upwards
So we can change it with another integer.
2. Xfy : the predicate is binary and is to be converted to an infix operator.
This argument should normally be one of the following three atoms:
1. Xfy
2. Fy : the predicate is unary and is to be converted to an prefix operator
3. Xf : the predicate is unary and is to be converted to a postfix operator
3. Likes : the name of the predicate that is to be converted to an operator.
Arithmetics
Prolog user can doing arithmetic calculate with prolog, such as :
1. Arithmetic operator
X+Y : sum of X and Y
X-Y : dfference of X and Y
X*Y : product of X and Y
X/Y : quotient of X and Y
X//Y : the ‘integer quotient’ of X and Y (the result is truncated to the nearest integerbetween it and zero)
X^Y : X to the power of Y
-X : negative of X
abs(X) : absolute value of X
sin(X) : sine of X
cos(X) : cosine of X
max(X,Y) : yhe larger of X and Y
sqrt(X) : square root of X
2. Operator presedence in arithmetic expression
Prolog use ordinary algebra algorithm in arithmetic operation.
Ex : A+B*C-D
In the algebra, C*B are calculate first, then the result+A, then the result of sum-D. it is same with those in prolog. But, if we want to calculate A+B, C-D, then multiply both of the result, we must add the parentheses.
Ex : (A+B)*(C-D)
3. Relasion operator
The operator like =,!=, >, >=, <, <= can be used in prolog

Degree operator
Under is the rist of equality operators that used in prolog with the function of each operator:
• Arithmetic Expression Equality ( =:= )
• Arithmetic Expression Inequality ( =\= )
• Terms Identical ( == )
• Terms Not Identical ( \== )
• Terms Identical With Unification ( = )
• Non-Unification Between Two Terms( \= )

Logic operator
a. Operator NOT
Operator not can be placed before predicate to give the negation. Predicate that be negation has the truth value if the origin predicate is false and has the false value if the origin predicate is truth.
The example of using operator not :
dog(fido).
?- not dog(fido).
no
?- dog(fred).
no
?- not dog(fred).
Yes
b. Disjunction operator
Disjunction operator is used as operator ‘atau’.
Ex :
?- 6<3;7 is 5+2.
yes
?- 6*6=:=36;10=8+3.
yes