For Programmers: Free Programming Magazines  


Home > Archive > Prolog > December 2004 > Exceptions in SICStus using clpfd









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Exceptions in SICStus using clpfd
Robert Craven

2004-12-02, 4:05 pm

Dear All,

Currently under SICStus with clpfd, the following throws an exception:

?- assert(p(a)), X in 0..1, p(X).

I understand why the exception is thrown, but is there any way of making
the system merely fail, by changing an option globally?

The general problem I face is that I have a bunch of variables, some of
which may by unified using constraints such as 'X' in the above, and I
need to test equality of terms, try and unify against assertions (as
above), etc. I'd like to make any attempt to perform a unification which
ordinarily would contravene the typechecking of clpfd merely to fail.

I realise that the short line of code above can be supplemented so as to
get round this problem, but the program I have is large and such local
solutions would be a tremendous pain to implement comprehensively.

Maybe there is a simple solution, but I haven't found it.

Yours,

Robert Craven
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com