Skip to end of metadata
Go to start of metadata

attach/3 (i,i,io)

This predicate appends the Prova list in the second argument to the Prova list in the first argument, returning the result in the third. Since Prova lists are held in arrays, the code can concatenate very large lists.

In the first argument,

  • the list can only have a tail that is a list--not a free Prova variable,
  • the tail list is allowed to have a tail but this tail is ignored and not copied to the result List.

In the second argument,

  • the list can only have a tail and the tail is attached to the end of the result list.

Here are some examples.

This prints:

Here is a classic example of tower of Hanoi puzzle in Prova, also making use of Prova tabling using the cache built-in predicate.

Labels: