Operators and Arithmatic part1

hahai friends

why I always meet you???

ok2 no wories..

Now we will learn about Operator and Arithmetic in Prolog.

For example:

It is file convert.pl

and then the result is.............

Many kinds of operator that used in Prolog, now we will explain about another steps.

e.g .

likes(john,X).

Using infix operator, become : john likes X

dog(fred).

Using prefix operator, become : isa_dog(fred).

Using postfix operator, become : fred is_a_dog

So, if you find rules like :

likes(john,X):-is_female(X),owns(X,Y),isa_cat(Y).

It will be easier to understand if written as below :

john likes X:- X is_female, X owns Y, Y isa_cat.

NO WORRIES, the result will be the same as.

Still not sure????

Proof it together with us!!!

1. Open your prolog and create new file namely convert.pl agian

2. Write rules and fact like :

and then the result is......
no wories to leran it...
just try and study hard...
bye.....
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

0 Response to "Operators and Arithmatic part1"

Posting Komentar