lab2-prolog - of the rule. A comma between two conditions...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecturer: MRs. Aasma Memon @yahoo.com 10 Aasma.MEMON Email: prolog-lab@yahoogroups.com
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Atoms, numbers and variables are building blocks for complex terms Complex terms are built out of a functor directly followed by a sequence of arguments Arguments are put in round brackets, separated by commas The functor must be an atom
Background image of page 2
Examples we have seen before: playsAirGuitar(jody) -listentomusic(mia) The number of arguments a complex term has is called its arity Examples: woman(mia) arity 1 parent(tom,liz) arity 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
Rules have: 1- A condition part (body) in the right-hand side of the rule. 2- A conclusion part (head) in the left-hand side
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of the rule. A comma between two conditions indicates the conjunction of the conditions, meaning that both conditions have to be true. ?-offspring(Y,X). Y= lists all offspring(child) X=lists all parent There are five clauses in this knowledge base: two facts, and three rules . The end of a clause is marked with a full stop. happy(yolanda). listens2music(mia). listens2music(yolanda):-happy(yolanda). playsAirGuitar(mia):-listens2music(mia). playsAirGuitar(yolanda):-listens2music(yolanda). There are three predicates in this knowledge base: happy, listens2music, and playsAirGuitar...
View Full Document

Page1 / 12

lab2-prolog - of the rule. A comma between two conditions...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online