# Different usage contexts of mode indicators, and the '-' mode

**URL:** <https://discourse.prolog-lang.org/t/different-usage-contexts-of-mode-indicators-and-the-mode/138>\
**Category:** PIP-0103\
**Created:** [January 22, 2025, 12:44am UTC](https://discourse.prolog-lang.org/t/different-usage-contexts-of-mode-indicators-and-the-mode/138 "2025-01-22T00:44:49Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![jschimpf](https://discourse.prolog-lang.org/user_avatar/discourse.prolog-lang.org/jschimpf/32/41_2.png) [@jschimpf](https://discourse.prolog-lang.org/u/jschimpf)\
**Post date:** [January 22, 2025, 12:43pm UTC](https://discourse.prolog-lang.org/t/different-usage-contexts-of-mode-indicators-and-the-mode/138/7 "2025-01-22T12:43:18Z")

</div>

> [@herme](#):
>
> I think it would be much clearer to have different symbols when their meanings are different.

OK, then to stimulate discussion:

**`-`**  
indicates a _steadfast output_ argument. It may or may not be bound at call-time. If the argument is bound at call time, the goal behaves as if the argument were unbound, and then unified with that term after the goal succeeds. No errors are raised.  
Precedents: current use in SWI, SICStus, ECLiPSe, Logtalk, …

**`--`**  
indicates that the argument should be unbound at call time. If not, then additional documentation may specify that an error is raised, otherwise the behaviour is undefined. Precedents: current use in SWI, Logtalk, …

**`---`**  
indicates a free variable, not instantiated, not aliased, not constrained, i.e. it can be unified with anything without risk of failure. For mode promises and analysis results.

**`----`**  
like `---` but the argument is also the first occurrence of this variable. This can be used by a compiler to chose a unification-free value-return mechanism that does not require the creation of a result variable at all. Would probably just be used to convey analysis results.

A challenge would be to see which of these can be described using Ciao’s formalism.

Caveat: these characterisations only talk about the situation at call time. Since this is already complex enough, I’d suggest that additional semantics like “argument will be instantiated at exit time” or “argument will not be further instantiated” are better handled by an orthogonal mechanism.

---

_[View the full topic](https://discourse.prolog-lang.org/t/different-usage-contexts-of-mode-indicators-and-the-mode/138)._
