ISO-Prolog 中的合法/正确系统错误是什么?

What are legitimate / proper System Errors in ISO-Prolog?

TL;DR:这个问题是关于 Prolog 实现细节的。继续需要您自担风险。您已收到警告:)


根据 ISO/IEC 13211-1995“7.12 错误”:

7.12.2 Error classification

[...]

j) There may be a System Error at any stage of execution. The conditions in which there shall be a system error, and the action taken by a processor after a system error are implementation dependent. It has the form system_error.

[...]

NOTES

[...]

4 A System Error may happen for example (a) in interactions with the operating system (for example, a disk crash or interrupt), or (b) when a goal throw(T) has been executed and there is no active goal catch/3.

好的,但有点含糊...所以这是我的实际问题:

Are the following uses of system_error legitimate?

  1. Prolog 系统 "L" 不提供可修改的字符转换映射。 相反,它的行为如下:

    current_char_conversion(X, Y) :-
       maplist(can_be(character), [X,Y]),
       false.                       % mapping unch.
    
    char_conversion(X, Y) :-
       maplist(must_be(character), [X,Y]),
       (  X == Y
       -> true                      % removal is OK
       ;  throw(error(system_error,
                      not_supported(char_conversion/2)))
       ).
    
  2. Prolog 系统 "K" 支持访问控制列表,以禁止在执行的某些部分使用某些谓词。每当在代码的受限部分调用这样的谓词时,就会发生这种情况:

    throw(error(system_error, disallowed(P/N)))
    

Prolog 系统 "L" 和 "K" 还能称为 "ISO-standard compliant" 吗?

不是您关于合规性问题的答案,但是...

throw(error(system_error, disallowed(P/N)))

权限错误在这里更有意义。但是标准中操作和权限类型的可能值并不理想。 也许扩展它们并使用诸如

之类的东西

permission_error(call, predicate, P/N)

一个resource_error/1这里也不牵强