=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.27.0
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
% start by loading the example:
| ?- logtalk_load(inheritance(loader)).
...
% parent interface
| ?- parent::interface.
public/0 - public
protected/0 - protected
private/0 - private
interface/0 - public
yes
% prototype1 extends public::parent
| ?- prototype1::interface.
% prototype2 extends protected::parent
| ?- prototype2::interface.
public/0 - protected
% prototype3 extends private::parent
| ?- prototype3::interface.
public/0 - private
protected/0 - private
% descendant1 extends public::prototype1
| ?- descendant1::interface.
% descendant2 extends public::prototype2
| ?- descendant2::interface.
% descendant3 extends public::prototype3
| ?- descendant3::interface.
% object (root of the inheritance graph) interface
| ?- root::interface.
% instance1 instantiates subclass1 that specializes public::root
| ?- instance1::interface.
% instance2 instantiates subclass2 that specializes protected::root
| ?- instance2::interface.
% instance3 instantiates subclass3 that specializes private::root
| ?- instance3::interface.