【发布时间】:2015-12-27 22:49:23
【问题描述】:
我在 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
所以,我添加了:- dynamic amountOfStudentsInCourseAsserted/2,但不幸的是,这会将谓词添加到current_predicate(谓词)中。因此,如果我使用此动态命名,我将无法再使用current_predicate/1。
是否还有另一个谓词,例如 current_predicate/1,但不适用于动态名称?
【问题讨论】:
标签: prolog swi-prolog prolog-directive-dynamic