Write a tail-recursive Prolog procedure count_vars(L,N) that counts the number of instantiated variables in the list Land returns the result in N
brebs
2
Sounds like your homework.
For instantiated check, use ground/1
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Count how many atoms, numbers, constant, variable, simple term, and complex term in the list | 0 | 611 | October 29, 2021 | |
| Why does this predicate change a list with a tail, to a list with two elements, one ground, one var? | 15 | 1999 | July 17, 2019 | |
| Problem with instanciation of list :) | 11 | 1085 | May 14, 2020 | |
| Why does my predicate always return true instead of binding the variables? | 15 | 1229 | September 3, 2023 | |
| Zzzcode.ai works as a teacher for PROLOG | 3 | 150 | September 19, 2025 |