# With Prolog is there a difference between bound and instantiated?

**URL:** <https://swi-prolog.discourse.group/t/with-prolog-is-there-a-difference-between-bound-and-instantiated/2074>\
**Category:** General\
**Tags:** discussion\
**Created:** [March 28, 2020, 11:17am UTC](https://swi-prolog.discourse.group/t/with-prolog-is-there-a-difference-between-bound-and-instantiated/2074 "2020-03-28T11:17:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [March 28, 2020, 11:17am UTC](https://swi-prolog.discourse.group/t/with-prolog-is-there-a-difference-between-bound-and-instantiated/2074/1 "2020-03-28T11:17:40Z")

</div>

In reading a [paper](https://www.info.ucl.ac.be/~pvr/Thesis/ThesisMain.pdf) in this paragraph on page 22 (section 1.1.1. The logical variable) it reads

> A variable represents any data object. Initially the value of the variable is unknown, but it may become known by instantiation. A variable may be instantiated only once, i.e. it is single-assignment. Variables may be bound to other variables. When a variable is instantiated to a value, this value is seen by all the variables bound to it.

I never thought about there being a difference between the two words (bound or instantiated) but in reading the paragraph there clearly is a difference.

So when noting such in Prolog should the distinction be made?

The main reason I am asking is that in writing answers I always use the word bound for either, I am thinking I should be more accurate in my terminology.

---

<div class="post-metadata">

**Author:** ![pmoura](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/pmoura/32/11_2.png) [@pmoura](https://swi-prolog.discourse.group/u/pmoura)\
**Post date:** [March 28, 2020, 12:46pm UTC](https://swi-prolog.discourse.group/t/with-prolog-is-there-a-difference-between-bound-and-instantiated/2074/2 "2020-03-28T12:46:28Z")

</div>

> [@EricGT](#):
>
> A variable may be instantiated only once, i.e. it is single-assignment.

This sentence [from the cited paper] is not ideal phrasing. Consider as an example:

```plaintext
?- V = a(_), V = a(1).
V = a(1).

```

Prolog is not a single assignment language. Is a language where terms can only be further instantiated when unified. Of course, the implicit context in that paragraph is to distinguish from procedural languages, hence the the word “assignment”, which makes the sentence fair. We can also argue that, in the second goal above, `V` no longer references a variable but a compound term, `a(_)`. Anyway, words are fun and being trapped at home with no biking for two weeks is driving me crazy. The end.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [March 28, 2020, 12:48pm UTC](https://swi-prolog.discourse.group/t/with-prolog-is-there-a-difference-between-bound-and-instantiated/2074/3 "2020-03-28T12:48:55Z")

</div>

I’m not really aware of _binding_ and _instantiation_ being different terms. It does make some sense though. Binding to a value (i.e., not a variable) creates and _instance_ of the original term, making _instantiation_ a good term. Binding two variables may or may not create an instance in this sense. For example, if we simply to A=B with nothing else happening we do no instantiate anything. On the other hand, x(A,A) is an instance of x(A,B) and thus also binding variables can _instantiate_ terms.

I’ve always used the terms interchangeable and think I will keep doing so if there are no stronger arguments.

---

<div class="post-metadata">

**Author:** ![stassa.p](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/stassa.p/32/712_2.png) [@stassa.p](https://swi-prolog.discourse.group/u/stassa.p)\
**Post date:** [March 31, 2020, 10:36am UTC](https://swi-prolog.discourse.group/t/with-prolog-is-there-a-difference-between-bound-and-instantiated/2074/4 "2020-03-31T10:36:18Z")

</div>

Personally, if I want to be formal, I avoid the term “binding” and use “unification” instead. As far as I have seen, “binding” is Prolog-specific while “unification” is a generally accepted logic programming term that also has a very clear definition (in Robinson’s unification algorithm).

I wasn’t always like that. In the past I was a care-free child that would happily use “binding”, “unification” and “instantiation” interchangeably. But then some of my work fell to the hands of savage reviewers who brutally slaughtered my careless use of vague terminology and I have never been the same since.

---

<div class="post-metadata">

**Author:** ![pmoura](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/pmoura/32/11_2.png) [@pmoura](https://swi-prolog.discourse.group/u/pmoura)\
**Post date:** [March 31, 2020, 10:49am UTC](https://swi-prolog.discourse.group/t/with-prolog-is-there-a-difference-between-bound-and-instantiated/2074/5 "2020-03-31T10:49:50Z")

</div>

Moreover, a reminder that, in this challenging times, everything should be coded using negation in order to respect social distancing for terms and variables!
