<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Samet Kilictas&#039;s Blog &#187; Sister</title>
	<atom:link href="http://samet.kilictas.com/tag/sister/feed/" rel="self" type="application/rss+xml" />
	<link>http://samet.kilictas.com</link>
	<description>J2E, PHP, Linux, PL/SQL and other random rants</description>
	<lastBuildDate>Sun, 06 Nov 2011 04:36:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Example Code #3 &#8211; Basics in Prolog</title>
		<link>http://samet.kilictas.com/example-code-3-basics-in-prolog/</link>
		<comments>http://samet.kilictas.com/example-code-3-basics-in-prolog/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 13:16:35 +0000</pubDate>
		<dc:creator>Samet Kilictas</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Prolog]]></category>
		<category><![CDATA[factorial]]></category>
		<category><![CDATA[fibonacci]]></category>
		<category><![CDATA[parent]]></category>
		<category><![CDATA[Sister]]></category>
		<category><![CDATA[swi prolog]]></category>

		<guid isPermaLink="false">http://samet.kilictas.com/?p=207</guid>
		<description><![CDATA[1- Parent relation between rex, doggie and goldie dog(rex). dog(X):-parent(X,Y). parent(goldie,rex). parent(jack,rex). Query -> ?dog(goldie) : YES Query -> ?dog(jack) : YES 2- Sister relation sister(X,Y):-girl(X),girl(Y),parent(X,Z),parent(Y,Z). parent(sara,Maria). parent(lili,Maria). girl(lili). girl(maria). Query -> ?sister(lili,maria) : NO 3- Finds factorial of numbers 1!: 1 , 2!: 2&#215;1, 3!: 3x2x1 Here you can see that we are able [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1- Parent relation between rex, doggie and goldie</strong></p>
<p><code>dog(rex).<br />
dog(X):-parent(X,Y).<br />
parent(goldie,rex).<br />
parent(jack,rex).</code></p>
<p>Query -> <code>?dog(goldie)  : YES</code><br />
Query -> <code>?dog(jack)  : YES</code></p>
<p><strong>2- Sister relation</strong></p>
<p><code>sister(X,Y):-girl(X),girl(Y),parent(X,Z),parent(Y,Z).<br />
parent(sara,Maria).<br />
parent(lili,Maria).<br />
girl(lili).<br />
girl(maria).</code></p>
<p>Query -> <code>?sister(lili,maria) : NO</code></p>
<p><strong>3- Finds factorial of numbers</strong></p>
<p>1!: 1 , 2!: 2&#215;1, 3!: 3x2x1<br />
Here you can see that we are able to say 3!: 3&#215;2!  instead of 3!:3x2x1 . Since i know what is 1! and 0! therefore i have limitation points for my program.</p>
<p><code>fact(0,1):-!.<br />
fact(1,1):-!.<br />
fact(N,F,F1) :- N1 is N-1, fact(N1,F1), F is N * F1.</code></p>
<p><span id="more-207"></span></p>
<p><strong>4- Finds Fibonacci numbers</strong></p>
<p>1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,&#8230; </p>
<p><code>fib(0,0):-!.<br />
fib(1,1):-!.<br />
fib(X,L) :- X > 1, 	Y1 is X-1, Y2 is X-2, fib(Y1,F1), fib(Y2,F2), L is F1+F2.</code></p>
<a href='http://twitter.com/share?url=http%3A%2F%2Fsamet.kilictas.com%2F%3Fp%3D207&count=vertical&related=&text=Example%20Code%20%233%20-%20Basics%20in%20Prolog' class='twitter-share-button' data-text='Example Code #3 - Basics in Prolog' data-url='http://samet.kilictas.com/?p=207' data-counturl='http://samet.kilictas.com/example-code-3-basics-in-prolog/' data-count='vertical' data-via='sametkilictas'>Tweet</a>]]></content:encoded>
			<wfw:commentRss>http://samet.kilictas.com/example-code-3-basics-in-prolog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

