database - Prolog Doing a Query -


this directly tutorial online, , top down level design error, help?

employee(193,'jones','john','173 elm st.','hoboken','nj',                                           12345,1,'25 jun 93',25500). employee(181,'doe','betty','11 spring st.','paterson','nj',                                           12354,3,'12 may 91',28500). employee(198,'smith','al','2 ace ave.','paterson','nj',                                           12354,3,'12 sep 93',27000). 

given these basic relations (also called extensional relations), can define other relations using prolog procedure definitions give answers questions might have data. example, can define new relation containing names of employees making more $28,000:

well_paid_emp(first,last) :-     employee(_num,last,first,_addr,_city,_st,_zip,_dept,_date,sal),     sal > 28000. 

it using prolog system shows singleton warning well_paid_emp/2.

not prolog systems allow _<capital><rest> singletons, i.e. variables occur once in rule.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -