How to use predicate transpose in SWI-Prolog? -



How to use predicate transpose in SWI-Prolog? -

hi guys want utilize predicate transpose(matrix0, matrix) in swi-prolog holds when matrix0 , matrix lists of lists, , “columns” of each “rows” of other. problem when added :- ensure_loaded(library(clpfd)). source file , tried utilize it, got

% library(occurs) compiled occurs 0.00 sec, 14 clauses % library(apply_macros) compiled apply_macros 0.00 sec, 44 clauses % library(assoc) compiled assoc 0.00 sec, 103 clauses error: /users/benjamin/documents/prologworkspace/test.pl:27: import/1: no permission import clpfd:transpose/2 user (already imported ugraphs) % library(clpfd) compiled clpfd 0.08 sec, 1,372 clauses % test compiled 0.08 sec, 1,388 clauses true.

and got false when seek this:

?- transpose([['_','_'],['_','_']], x). false.

any suggestion? give thanks you.

import/1: no permission import clpfd:transpose/2 user (already imported ugraphs)

you have name clash. that's not problem clpfd:transpose/2 itself.

to not import exported predicates of module, use

:- use_module(library(clpfd), []).

then need phone call clpfd:transpose/2 including name space.

c.f.

http://www.swi-prolog.org/pldoc/man?predicate=use_module/2 http://blog.logtalk.org/2009/03/prolog-modules-madness/

prolog swi-prolog

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -