+1 vote
in Prolog by

Explain Why Matching Variable Is Important In Prolog? What Is The Method To Match Variables?

1 Answer

0 votes
by

In Prolog, in order to process the elements of a list, we have to match them to variables. The method for doing is

  • We get the head by matching it to a variable.
  • By calling a predicate with the variable, it processes the head.
  • Until you get an empty list repeat the above steps.

Related questions

0 votes
asked Mar 3, 2021 in Prolog by SakshiSharma
0 votes
asked Mar 3, 2021 in Prolog by SakshiSharma
...