# Problem with unifying values

**URL:** <https://swi-prolog.discourse.group/t/problem-with-unifying-values/1708>\
**Category:** Help!\
**Created:** [January 5, 2020, 10:18pm UTC](https://swi-prolog.discourse.group/t/problem-with-unifying-values/1708 "2020-01-05T22:18:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crafts](https://avatars.discourse-cdn.com/v4/letter/c/f17d59/32.png) [@Crafts](https://swi-prolog.discourse.group/u/Crafts)\
**Post date:** [January 5, 2020, 10:18pm UTC](https://swi-prolog.discourse.group/t/problem-with-unifying-values/1708/1 "2020-01-05T22:18:15Z")

</div>

I’m using: SWI-Prolog version 7.6.4

I have a list containing variables and atoms. The variables can also be inside a “not”. The predicate assign should bind true/false to them.

Query:  
`assign([true,false,X,not(Y)]).`

One Solution I get:

```
X = not(true),
Y = true 

```

I don’t want to get not(true) or not(false) as possible solutions. Instead I want to have only true/false as possible assignments.

My code looks like this:

```prolog
assign([]).
assign([not(H)|T]) :-
    var(H),
    bind(H),
    assign(T).
assign([H|T]) :-
    var(H),
    bind(H),
    assign(T).
assign([H|T]) :-
    ground(H),
    assign(T).

bind(true).
bind(false).

```
