SWI-Prolog / swipl-devel

SWI-Prolog Main development repository
http://www.swi-prolog.org
Other
954 stars 172 forks source link

Incomplete handling of term-position rewriting #223

Open wouterbeek opened 7 years ago

wouterbeek commented 7 years ago

The following program emits undefined warnings when loading:

:- meta_predicate test(1).

test :- test([a(_)]).

test(Goal_1) :- call(Goal_1, b).

These are the warnings:

$ swipl test.pl
Warning: /home/wbeek/test.pl:4:
    Unknown message: extended_pos(list_position(47,53,[term_position(48,52,48,49,[50-51])],none),1)
Warning: /home/wbeek/test.pl:4:
    Unknown message: extended_pos(list_position(47,53,[term_position(48,52,48,49,[50-51])],none),1)

While the program is obviously erroneous, the warnings point to an issue with term-rewriting.

JanWielemaker commented 7 years ago

This message indicates incomplete handling of term-position rewriting due to term-rewriting on specific terms. Well, the program is close to errornous anyway, so I don't think this is high priority.

koo5 commented 3 years ago
    flatten(
        [
            $>!cf(handle_additional_files),
            $>!cf('extract bank statement transactions'),
            $>!cf(extract_action_inputs(_))
        ],
        Sts0
    ),

where '$>' comes from :- fnotation_ops($>,<$). and '!' comes from

:- module(_, [
    op(812,fx,!),
    '!'/1,
...

but whatever...

wouterbeek commented 3 years ago

@koo5 Your message looks a bit cryptic to me. What are you saying?

koo5 commented 3 years ago

Hi. i'm saying that the first snippet causes "extended_pos(list_position..." warnings, in a codebase where "$>" is an operator declared through fnotation, and '!' operator is declared as seen in the second snippet. Given that Jan thinks the whole logic needs a rewrite, i didn't bother with making a minimal testcase.