Changeset 4511 for trunk/compiler

Show
Ignore:
Timestamp:
10/17/08 08:30:34 (3 months ago)
Author:
pmoura
Message:

Implemented a more flexible internal representation of entity properties. Added entity property file/1 for entities compiled and loaded from source files (for back-end Prolog compilers where the stream_property/2 built-in predicate supports the file_name/1 property).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4507 r4511  
    6565 
    6666 
    67 % tables of loaded entities and respective relationships 
     67% tables of loaded entities, entity properties, and entity relations 
    6868 
    6969:- multifile('$lgt_current_protocol_'/5).       % '$lgt_current_protocol_'(Ptc, Prefix, Dcl, Rnm, Type) 
    7070:- dynamic('$lgt_current_protocol_'/5). 
    7171 
    72 :- multifile('$lgt_current_category_'/7).       % '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type, Synchronized) 
    73 :- dynamic('$lgt_current_category_'/7). 
    74  
    75 :- multifile('$lgt_current_object_'/13).        % '$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Type, Synchronized, Threaded) 
    76 :- dynamic('$lgt_current_object_'/13). 
    77  
    78                                                  
     72:- multifile('$lgt_current_category_'/6).       % '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type) 
     73:- dynamic('$lgt_current_category_'/6). 
     74 
     75:- multifile('$lgt_current_object_'/11).        % '$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Type) 
     76:- dynamic('$lgt_current_object_'/11). 
     77 
     78:- multifile('$lgt_entity_property_'/2).        % '$lgt_entity_property_'(Entity, Property) 
     79:- dynamic('$lgt_entity_property_'/2). 
     80     
    7981:- multifile('$lgt_implements_protocol_'/3).    % '$lgt_implements_protocol_'(ObjOrCtg, Ptc, Scope) 
    8082:- dynamic('$lgt_implements_protocol_'/3). 
     
    348350    ;   '$lgt_extends_object_'(_, Obj, _) 
    349351    ), 
    350     \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
     352    \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 
    351353    throw(error(existence_error(object, Obj), _, _)). 
    352354 
     
    357359    ;   '$lgt_extends_protocol_'(_, CtgOrPtc, _), \+ '$lgt_current_protocol_'(CtgOrPtc, _, _, _, _) -> 
    358360        throw(error(existence_error(protocol, CtgOrPtc), _, _)) 
    359     ;   '$lgt_imports_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _, _) -> 
     361    ;   '$lgt_imports_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _) -> 
    360362        throw(error(existence_error(category, CtgOrPtc), _, _)) 
    361     ;   '$lgt_extends_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _, _) -> 
     363    ;   '$lgt_extends_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _) -> 
    362364        throw(error(existence_error(category, CtgOrPtc), _, _)) 
    363365    ). 
     
    432434 
    433435current_object(Obj) :- 
    434     '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _). 
     436    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _). 
    435437 
    436438 
     
    456458 
    457459current_category(Ctg) :- 
    458     '$lgt_current_category_'(Ctg, _, _, _, _, _, _). 
     460    '$lgt_current_category_'(Ctg, _, _, _, _, _). 
    459461 
    460462 
     
    477479 
    478480object_property(Obj, Prop) :-               % static/dynamic property 
    479     '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, Prop, _, _). 
    480  
    481 object_property(Obj, synchronized) :- 
    482     '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, yes, _). 
    483  
    484 object_property(Obj, threaded) :- 
    485     '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, yes). 
     481    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, Prop). 
     482 
     483object_property(Obj, Prop) :- 
     484    '$lgt_entity_property_'(Obj, Prop). 
    486485 
    487486 
     
    500499 
    501500category_property(Ctg, Prop) :-             % static/dynamic property 
    502     '$lgt_current_category_'(Ctg, _, _, _, _, Prop, _). 
    503  
    504 category_property(Ctg, synchronized) :- 
    505     '$lgt_current_category_'(Ctg, _, _, _, _, _, yes). 
     501    '$lgt_current_category_'(Ctg, _, _, _, _, Prop). 
     502 
     503category_property(Ctg, Prop) :- 
     504    '$lgt_entity_property_'(Ctg, Prop). 
    506505 
    507506 
     
    522521    '$lgt_current_protocol_'(Ptc, _, _, _, Prop). 
    523522 
     523protocol_property(Ptc, Prop) :- 
     524    '$lgt_entity_property_'(Ptc, Prop). 
     525 
    524526 
    525527 
     
    537539create_object(Obj, Rels, Dirs, Clauses) :- 
    538540    nonvar(Obj), 
    539     '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
     541    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 
    540542    throw(error(permission_error(modify, object, Obj), create_object(Obj, Rels, Dirs, Clauses))). 
    541543 
    542544create_object(Obj, Rels, Dirs, Clauses) :- 
    543545    nonvar(Obj), 
    544     '$lgt_current_category_'(Obj, _, _, _, _, _, _), 
     546    '$lgt_current_category_'(Obj, _, _, _, _, _), 
    545547    throw(error(permission_error(modify, category, Obj), create_object(Obj, Rels, Dirs, Clauses))). 
    546548 
     
    595597create_category(Ctg, Rels, Dirs, Clauses) :- 
    596598    nonvar(Ctg), 
    597     '$lgt_current_category_'(Ctg, _, _, _, _, _, _), 
     599    '$lgt_current_category_'(Ctg, _, _, _, _, _), 
    598600    throw(error(permission_error(modify, category, Ctg), create_category(Ctg, Rels, Dirs, Clauses))). 
    599601 
    600602create_category(Ctg, Rels, Dirs, Clauses) :- 
    601603    nonvar(Ctg), 
    602     '$lgt_current_object_'(Ctg, _, _, _, _, _, _, _, _, _, _, _, _), 
     604    '$lgt_current_object_'(Ctg, _, _, _, _, _, _, _, _, _, _), 
    603605    throw(error(permission_error(modify, object, Ctg), create_category(Ctg, Rels, Dirs, Clauses))). 
    604606 
     
    657659create_protocol(Ptc, Rels, Dirs) :- 
    658660    nonvar(Ptc), 
    659     '$lgt_current_object_'(Ptc, _, _, _, _, _, _, _, _, _, _, _, _), 
     661    '$lgt_current_object_'(Ptc, _, _, _, _, _, _, _, _, _, _), 
    660662    throw(error(permission_error(modify, object, Ptc), create_protocol(Ptc, Rels, Dirs))). 
    661663 
    662664create_protocol(Ptc, Rels, Dirs) :- 
    663665    nonvar(Ptc), 
    664     '$lgt_current_category_'(Ptc, _, _, _, _, _, _), 
     666    '$lgt_current_category_'(Ptc, _, _, _, _, _), 
    665667    throw(error(permission_error(modify, category, Ptc), create_protocol(Ptc, Rels, Dirs))). 
    666668 
     
    697699        atom_codes(Id, [Base| Codes]), 
    698700    \+ '$lgt_current_protocol_'(Id, _, _, _, _), 
    699     \+ '$lgt_current_object_'(Id, _, _, _, _, _, _, _, _, _, _, _, _), 
    700     \+ '$lgt_current_category_'(Id, _, _, _, _, _, _), 
     701    \+ '$lgt_current_object_'(Id, _, _, _, _, _, _, _, _, _, _), 
     702    \+ '$lgt_current_category_'(Id, _, _, _, _, _), 
    701703    !. 
    702704 
     
    720722 
    721723abolish_object(Obj) :- 
    722     (   '$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Type, _, _) -> 
     724    (   '$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Type) -> 
    723725        (   Type == (dynamic) -> 
    724726            '$lgt_abolish_entity_predicates'(Def), 
     
    735737            abolish(Rnm/3), 
    736738            abolish(Prefix/8), 
    737             retractall('$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _)), 
     739            retractall('$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _)), 
     740            retractall('$lgt_entity_property_'(Obj, _)), 
    738741            retractall('$lgt_extends_object_'(Obj, _, _)), 
    739742            retractall('$lgt_instantiates_class_'(Obj, _, _)), 
     
    761764 
    762765abolish_category(Ctg) :- 
    763     (   '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type, _) -> 
     766    (   '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type) -> 
    764767        (   Type == (dynamic) -> 
    765768            '$lgt_abolish_entity_predicates'(Def), 
     
    769772            abolish(Rnm/3), 
    770773            abolish(Prefix/3), 
    771             retractall('$lgt_current_category_'(Ctg, _, _, _, _, _, _)), 
     774            retractall('$lgt_current_category_'(Ctg, _, _, _, _, _)), 
     775            retractall('$lgt_entity_property_'(Ctg, _)), 
    772776            retractall('$lgt_extends_category_'(Ctg, _, _)), 
    773777            retractall('$lgt_implements_protocol_'(Ctg, _, _)), 
     
    798802            abolish(Prefix/2), 
    799803            retractall('$lgt_current_protocol_'(Ptc, _, _, _, _)), 
     804            retractall('$lgt_entity_property_'(Ptc, _)), 
    800805            retractall('$lgt_extends_protocol_'(Ptc, _, _)), 
    801806            '$lgt_clean_lookup_caches' 
     
    11451150 
    11461151define_events(Event, Obj, Msg, Sender, Monitor) :- 
    1147     \+ '$lgt_current_object_'(Monitor, _, _, _, _, _, _, _, _, _, _, _, _), 
     1152    \+ '$lgt_current_object_'(Monitor, _, _, _, _, _, _, _, _, _, _), 
    11481153    throw(error(existence_error(object, Monitor), define_events(Event, Obj, Msg, Sender, Monitor))). 
    11491154 
     
    11511156    var(Event), 
    11521157    !, 
    1153     '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _, _, _), 
     1158    '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _), 
    11541159    (   call_with_args(Def, before(Obj, Msg, Sender), Monitor, Monitor, Monitor, BCall, _) -> 
    11551160        (   call_with_args(Def, after(Obj, Msg, Sender), Monitor, Monitor, Monitor, ACall, _) -> 
     
    11621167 
    11631168define_events(before, Obj, Msg, Sender, Monitor) :- 
    1164     '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _, _, _), 
     1169    '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _), 
    11651170    call_with_args(Def, before(Obj, Msg, Sender), Monitor, Monitor, Monitor, Call, _) -> 
    11661171    retractall('$lgt_before_'(Obj, Msg, Sender, Monitor, _)), 
     
    11681173 
    11691174define_events(after, Obj, Msg, Sender, Monitor) :- 
    1170     '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _, _, _), 
     1175    '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _), 
    11711176    call_with_args(Def, after(Obj, Msg, Sender), Monitor, Monitor, Monitor, Call, _) -> 
    11721177    retractall('$lgt_after_'(Obj, Msg, Sender, Monitor, _)), 
     
    14641469 
    14651470threaded_wait(Message) :- 
    1466     '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _) -> 
     1471    '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _) -> 
    14671472    '$lgt_thread_get_notifications'(Message, Prefix). 
    14681473 
     
    14801485 
    14811486threaded_notify(Message) :- 
    1482     '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _) -> 
     1487    '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _) -> 
    14831488    '$lgt_thread_send_notifications'(Message, Prefix). 
    14841489 
     
    18911896 
    18921897'$lgt_obj_exists'(Obj, Pred, Sender) :- 
    1893     (   '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _) -> 
     1898    (   '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _) -> 
    18941899        true 
    18951900    ;   throw(error(existence_error(object, Obj), Obj::Pred, Sender)) 
     
    19161921 
    19171922'$lgt_current_predicate'(Obj, Functor/Arity, Sender, _) :- 
    1918     \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
     1923    \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 
    19191924    throw(error(existence_error(object, Obj), Obj::current_predicate(Functor/Arity), Sender)). 
    19201925 
     
    19401945 
    19411946'$lgt_visible_predicate'(Obj, Pred, Sender, Scope) :- 
    1942     '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _, _, _, _, _, _) -> 
     1947    '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _, _, _, _) -> 
    19431948    call_with_args(Dcl, Pred, PScope, _, _, _, _, SCtn, _), 
    19441949    once((\+ \+ PScope = Scope; Sender = SCtn)). 
     
    19621967 
    19631968'$lgt_predicate_property'(Obj, Pred, Prop, Sender, _) :- 
    1964     \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
     1969    \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 
    19651970    throw(error(existence_error(object, Obj), Obj::predicate_property(Pred, Prop), Sender)). 
    19661971 
    19671972'$lgt_predicate_property'(Obj, Pred, Prop, Sender, Scope) :- 
    1968     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, Rnm, _, _, _), 
     1973    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, Rnm, _), 
    19691974    call_with_args(Dcl, Pred, PScope, Type, Meta, NonTerminal, Synchronized, SCtn, TCtn), 
    19701975    !, 
     
    19811986    ;   Synchronized \== no, 
    19821987        Prop = synchronized 
    1983     ;   once((  '$lgt_current_object_'(TCtn, _, TCtnDcl, _, _, _, _, _, _, _, _, _, _) 
    1984             ;   '$lgt_current_category_'(TCtn, _, TCtnDcl, _, _, _, _) 
     1988    ;   once((  '$lgt_current_object_'(TCtn, _, TCtnDcl, _, _, _, _, _, _, _, _) 
     1989            ;   '$lgt_current_category_'(TCtn, _, TCtnDcl, _, _, _) 
    19851990            ;   '$lgt_current_protocol_'(TCtn, _, TCtnDcl, _, _) 
    19861991        )), 
     
    20792084'$lgt_alias_pred'(Ctg1, _, Alias, Pred, _) :- 
    20802085    '$lgt_extends_category_'(Ctg1, Ctg2, _), 
    2081     '$lgt_current_category_'(Ctg2, _, _, _, Rnm, _, _), 
     2086    '$lgt_current_category_'(Ctg2, _, _, _, Rnm, _), 
    20822087    '$lgt_alias_pred'(Ctg2, Rnm, Alias, Pred, _). 
    20832088 
    20842089'$lgt_alias_pred'(Obj, _, Alias, Pred, _) :- 
    20852090    '$lgt_imports_category_'(Obj, Ctg, _), 
    2086     '$lgt_current_category_'(Ctg, _, _, _, Rnm, _, _), 
     2091    '$lgt_current_category_'(Ctg, _, _, _, Rnm, _), 
    20872092    '$lgt_alias_pred'(Ctg, Rnm, Alias, Pred, _). 
    20882093 
    20892094'$lgt_alias_pred'(Obj, _, Alias, Pred, prototype) :- 
    20902095    '$lgt_extends_object_'(Obj, Parent, _), 
    2091     '$lgt_current_object_'(Parent, _, _, _, _, _, _, _, _, Rnm, _, _, _), 
     2096    '$lgt_current_object_'(Parent, _, _, _, _, _, _, _, _, Rnm, _), 
    20922097    '$lgt_alias_pred'(Parent, Rnm, Alias, Pred, prototype). 
    20932098 
    20942099'$lgt_alias_pred'(Instance, _, Alias, Pred, instance) :- 
    20952100    '$lgt_instantiates_class_'(Instance, Class, _), 
    2096     '$lgt_current_object_'(Class, _, _, _, _, _, _, _, _, Rnm, _, _, _), 
     2101    '$lgt_current_object_'(Class, _, _, _, _, _, _, _, _, Rnm, _), 
    20972102    '$lgt_alias_pred'(Class, Rnm, Alias, Pred, superclass). 
    20982103 
    20992104'$lgt_alias_pred'(Class, _, Alias, Pred, superclass) :- 
    21002105    '$lgt_specializes_class_'(Class, Superclass, _), 
    2101     '$lgt_current_object_'(Superclass, _, _, _, _, _, _, _, _, Rnm, _, _, _), 
     2106    '$lgt_current_object_'(Superclass, _, _, _, _, _, _, _, _, Rnm, _), 
    21022107    '$lgt_alias_pred'(Superclass, Rnm, Alias, Pred, superclass). 
    21032108 
     
    21362141 
    21372142'$lgt_abolish_chk'(Obj, Functor/Arity, Sender, Scope) :- 
    2138     '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, DDcl, DDef, _, _, _, _), 
     2143    '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, DDcl, DDef, _, _), 
    21392144    !, 
    21402145    functor(Pred, Functor, Arity), 
     
    22172222 
    22182223'$lgt_asserta_rule_chk'(Obj, (Head:-Body), Sender, TestScope, DclScope) :- 
    2219     '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 
     2224    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType), 
    22202225    !, 
    22212226    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, Meta, SCtn, DclScope), 
     
    22512256 
    22522257'$lgt_asserta_fact_chk'(Obj, Head, Sender, TestScope, DclScope) :- 
    2253     '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 
     2258    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType), 
    22542259    !, 
    22552260    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, _, SCtn, DclScope), 
     
    23192324 
    23202325'$lgt_assertz_rule_chk'(Obj, (Head:-Body), Sender, TestScope, DclScope) :- 
    2321     '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 
     2326    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType), 
    23222327    !, 
    23232328    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, Meta, SCtn, DclScope), 
     
    23532358 
    23542359'$lgt_assertz_fact_chk'(Obj, Head, Sender, TestScope, DclScope) :- 
    2355     '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 
     2360    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType), 
    23562361    !, 
    23572362    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, _, SCtn, DclScope), 
     
    24512456 
    24522457'$lgt_clause_chk'(Obj, Head, Body, Sender, Scope) :- 
    2453     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 
     2458    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType), 
    24542459    !, 
    24552460    (   call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 
     
    25242529 
    25252530'$lgt_retract_var_body_chk'(Obj, (Head:-Body), Sender, Scope) :- 
    2526     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 
     2531    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType), 
    25272532    !, 
    25282533    (   call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 
     
    25752580 
    25762581'$lgt_retract_rule_chk'(Obj, (Head:-Body), Sender, Scope) :- 
    2577     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 
     2582    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType), 
    25782583    !, 
    25792584    (   call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 
     
    26142619 
    26152620'$lgt_retract_fact_chk'(Obj, Head, Sender, Scope) :- 
    2616     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 
     2621    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType), 
    26172622    !, 
    26182623    (   call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 
     
    26792684 
    26802685'$lgt_retractall_chk'(Obj, Head, Sender, Scope) :- 
    2681     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 
     2686    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType), 
    26822687    !, 
    26832688    (   call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 
     
    28602865    '$lgt_append'(Args, [Input, Rest], Args2), 
    28612866    Pred =.. [Functor| Args2], 
    2862     (   '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _) -> 
     2867    (   '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _) -> 
    28632868        (   call_with_args(Dcl, Pred, PScope, _, _, _, _, SCtn, _) -> 
    28642869            (   (\+ \+ PScope = Scope; Sender = SCtn) -> 
     
    29132918 
    29142919'$lgt_term_expansion'(Obj, Term, Expansion, Sender, Scope) :- 
    2915     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _), 
     2920    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _), 
    29162921    (   (   call_with_args(Dcl, term_expansion(_, _), PScope, _, _, _, _, SCtn, _) -> 
    29172922            (   (\+ \+ PScope = Scope; Sender = SCtn) -> 
     
    29582963 
    29592964'$lgt_send_to_self_nv'(Obj, Pred, Sender) :- 
    2960     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _, _, _), 
     2965    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _), 
    29612966    !, 
    29622967    (   call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) ->                    % lookup declaration 
     
    30063011 
    30073012'$lgt_send_to_object_nv'(Obj, Pred, Sender) :- 
    3008     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _, _, _), 
     3013    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _), 
    30093014    !, 
    30103015    (   call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) ->                    % lookup declaration 
     
    30653070 
    30663071'$lgt_send_to_object_ne_nv'(Obj, Pred, Sender) :- 
    3067     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _, _, _), 
     3072    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _), 
    30683073    !, 
    30693074    (   call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) ->                % lookup declaration 
     
    32183223'$lgt_metacall_in_object'(Pred, local, Sender, This, Self) :- 
    32193224    !, 
    3220     '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
     3225    '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _), 
    32213226    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, Prefix, [], _), 
    32223227    '$lgt_tr_body'(Pred, Call, DCall, Ctx), 
     
    32293234'$lgt_metacall_in_object'(Pred, MetaVars, Sender, This, Self) :- 
    32303235    (   \+ '$lgt_member'(Pred, MetaVars) -> 
    3231         '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
     3236        '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _), 
    32323237        '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, Prefix, [], _) 
    3233     ;   '$lgt_current_object_'(Sender, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
     3238    ;   '$lgt_current_object_'(Sender, Prefix, _, _, _, _, _, _, _, _, _), 
    32343239        '$lgt_ctx_ctx'(Ctx, _, Sender, Sender, Self, Prefix, [], _)  
    32353240    ), 
     
    32493254'$lgt_call_built_in'(Pred, Ctx) :- 
    32503255    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), 
    3251     '$lgt_current_object_'(This, _, _, Def, _, _, _, _, _, _, _, _, _) -> 
     3256    '$lgt_current_object_'(This, _, _, Def, _, _, _, _, _, _, _) -> 
    32523257    (   call_with_args(Def, Pred, Sender, This, Self, Call) -> 
    32533258        call(Call) 
     
    32633268'$lgt_call_within_context'(Obj, Goal, This) :- 
    32643269    (   '$lgt_compiler_flag'(context_switching_calls, allow) -> 
    3265         (   '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _, _, _, _, _, _) -> 
     3270        (   '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _, _, _, _) -> 
    32663271            '$lgt_ctx_ctx'(Ctx, _, Obj, Obj, Obj, Prefix, [], _), 
    32673272            '$lgt_tr_body'(Goal, TGoal, DGoal, Ctx), 
     
    32853290        call_with_args(Rnm, Ctg, Pred, Alias), 
    32863291        (   '$lgt_imports_category_'(This, Ctg, _), 
    3287             '$lgt_current_category_'(Ctg, _, _, Def, _, _, _), 
     3292            '$lgt_current_category_'(Ctg, _, _, Def, _, _), 
    32883293            call_with_args(Def, Pred, Sender, This, Self, Call, _) -> 
    32893294            call(Call) 
     
    33513356 
    33523357 
    3353 '$lgt_current_object_'(logtalk, '$lgt_bio_logtalk_0_', '$lgt_bio_logtalk_0__dcl', '$lgt_bio_logtalk_0__def', '$lgt_bio_logtalk_0__super', '$lgt_bio_logtalk_0__idcl', '$lgt_bio_logtalk_0__idef', '$lgt_bio_logtalk_0__ddcl', '$lgt_bio_logtalk_0__ddef', '$lgt_bio_logtalk_0__alias', static, no, no). 
    3354 '$lgt_current_object_'(user, '$lgt_bio_user_0_', '$lgt_bio_user_0__dcl', '$lgt_bio_user_0__def', '$lgt_bio_user_0__super', '$lgt_bio_user_0__idcl', '$lgt_bio_user_0__idef', '$lgt_bio_user_0__ddcl', '$lgt_bio_user_0__ddef', '$lgt_bio_user_0__alias', static, no, yes). 
    3355 '$lgt_current_object_'(debugger, '$lgt_bio_debugger_0_', '$lgt_bio_debugger_0__dcl', '$lgt_bio_debugger_0__def', '$lgt_bio_debugger_0__super', '$lgt_bio_debugger_0__idcl', '$lgt_bio_debugger_0__idef', '$lgt_bio_debugger_0__ddcl', '$lgt_bio_debugger_0__ddef', '$lgt_bio_debugger_0__alias', static, no, no). 
     3358'$lgt_current_object_'(logtalk, '$lgt_bio_logtalk_0_', '$lgt_bio_logtalk_0__dcl', '$lgt_bio_logtalk_0__def', '$lgt_bio_logtalk_0__super', '$lgt_bio_logtalk_0__idcl', '$lgt_bio_logtalk_0__idef', '$lgt_bio_logtalk_0__ddcl', '$lgt_bio_logtalk_0__ddef', '$lgt_bio_logtalk_0__alias', static). 
     3359'$lgt_current_object_'(user, '$lgt_bio_user_0_', '$lgt_bio_user_0__dcl', '$lgt_bio_user_0__def', '$lgt_bio_user_0__super', '$lgt_bio_user_0__idcl', '$lgt_bio_user_0__idef', '$lgt_bio_user_0__ddcl', '$lgt_bio_user_0__ddef', '$lgt_bio_user_0__alias', static). 
     3360'$lgt_current_object_'(debugger, '$lgt_bio_debugger_0_', '$lgt_bio_debugger_0__dcl', '$lgt_bio_debugger_0__def', '$lgt_bio_debugger_0__super', '$lgt_bio_debugger_0__idcl', '$lgt_bio_debugger_0__idef', '$lgt_bio_debugger_0__ddcl', '$lgt_bio_debugger_0__ddef', '$lgt_bio_debugger_0__alias', static). 
    33563361 
    33573362 
    33583363'$lgt_current_protocol_'(expanding, '$lgt_bip_expanding_0_', '$lgt_bip_expanding_0__dcl', '$lgt_bip_expanding_0__alias', static). 
    33593364'$lgt_current_protocol_'(monitoring, '$lgt_bip_monitoring_0_', '$lgt_bip_monitoring_0__dcl', '$lgt_bip_monitoring_0__alias', static). 
     3365 
     3366 
     3367'$lgt_entity_property_'(user, threaded). 
    33603368 
    33613369 
     
    34663474 
    34673475'$lgt_hidden_functor'(Functor) :- 
    3468     '$lgt_current_category_'(_, Prefix, _, _, _, _, _), 
     3476    '$lgt_current_category_'(_, Prefix, _, _, _, _), 
    34693477    atom_concat(Prefix, _, Functor), 
    34703478    !. 
    34713479 
    34723480'$lgt_hidden_functor'(Functor) :- 
    3473     '$lgt_current_object_'(_, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
     3481    '$lgt_current_object_'(_, Prefix, _, _, _, _, _, _, _, _, _), 
    34743482    atom_concat(Prefix, _, Functor), 
    34753483    !. 
     
    41964204'$lgt_check_redefined_entities' :- 
    41974205    (   '$lgt_pp_file_rclause_'('$lgt_current_protocol_'(Entity, _, _, _, _)) 
    4198     ;   '$lgt_pp_file_rclause_'('$lgt_current_category_'(Entity, _, _, _, _, _, _)) 
    4199     ;   '$lgt_pp_file_rclause_'('$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _, _, _)) 
     4206    ;   '$lgt_pp_file_rclause_'('$lgt_current_category_'(Entity, _, _, _, _, _)) 
     4207    ;   '$lgt_pp_file_rclause_'('$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _)) 
    42004208    ), 
    42014209    '$lgt_redefined_entity'(Entity, Type), 
     
    42134221 
    42144222'$lgt_redefined_entity'(Entity, Type) :- 
    4215     (   '$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _, _, _) -> 
     4223    (   '$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _) -> 
    42164224        Type = object 
    42174225    ;   '$lgt_current_protocol_'(Entity, _, _, _, _) -> 
    42184226        Type = protocol 
    4219     ;   '$lgt_current_category_'(Entity, _, _, _, _, _, _) -> 
     4227    ;   '$lgt_current_category_'(Entity, _, _, _, _, _) -> 
    42204228        Type = category 
    42214229    ). 
     
    42454253    retractall('$lgt_before_'(_, _, _, Entity, _)), 
    42464254    retractall('$lgt_after_'(_, _, _, Entity, _)), 
    4247     retractall('$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _, _, _)), 
     4255    retractall('$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _)), 
    42484256    retractall('$lgt_current_protocol_'(Entity, _, _, _, _)), 
    4249     retractall('$lgt_current_category_'(Entity, _, _, _, _, _, _)), 
     4257    retractall('$lgt_current_category_'(Entity, _, _, _, _, _)), 
    42504258    retractall('$lgt_implements_protocol_'(Entity, _, _)), 
    42514259    retractall('$lgt_imports_category_'(Entity, _, _)), 
     
    46444652 
    46454653 
     4654% '$lgt_add_entity_file_properties'(@entity_identifier, @stream) 
     4655% 
     4656% adds entity properties related to the entity source file 
     4657 
     4658'$lgt_add_entity_file_properties'(Entity, Input) :- 
     4659%   (   catch('$lgt_stream_current_line_number'(Input, Line), _, fail) -> 
     4660%       assertz('$lgt_pp_file_rclause_'('$lgt_entity_property_'(Entity, line_count(Line)))) 
     4661%   ;   true 
     4662%   ), 
     4663    (   catch(stream_property(Input, file_name(File)), _, fail) -> 
     4664        assertz('$lgt_pp_rclause_'('$lgt_entity_property_'(Entity, file(File)))) 
     4665    ;   true 
     4666    ). 
     4667 
     4668 
     4669 
    46464670% '$lgt_report_singletons'(+list, +term, @stream) 
    46474671% 
    4648 % report the singleton variables found while compiling an entity term 
     4672% reports the singleton variables found while compiling an entity term 
    46494673 
    46504674'$lgt_report_singletons'(TSingletons, Term, Input) :- 
     
    50925116    '$lgt_pp_rclause_'(Clause). 
    50935117 
    5094 '$lgt_pp_rclause'('$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Mode, Synchronized, Threaded)) :- 
     5118'$lgt_pp_rclause'('$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Mode)) :- 
    50955119    '$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Mode), 
    5096     !, 
    5097     (   '$lgt_pp_synchronized_' -> 
    5098         Synchronized = yes 
    5099     ;   Synchronized = no 
    5100     ), 
    5101     (   '$lgt_pp_threaded_' -> 
    5102         Threaded = yes 
    5103     ;   Threaded = no 
    5104     ). 
     5120    !. 
    51055121 
    51065122'$lgt_pp_rclause'('$lgt_current_protocol_'(Ptc, Prefix, Dcl, Rnm, Mode)) :- 
     
    51085124    !. 
    51095125 
    5110 '$lgt_pp_rclause'('$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Mode, Synchronized)) :- 
     5126'$lgt_pp_rclause'('$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Mode)) :- 
    51115127    '$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, Mode), 
    5112     !, 
    5113     (   '$lgt_pp_synchronized_' -> 
    5114         Synchronized = yes 
    5115     ;   Synchronized = no 
    5116     ). 
     5128    !. 
    51