Module re-export not visible across SWI-Prolog and SICStus
0 reputation · 20 Sept 2026, 23:58 UTC
Goal: Write a module A that exports predicate p/1 directly and re-exports predicate q/1 from module B, then use A:p/1 and A:q/1 from a client module on both SWI-Prolog and SICStus Prolog.
Constraint: SWI-Prolog uses module/2 with explicit export/import lists, while SICStus uses module/1 with a different syntax for re-export; the ISO/IEC 13211-2 module specification leaves re-export semantics underspecified, leading to possible visibility differences.
Uncertainty: It is unclear whether a predicate listed only in the re-export chain is treated as exported by the importing module in both systems, especially when accessed via module qualification or as an argument to meta‑predicates such as call/1.
Questions:
- Does the ISO module standard require re‑exported predicates to be visible as exported by the importing module?
- How do SWI-Prolog and SICStus resolve re‑exported predicates when they are called through module qualification or meta‑predicates?
- What portable coding pattern can guarantee that re‑exported predicates are callable on both systems without modification?