to output squares of two integers, we can use the goal 'outsquare'. Just enter the inputs you want, and it will be the range.
The example of the form :


2. Define and testing predicate
this program using the repeat predicate. in this part, we use goal 'go'. This is the form :


3. Backtracking with failure
This followed program using 'backtracking with failure'. We will appearing the person with age above 40. Similiar with the former chapter on prolog, which use the 'find' function. Enter the facts that needed here, like first name, last name, age, city, and profession. Seems like this example :


No comments:
Post a Comment