Sunday, 15 September 2013

In prolog, functors vs predicates, and goals -


I am beginning to learn prologue. I have many books and I have bought standard too. I like things like standards because they define things properly. But I do not understand some concepts. Particularly the difference between the fents and predictions, and what exactly is a goal? Usually books use a term that is different and sometimes it is not very accurate to add confusion.

A prediction is defined in the standard "a definition and a sequence of n logic with sincerity n" and as a predicate "with an identity with an identity" thus when they " Art of Prol 2 "in the father (father, child) , then he decides to do the father / 2 .

OK, but when I check the syntax, we talk about mixed words (not prediction or prediction), which creates the names and arguments of the factor. So I checked the definition in the standard and found that there is a similar definition of definition, with a fun "an identity together with an identity", and a compound word "with N, N-positive, debate"

Thus, what is the connection between heredity and predictions? Syntactically they look the same why father (father, hair) can not be termed a compound word (I think that this is actually syntax) with the brain code Instead of predicate father / 2 ? When do we use one word or another?

And to keep the cherry on top, a goal is "a prediction that has to be executed". Do we talk about the goal within the Prol program or only in question? In the art of Prol, it has been written that "Goals are atoms or mixed words", so can we talk about the goal everywhere in the Prologue program? My reading makes me feel that this is used only in the query but I am not sure.

In a question, I think that mother (x, y) is a goal and mother / 2 a orbiter but mother ( X, y), male (y) is a goal? Or is it made of two goals? It is said that the goal can be an atom or mixed word. But if we look into functional notation, then we have a mixed word and then the same goal is made of two sub-goals? I'm no understand.

To write it briefly, I do not know how to interpret things (forecasts), factor (compound word) or goal.

Edit

After reading the comments, replies and other questions (and), I came to the conclusion that we have one in Lisp-like languages The situation is as follows: The same notation is used for "executable" code and data, thus all things have been written as words and many of them are mixed words that include factories and logic. It is the syntax of the data and is used for the same syntax segment (facts and rules) that prepare a prologue program. When we focus on the data side of things and talk about the future, we talk about the fonts, when we focus on the "executable" (or interpretive) side of things, the meaning of logic program is. Focus in question usually depends on the context in which it is manufactured.

I try to explain it to my students in the following manner: In the following cases father (X, y) what is (is missing from the missing reference ...)?

 ? - Isa (Father (X, Y)).  

and

  - father (x, y)  

In the first case, this father < / Code> is the brain that creates a binary word in the second case, it is a binary determination.

Illusions (they look the same way) are also used actively when you go beyond plain prolong and like:

 ? - By using a  findall  query in X = Father, X (Tim, John)  

or father / 2


No comments:

Post a Comment