CHR compiler error

25 views
Skip to first unread message

Julio Di Egidio

unread,
May 5, 2015, 8:54:43 AM5/5/15
to swi-p...@googlegroups.com
Hello all,

This code breaks the CHR compiler, but I am reluctant to just email Mr. Schrijvers...  The work-around is also pretty obvious.

% (SWI-Prolog 6.6.6)

:- module(_,
 
[ row/1
 
]).

:- use_module(library(chr)).

:- chr_constraint row(?row).

:- chr_type val ---> 1; 2; 3; 4; 5; 6; 7; 8; 9.
:- chr_type block ---> [val, val, val, val, val, val, val, val, val].
:- chr_type row == block.

row
([V1, V2, V3, V4, V5, V6, V7, V8, V9]) <=> true.

?- make.
Warning: ***/sudoku.pl:20:
       
Singleton variables: [V1,V2,V3,V4,V5,V6,V7,V8,V9]
================================================================================
CHR compiler ERROR
: something unexpected happened in the CHR compiler.
   
`--> Undefined type [val,val,val,val,val,val,val,val] while type checking term compound(.,2,[var(2,_G28489),compound(.,2,[var(3,_G28503),compound(.,2,[var(4,_G28517),compound(.,2,[var(5,_G28531),compound(.,2,[var(6,_G28545),compound(.,2,[var(7,_G28559),compound(.,2,[var(8,_G28573),compound(.,2,[var(9,_G28587),atomic([])],[_G28587])],[_G28573,_G28587])],[_G28559,_G28573,_G28587])],[_G28545,_G28559,_G28573,_G28587])],[_G28531,_G28545,_G28559,_G28573,_G28587])],[_G28517,_G28531,_G28545,_G28559,_G28573,_G28587])],[_G28503,_G28517,_G28531,_G28545,_G28559,_G28573,_G28587])],[_G28489,_G28503,_G28517,_G28531,_G28545,_G28559,_G28573,_G28587]) in head _G28626.
    Please contact
t***@cs.kuleuven.be.
================================================================================
ERROR: Exported procedure sudoku:row/1 is not defined
% ***/sudoku compiled into sudoku 0.02 sec, 1 clauses
true.

Julio

Alan Baljeu

unread,
May 8, 2015, 11:56:36 AM5/8/15
to Julio Di Egidio, swi-p...@googlegroups.com
I also have encountered failures in the type system, though I don't remember this message.  I haven't found them worth bothering about and just changed the type declarations to something that did work.

On Tue, May 5, 2015 at 8:54 AM, Julio Di Egidio <ju...@diegidio.name> wrote:
Hello all,

This code breaks the CHR compiler, but I am reluctant to just email Mr. Schrijvers...  The work-around is also pretty obvious.

% (SWI-Prolog 6.6.6)

:- module(_,
 
[ row/1
 
]).

:- use_module(library(chr)).

:- chr_constraint row(?row).

:- chr_type val ---> 1; 2; 3; 4; 5; 6; 7; 8; 9.
:- chr_type block ---> [val, val, val, val, val, val, val, val, val].
:- chr_type row == block.

row
([V1, V2, V3, V4, V5, V6, V7, V8, V9]) <=> true.

?- make.
Warning: d:/projects/__logic/prolog/sudokusolver/sudoku.pl:20:

       
Singleton variables: [V1,V2,V3,V4,V5,V6,V7,V8,V9]
================================================================================
CHR compiler ERROR
: something unexpected happened in the CHR compiler.
   
`--> Undefined type [val,val,val,val,val,val,val,val] while type checking term compound(.,2,[var(2,_G28489),compound(.,2,[var(3,_G28503),compound(.,2,[var(4,_G28517),compound(.,2,[var(5,_G28531),compound(.,2,[var(6,_G28545),compound(.,2,[var(7,_G28559),compound(.,2,[var(8,_G28573),compound(.,2,[var(9,_G28587),atomic([])],[_G28587])],[_G28573,_G28587])],[_G28559,_G28573,_G28587])],[_G28545,_G28559,_G28573,_G28587])],[_G28531,_G28545,_G28559,_G28573,_G28587])],[_G28517,_G28531,_G28545,_G28559,_G28573,_G28587])],[_G28503,_G28517,_G28531,_G28545,_G28559,_G28573,_G28587])],[_G28489,_G28503,_G28517,_G28531,_G28545,_G28559,_G28573,_G28587]) in head _G28626.
    Please contact
t***@cs.kuleuven.be
.

================================================================================
ERROR: Exported procedure sudoku:row/1 is not defined
% d:/projects/__logic/prolog/sudokusolver/sudoku compiled into sudoku 0.02 sec, 1 clauses
true.

Julio

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
Visit this group at http://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages