Kamis, 24 Desember 2009

Development of Simple Expert System for Market Lodging in The City of Surabaya

INTRODUCTION
As hard to find lodging in the city that we do not know, for example Budi from Mataram to be in college in the city of Surabaya, but he was puzzled to find lodging. From the example of this event we have an idea to create a market for the city of Surabaya lodging very useful for people new or old are hard to find lodging in Surabaya. So people like that make it easier to find lodging in the city of Surabaya because here we provide complete address information, contact person, price, and the status of lodging room.

WHAT IS EXPERT SYSTEM
An expert system is software that attempts to provide an answer to a problem, or clarify uncertainties where normally one or more human experts would need to be consulted. Expert systems are most common in a specific problem domain, and is a traditional application or subfield of artificial intelligence. A wide variety of methods can be used to simulate the performance of the expert however common to most or all are 1) the creation of a so-called "knowledgebase" which uses some knowledge representation formalism to capture the Subject Matter Expert's (SME) knowledge and 2) a process of gathering that knowledge from the SME and codifying it according to the formalism, which is called knowledge engineering. Expert systems may or may not have learning components but a third common element is that once the system is developed it is proven by being placed in the same real world problem solving situation as the human SME, typically as an aid to human workers or a supplement to some information system.

There are various expert systems in which a rulebase and an inference engine cooperate to simulate the reasoning process that a human expert pursues in analyzing a problem and arriving at a conclusion. In these systems, in order to simulate the human reasoning process, a vast amount of knowledge needed to be stored in the knowledge base. Generally, the knowledge base of such an expert system consisted of a relatively large number of "if then" type of statements that were interrelated in a manner that, in theory at least, resembled the sequence of mental steps that were involved in the human reasoning process.

EXPERT SYSTEM DESIGN
This expert system uses the search system lodging in the city of Surabaya is done by entering the desired name of village and will produce a complete address information, contact person, price, and the status of lodging rooms.

EXPERT SYSTEM DEVELOPMENT
Prolog is a general purpose logic programming language associated with artificial intelligence and computational linguistics. Prolog has its roots in formal logic, and unlike many other programming languages, Prolog is declarative : The program logic is expressed in terms of relations, represented as facts and rules. Execution is triggered by running queries over these relations.

While initially aimed at natural language processing, the language has since then stretched far into other areas like theorem proving, expert systems, games, automated answering systems, ontologies and sophisticated control systems. Modern Prolog environments support the creation of graphical user interfaces, as well as administrative and networked applications.

FACT and RULES





EXPERT SYSTEM TEST CASE AND RESULT
Bellows are the example of test case result, it can determine the desease:





CONCLUSION
The Expert system can effectively help people in distress looking for lodging surabaya city.

Selasa, 22 Desember 2009

INPUT AND OUTPUT in PROLOG part.2

1. menampilkan kuadrat dari integers N1 sampai N2. Misalnya N1=6 dan N2=12, maka hasilnya :
36
49
64
81
100
121
144
end.
base – case nya adalah jika first = last , output_values (12,12) jika sudah tercapai kondisi ini, looping berhenti dan tampilkan last*last. Kalau kondisi masih First < last, maka first ditambah 1 terus. lalu tampilkan fisrt*first.
definisi predikat dengan notepad, lalu save dengan *pl.



Setelah itu consult di prolog, maka ouputputnya :



2. program berikut ini untuk membaca characters yang dimasukkan oleh user satu persatu dan menampilkannya kembali. Looping pembacaan karakter berhenti jika sampai pada new line atau pada “?”
contoh:



test dengan mengetikkan go, lalu ketikkan sembarang kata. Bisa dilihat bahwa jika yang dimasukkan yaya? karakter “?” tidak dibaca.



3. Untuk menyelesaikan masalah ini kita harus membuat klausa. Karena yang akan dimunculkan itu adalah profesi dan ada ketentuan umur, maka minimal kita membuat 2 klausa. Nama klausanya bebas maka contoh yang kami berikan adalah :
nama(reza,ibab,18,mataram,mahasiswa).
nama(deno,ucup,42,bali,polisi).
nama(tery,teko,55,maluku,pedagang).
nama(alshaf,pepenk,27,sidoarjo,satpam).
nama(rizky,tono,60,makassar,dokter).
Penulisan argument dalam klausa harus huruf kecil.
Agar klausa tadi dapat digunakan maka harus dibuat predikat formatnya seperti dibawah ini. Kata-kata yang ada boleh diganti.
cariProfesi:- orang(_,_,umur,_,Prof),umur>40,write(‘Profession adalah ‘),write(Prof),nl,fail.
cariProfesi:
Agar bisa digunakan maka harus ditulis dalam notepad dengan cara seperti dibawah ini :



Kemudian setelah di consult hasilnya :




Setelah di consult hasilnya yang keluar hanya dokter, polisi, pedagang, hal ini karena yang memiliki profesi ini umurnya lebih dari 40 ,sesuai yang diinginkan soal no 3.

INPUT AND OUTPUT in Prolog

1. Mengubah dari Upper ke Lower
- pertama buat predikat make lower dengan notedpad dan rumus agar tulisan huruf bessar bisa menjadi huruf kecil. Contoh :



Angka 65>=X<=90, dimana huruf besar itu berada dalam ambang 65-90(menurut ASCII). Angka 32 itu untuk mencetak spasi.
- simpan dalam .pl
- buka prolog dan consult
- ketik makelower, diakhiri titik(.)
- Tulis kata-kata yang diinginkan dengan huruf besar,contoh :

SISTEM INFORMASI dan Institut Teknologi Sepuluh Nopember.
- Maka hasilnya :

2. Sama seprti no. 1 membuat predikat dan rumusnya di dalam notepad, contoh :

- simpan dalam .pl
- buka prolog dan consult
- ketik copyterms yang diakhiri titik(.)
- Maka hasilnya :


3. Membuat predikat readfile di dalam notepad

- simpan dalam .pl
- buka prolog dan consult
- ketik readfile yang diakhiri titik(.)
- Tulis abcde fghij
- Maka hasilnya :

4. buat dua file text seperti berikut :

lalu buat file .pl seperti di bawah ini :

maka, hasil outputnya seperti ini :