我有一些使用 Prolog 中的断言定义的谓词。
我使用current_predicate/1
它是为了知道断言是否已经运行(只需要断言一个值)。
然而,swipl
一直在抱怨:
Warning: The predicates below are not defined. If these are defined
Warning: at runtime using assert/1, use :- dynamic Name/Arity.
Warning:
Warning: amountOfStudentsInCourseAsserted/2, which is referenced by
因此,我添加了,但不幸的是,这会将谓词添加到 current_predicate(Predicate).. 因此,如果我使用此动态命名,:- dynamic amountOfStudentsInCourseAsserted/2
我将无法再使用。current_predicate/1
对于动态名称,是否还有另一个这样的谓词current_predicate/1
不正确?