In "root", you need to send the message abstract/1 to self
, instead of calling it directly. I.e. write:
There is no need to repeat the public/1 directive in "descendant"; the scope declaration is inherited. In your original code, the query is false instead of resulting in an error because of the implicit closed-world assumption: predicates declared but not defined are implicitly false.
Please note that, in Logtalk, the "keyword" "extends" declares a relation between a prototype and its parent, not a relation between classes. For superclass-subclass relations and class-instance relations, Logtalk uses, respectively, the "keywords" "specializes" and "instantiates".