×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# instantiated error

## instantiated error

(OP)
Hi,
Why
X < 10 , X > 0 , integer(X), integer(Y),Y  < 10 , Y > 0 , X mod Y = 0 , X / Y = 2 .

does give
ERROR: </2: Arguments are not sufficiently instantiated  ?

### RE: instantiated error

because you don't give any value to X for integer(X).

### RE: instantiated error

(OP)
OK, but
1) if I want it to solve X as an integer unknown to solve, how can I give value to X ?!
2) imagine I want to initiate X with 3, so :
X < 10 , X > 0 , integer(X), X = 3,Y  < 10 , Y > 0 , X mod Y = 0 , X / Y = 2 .

but :
ERROR: </2: Arguments are not sufficiently instantiated ?

So where is the problem?

### RE: instantiated error

You can't do that in classical Prolog, use library(clpfd).

### RE: instantiated error

(OP)
thanks.
?- use_module(library(clpfd)). X < 10 , X > 0 , integer(X), X = 3,Y  < 10 , Y > 0 , X mod Y = 0 , X / Y = 2 .
ERROR: </2: Arguments are not sufficiently instantiated

### RE: instantiated error

you don't use clpfd when you write X < 0 .
You must write
X #< 10 , X #> 0 , Y  #< 10 , Y #> 0 , X mod Y #= 0 , X / Y #= 2, label([X, Y]).

### RE: instantiated error

(OP)
ok, thanks a lot!

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!