paxfare.blogg.se

Visual prolog vfccbd cnhjr
Visual prolog vfccbd cnhjr













When the caret is placed at the end of the line, press the Enter key on your keyboard. Then, you re-consult the code using Engine -> Reconsult.Īs before, on a blank line in the Dialog window type a goal (without the "?" sign- in front). This time, each person is described with both the person's name and his/her gender, using the person functor, whereas in the earlier tutorial (Fundamental Prolog (Part1)) we were only using the person's name.Īfter you have written the new code, ensure that the PIE engine is reset. If you study the two facts for the father relationship, you would notice that the persons described are richer than what was done before (The earlier code is commented out in-between the tokens /* and */. we need NOT define a predicate or a fact called person for our code to work). Please note that in the PIE (Prolog Inference Engine) that we are using, we can directly use a compound domain without any prior intimation to the Prolog engine (for example. We shall now package our facts using these functors.Īs a compound domain always has a functor, we shall henceforth use the term functor in this tutorial, to represent the respective compound domain.įor now, let us modify the first example of the previous tutorial, so that we use our newly defined functor person. The word person is known as a functor, and the variables are its arguments. Logically, it states that there is some compound domain called person in the system, each of which has two characteristics, represented by the logical variables Name and Gender. Note that the above statement is neither a fact nor a predicate. Thus we had given the following facts to the system: In the first part of this tutorial, we had tried putting together several characteristics of individuals together, (like the name and the gender), by inserting facts into the PIE system that concentrated on entities instead of relationships. What if we need to represent all those characteristics together, instead of representing just their names? That means, we need some mechanism to represent compound domains a collection of simpler domains held together. However, individuals are represented by more characteristics than just their names.

visual prolog vfccbd cnhjr

Other simple domains would be numbers (e.g.: 123 or 3.14), symbols (e.g.: xyz or chil_10), and characters (e.g.: '5' or 'c'). In the case of the names of the people, the simple domain was a string.

visual prolog vfccbd cnhjr visual prolog vfccbd cnhjr

The values of the names are simple data types or simple domains. Now "Bill", "John" and "Pam" are just the names of the individuals. In Part 1 of the tutorial, all the people were represented as "Bill", "John" and "Pam" etc.















Visual prolog vfccbd cnhjr