Multifile directive without dynamic/1 or without clauses

I wonder whether this should give a warning or something.
The ISO core standard might not have specified that.
But wouldn’t a check at the end when the file is consulted

make some sense. The example is the file

:- multifile my_pred/2.
:- dynamic my_pred/3.

Somehow there was a typo, the arity do not match. So
the result was a multifle directive for the predicate indicator
my_pred/2 without a dynamic directive for my_pred/2 and

also without some clauses for my_pred/2. The predicate is
practically empty. SWI-Prolog accepts this case, and has
the predicate behave as if it is a complete failure.

?- ['<path>/'].

?- my_pred(a,b).

Side question: How would I define a predicate that is empty,
i.e. shows complete failure, but that is not multifile and
nevertheless static? Now it seems multifile does the same,

except that it also becomes multifile. Lets see what the predicate
properties say, whether its static. Yes its static:

?- predicate_property(my_pred(_,_), X).
X = static ;
X = (multifile) ;

XSB Prolog has a different behaviour. It doesn’t bark as well, i.e.
it has no multifile orphan warning or error. But it makes the predicate
dynamic. Tested on windows with XSB Version 5.0-beta:

?- ['<path>/'].
[bar loaded]

?- my_pred(a,b).

?- predicate_property(my_pred(_,_), X).
X = dynamic;
X = multifile;

Now I am trying to find a Prolog system that has a multfile orphan check.
Difficulty is, for example GNU Prolog, the multfile directive is a no-op.
What Prolog system should I check? Testing shows that for

example SICStus Prolog release 4.8 behaves rather like SWI-Prolog
and not like XSB Prolog, since it gives “compiled” as the predicate
property. SICStus Prolog doesn’t have a “static” predicate property.

Normally SWI-Prolog complains about declarations if there are no clauses, but for these two directives it is normal for there to be no clauses. I suspect that the cross-referencer (gxref/0) will find these predicates as unreferenced, but the normal compiler does not complain about dead code. Possibly it should. The drawback is that you need modules and fairly “tracktable” coding style to avoid a lot of false warnings.

Closest you get is by using discontiguous/1 AFAIK. ISO defines such a predicate to be defined and it cannot get clauses from other files. If may only get clauses in the same file.

In the unlikely case you want this I use

p(_) :- fail.

Apart from a temporary during development I have a hard time imagining a sensible use case.

I think that is a bug. Predicates with the same name and different arities are unrelated and multifile does not imply dynamic AFAIK.