Changeset 4325

Show
Ignore:
Timestamp:
06/27/08 11:32:50 (2 months ago)
Author:
pmoura
Message:

Changed the representation of the runtime tables for loaded entities in order to drop the need of a "functors clause" per entity. This avoids redundancy on the representation of entity functors and helps reducing the size of the generated Prolog files.

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4324 r4325  
    6464% tables of loaded entities and respective relationships 
    6565 
    66 :- multifile('$lgt_current_protocol_'/3).       % '$lgt_current_protocol_'(Ptc, Prefix, Type) 
    67 :- dynamic('$lgt_current_protocol_'/3). 
    68  
    69 :- multifile('$lgt_current_category_'/6).       % '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Type, Synchronized) 
    70 :- dynamic('$lgt_current_category_'/6). 
    71  
    72 :- multifile('$lgt_current_object_'/8).         % '$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, Type, Synchronized, Threaded) 
    73 :- dynamic('$lgt_current_object_'/8). 
     66:- multifile('$lgt_current_protocol_'/5).       % '$lgt_current_protocol_'(Ptc, Prefix, Dcl, Rnm, Type) 
     67:- dynamic('$lgt_current_protocol_'/5). 
     68 
     69:- multifile('$lgt_current_category_'/7).       % '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type, Synchronized) 
     70:- dynamic('$lgt_current_category_'/7). 
     71 
     72:- multifile('$lgt_current_object_'/13).        % '$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Type, Synchronized, Threaded) 
     73:- dynamic('$lgt_current_object_'/13). 
    7474 
    7575                                                 
     
    107107 
    108108:- multifile('$lgt_debugging_'/1).              % '$lgt_debugging_'(Entity) 
    109 :- dynamic('$lgt_debugging_'/1).                % '$lgt_debugging_'(Entity) 
     109:- dynamic('$lgt_debugging_'/1). 
    110110                                                 
    111111:- dynamic('$lgt_dbg_debugging_'/0).            % '$lgt_dbg_debugging_' 
     
    189189:- dynamic('$lgt_pp_non_terminal_'/3).          % '$lgt_pp_non_terminal_'(Functor, Args, Arity) 
    190190 
    191 :- dynamic('$lgt_pp_object_'/11).               % '$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Mode) 
    192 :- dynamic('$lgt_pp_category_'/6).              % '$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, Mode) 
    193 :- dynamic('$lgt_pp_protocol_'/5).              % '$lgt_pp_protocol_'(Ptc, Prefix, Dcl, Rnm, Mode) 
     191:- dynamic('$lgt_pp_object_'/11).               % '$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Type) 
     192:- dynamic('$lgt_pp_category_'/6).              % '$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type) 
     193:- dynamic('$lgt_pp_protocol_'/5).              % '$lgt_pp_protocol_'(Ptc, Prefix, Dcl, Rnm, Type) 
    194194 
    195195:- dynamic('$lgt_pp_module_'/1).                % '$lgt_pp_module_'(Module) 
     
    340340    ;   '$lgt_extends_object_'(_, Obj, _) 
    341341    ), 
    342     \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _), 
     342    \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
    343343    throw(error(existence_error(object, Obj), _, _)). 
    344344 
    345345'$lgt_runtime_error_handler'(error(existence_error(procedure, TFunctor/7), _)) :- 
    346346    atom_concat(CtgOrPtc, '_0__dcl', TFunctor), 
    347     (   '$lgt_implements_protocol_'(_, CtgOrPtc, _), \+ '$lgt_current_protocol_'(CtgOrPtc, _, _) -> 
     347    (   '$lgt_implements_protocol_'(_, CtgOrPtc, _), \+ '$lgt_current_protocol_'(CtgOrPtc, _, _, _, _) -> 
    348348        throw(error(existence_error(protocol, CtgOrPtc), _, _)) 
    349     ;   '$lgt_extends_protocol_'(_, CtgOrPtc, _), \+ '$lgt_current_protocol_'(CtgOrPtc, _, _) -> 
     349    ;   '$lgt_extends_protocol_'(_, CtgOrPtc, _), \+ '$lgt_current_protocol_'(CtgOrPtc, _, _, _, _) -> 
    350350        throw(error(existence_error(protocol, CtgOrPtc), _, _)) 
    351     ;   '$lgt_imports_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _) -> 
     351    ;   '$lgt_imports_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _, _) -> 
    352352        throw(error(existence_error(category, CtgOrPtc), _, _)) 
    353     ;   '$lgt_extends_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _) -> 
     353    ;   '$lgt_extends_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _, _) -> 
    354354        throw(error(existence_error(category, CtgOrPtc), _, _)) 
    355355    ). 
     
    423423 
    424424current_object(Obj) :- 
    425     '$lgt_current_object_'(Obj, _, _, _, _, _, _, _). 
     425    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _). 
    426426 
    427427 
     
    435435 
    436436current_protocol(Ptc) :- 
    437     '$lgt_current_protocol_'(Ptc, _, _). 
     437    '$lgt_current_protocol_'(Ptc, _, _, _, _). 
    438438 
    439439 
     
    447447 
    448448current_category(Ctg) :- 
    449     '$lgt_current_category_'(Ctg, _, _, _, _, _). 
     449    '$lgt_current_category_'(Ctg, _, _, _, _, _, _). 
    450450 
    451451 
     
    468468 
    469469object_property(Obj, Prop) :- 
    470     '$lgt_current_object_'(Obj, _, _, _, _, Prop, _, _).        % static/dynamic property 
     470    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, Prop, _, _).     % static/dynamic property 
    471471 
    472472object_property(Obj, synchronized) :- 
    473     '$lgt_current_object_'(Obj, _, _, _, _, _, yes, _). 
     473    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, yes, _). 
    474474 
    475475object_property(Obj, threaded) :- 
    476     '$lgt_current_object_'(Obj, _, _, _, _, _, _, yes). 
     476    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, yes). 
    477477 
    478478 
     
    491491 
    492492category_property(Ctg, Prop) :-             % static/dynamic property 
    493     '$lgt_current_category_'(Ctg, _, _, _, Prop, _). 
     493    '$lgt_current_category_'(Ctg, _, _, _, _, Prop, _). 
    494494 
    495495category_property(Ctg, synchronized) :- 
    496     '$lgt_current_category_'(Ctg, _, _, _, _, yes). 
     496    '$lgt_current_category_'(Ctg, _, _, _, _, _, yes). 
    497497 
    498498 
     
    511511 
    512512protocol_property(Ptc, Prop) :-     % static/dynamic property 
    513     '$lgt_current_protocol_'(Ptc, _, Prop). 
     513    '$lgt_current_protocol_'(Ptc, _, _, _, Prop). 
    514514 
    515515 
     
    526526 
    527527create_object(Obj, Rels, Dirs, Clauses) :- 
    528     '$lgt_current_object_'(Obj, _, _, _, _, _, _, _), 
     528    '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
    529529    throw(error(permission_error(modify, object, Obj), create_object(Obj, Rels, Dirs, Clauses))). 
    530530 
    531531create_object(Obj, Rels, Dirs, Clauses) :- 
    532     '$lgt_current_category_'(Obj, _, _, _, _, _), 
     532    '$lgt_current_category_'(Obj, _, _, _, _, _, _), 
    533533    throw(error(permission_error(modify, category, Obj), create_object(Obj, Rels, Dirs, Clauses))). 
    534534 
    535535create_object(Obj, Rels, Dirs, Clauses) :- 
    536     '$lgt_current_protocol_'(Obj, _, _), 
     536    '$lgt_current_protocol_'(Obj, _, _, _, _), 
    537537    throw(error(permission_error(modify, protocol, Obj), create_object(Obj, Rels, Dirs, Clauses))). 
    538538 
     
    576576 
    577577create_category(Ctg, Rels, Dirs, Clauses) :- 
    578     '$lgt_current_category_'(Ctg, _, _, _, _, _), 
     578    '$lgt_current_category_'(Ctg, _, _, _, _, _, _), 
    579579    throw(error(permission_error(modify, category, Ctg), create_category(Ctg, Rels, Dirs, Clauses))). 
    580580 
    581581create_category(Ctg, Rels, Dirs, Clauses) :- 
    582     '$lgt_current_object_'(Ctg, _, _, _, _, _, _, _), 
     582    '$lgt_current_object_'(Ctg, _, _, _, _, _, _, _, _, _, _, _, _), 
    583583    throw(error(permission_error(modify, object, Ctg), create_category(Ctg, Rels, Dirs, Clauses))). 
    584584 
    585585create_category(Ctg, Rels, Dirs, Clauses) :- 
    586     '$lgt_current_protocol_'(Ctg, _, _), 
     586    '$lgt_current_protocol_'(Ctg, _, _, _, _), 
    587587    throw(error(permission_error(modify, protocol, Ctg), create_category(Ctg, Rels, Dirs, Clauses))). 
    588588 
     
    625625 
    626626create_protocol(Ptc, Rels, Dirs) :- 
    627     '$lgt_current_protocol_'(Ptc, _, _), 
     627    '$lgt_current_protocol_'(Ptc, _, _, _, _), 
    628628    throw(error(permission_error(modify, protocol, Ptc), create_protocol(Ptc, Rels, Dirs))). 
    629629 
    630630create_protocol(Ptc, Rels, Dirs) :- 
    631     '$lgt_current_object_'(Ptc, _, _, _, _, _, _, _), 
     631    '$lgt_current_object_'(Ptc, _, _, _, _, _, _, _, _, _, _, _, _), 
    632632    throw(error(permission_error(modify, object, Ptc), create_protocol(Ptc, Rels, Dirs))). 
    633633 
    634634create_protocol(Ptc, Rels, Dirs) :- 
    635     '$lgt_current_category_'(Ptc, _, _, _, _, _), 
     635    '$lgt_current_category_'(Ptc, _, _, _, _, _, _), 
    636636    throw(error(permission_error(modify, category, Ptc), create_protocol(Ptc, Rels, Dirs))). 
    637637 
     
    667667 
    668668abolish_object(Obj) :- 
    669     (   '$lgt_current_object_'(Obj, Prefix, _, _, _, Type, _, _) -> 
     669    (   '$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Type, _, _) -> 
    670670        (   Type == (dynamic) -> 
    671             call_with_args(Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm), 
    672671            '$lgt_abolish_entity_predicates'(Def), 
    673672            '$lgt_abolish_entity_predicates'(DDef), 
     
    683682            abolish(Rnm/3), 
    684683            abolish(Prefix/8), 
    685             retractall('$lgt_current_object_'(Obj, _, _, _, _, _, _, _)), 
     684            retractall('$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _)), 
    686685            retractall('$lgt_extends_object_'(Obj, _, _)), 
    687686            retractall('$lgt_instantiates_class_'(Obj, _, _)), 
     
    709708 
    710709abolish_category(Ctg) :- 
    711     (   '$lgt_current_category_'(Ctg, Prefix, _, _, Type, _) -> 
     710    (   '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type, _) -> 
    712711        (   Type == (dynamic) -> 
    713             call_with_args(Prefix, Dcl, Def, Rnm), 
    714712            '$lgt_abolish_entity_predicates'(Def), 
    715713            abolish(Dcl/6), 
     
    718716            abolish(Rnm/3), 
    719717            abolish(Prefix/3), 
    720             retractall('$lgt_current_category_'(Ctg, _, _, _, _, _)), 
     718            retractall('$lgt_current_category_'(Ctg, _, _, _, _, _, _)), 
    721719            retractall('$lgt_extends_category_'(Ctg, _, _)), 
    722720            retractall('$lgt_implements_protocol_'(Ctg, _, _)), 
     
    740738 
    741739abolish_protocol(Ptc) :- 
    742     (   '$lgt_current_protocol_'(Ptc, Prefix, Type) -> 
     740    (   '$lgt_current_protocol_'(Ptc, Prefix, Dcl, Rnm, Type) -> 
    743741        (   Type == (dynamic) -> 
    744             call_with_args(Prefix, Dcl, Rnm), 
    745742            abolish(Dcl/6), 
    746743            abolish(Dcl/7), 
    747744            abolish(Rnm/3), 
    748745            abolish(Prefix/2), 
    749             retractall('$lgt_current_protocol_'(Ptc, _, _)), 
     746            retractall('$lgt_current_protocol_'(Ptc, _, _, _, _)), 
    750747            retractall('$lgt_extends_protocol_'(Ptc, _, _)), 
    751748            '$lgt_clean_lookup_caches' 
     
    10951092 
    10961093define_events(Event, Obj, Msg, Sender, Monitor) :- 
    1097     \+ '$lgt_current_object_'(Monitor, _, _, _, _, _, _, _), 
     1094    \+ '$lgt_current_object_'(Monitor, _, _, _, _, _, _, _, _, _, _, _, _), 
    10981095    throw(error(existence_error(object, Monitor), define_events(Event, Obj, Msg, Sender, Monitor))). 
    10991096 
     
    11011098    var(Event), 
    11021099    !, 
    1103     '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _), 
     1100    '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _, _, _), 
    11041101    (   call_with_args(Def, before(Obj, Msg, Sender), Monitor, Monitor, Monitor, BCall, _) -> 
    11051102        (   call_with_args(Def, after(Obj, Msg, Sender), Monitor, Monitor, Monitor, ACall, _) -> 
     
    11121109 
    11131110define_events(before, Obj, Msg, Sender, Monitor) :- 
    1114     '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _), 
     1111    '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _, _, _), 
    11151112    call_with_args(Def, before(Obj, Msg, Sender), Monitor, Monitor, Monitor, Call, _) -> 
    11161113    retractall('$lgt_before_'(Obj, Msg, Sender, Monitor, _)), 
     
    11181115 
    11191116define_events(after, Obj, Msg, Sender, Monitor) :- 
    1120     '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _), 
     1117    '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _, _, _), 
    11211118    call_with_args(Def, after(Obj, Msg, Sender), Monitor, Monitor, Monitor, Call, _) -> 
    11221119    retractall('$lgt_after_'(Obj, Msg, Sender, Monitor, _)), 
     
    14141411 
    14151412threaded_wait(Message) :- 
    1416     '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _), 
     1413    '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    14171414    '$lgt_thread_get_notifications'(Message, Prefix). 
    14181415 
     
    14301427 
    14311428threaded_notify(Message) :- 
    1432     '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _), 
     1429    '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    14331430    '$lgt_thread_send_notifications'(Message, Prefix). 
    14341431 
     
    18411838 
    18421839'$lgt_obj_exists'(Obj, Pred, Sender) :- 
    1843     (   '$lgt_current_object_'(Obj, _, _, _, _, _, _, _) -> 
     1840    (   '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _) -> 
    18441841        true 
    18451842    ;   throw(error(existence_error(object, Obj), Obj::Pred, Sender)) 
     
    18661863 
    18671864'$lgt_current_predicate'(Obj, Functor/Arity, Sender, _) :- 
    1868     \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _), 
     1865    \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
    18691866    throw(error(existence_error(object, Obj), Obj::current_predicate(Functor/Arity), Sender)). 
    18701867 
     
    18901887 
    18911888'$lgt_visible_predicate'(Obj, Pred, Sender, Scope) :- 
    1892     '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _), 
     1889    '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _, _, _, _, _, _), 
    18931890    call_with_args(Dcl, Pred, PScope, _, _, _, _, SCtn, _), 
    18941891    once((\+ \+ PScope = Scope; Sender = SCtn)). 
     
    19121909 
    19131910'$lgt_predicate_property'(Obj, Pred, Prop, Sender, _) :- 
    1914     \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _), 
     1911    \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _), 
    19151912    throw(error(existence_error(object, Obj), Obj::predicate_property(Pred, Prop), Sender)). 
    19161913 
    19171914'$lgt_predicate_property'(Obj, Pred, Prop, Sender, Scope) :- 
    1918     '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, _), 
     1915    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, _, _, _, _, _, _), 
    19191916    call_with_args(Dcl, Pred, PScope, Type, Meta, NonTerminal, Synchronized, SCtn, TCtn), 
    19201917    !, 
     
    19311928    ;   Synchronized \== no, 
    19321929        Prop = synchronized 
    1933     ;   '$lgt_current_object_'(TCtn, _, TCtnDcl, _, _, _, _, _), 
     1930    ;   '$lgt_current_object_'(TCtn, _, TCtnDcl, _, _, _, _, _, _, _, _, _, _), 
    19341931        \+ call_with_args(TCtnDcl, Pred, _, _, _, _, _), 
    19351932        '$lgt_alias_pred'(Obj, Prefix, Pred, Pred2), 
     
    19921989'$lgt_alias_pred'(Obj, _, Alias, Pred, _) :- 
    19931990    '$lgt_implements_protocol_'(Obj, Ptc, _), 
    1994     '$lgt_current_protocol_'(Ptc, Prefix, _), 
     1991    '$lgt_current_protocol_'(Ptc, Prefix, _, _, _), 
    19951992    '$lgt_alias_pred'(Ptc, Prefix, Alias, Pred, _). 
    19961993 
    19971994'$lgt_alias_pred'(Ptc1, _, Alias, Pred, _) :- 
    19981995    '$lgt_extends_protocol_'(Ptc1, Ptc2, _), 
    1999     '$lgt_current_protocol_'(Ptc2, Prefix, _), 
     1996    '$lgt_current_protocol_'(Ptc2, Prefix, _, _, _), 
    20001997    '$lgt_alias_pred'(Ptc2, Prefix, Alias, Pred, _). 
    20011998 
    20021999'$lgt_alias_pred'(Ctg1, _, Alias, Pred, _) :- 
    20032000    '$lgt_extends_category_'(Ctg1, Ctg2, _), 
    2004     '$lgt_current_category_'(Ctg2, Prefix, _, _, _, _), 
     2001    '$lgt_current_category_'(Ctg2, Prefix, _, _, _, _, _), 
    20052002    '$lgt_alias_pred'(Ctg2, Prefix, Alias, Pred, _). 
    20062003 
    20072004'$lgt_alias_pred'(Obj, _, Alias, Pred, _) :- 
    20082005    '$lgt_imports_category_'(Obj, Ctg, _), 
    2009     '$lgt_current_category_'(Ctg, Prefix, _, _, _, _), 
     2006    '$lgt_current_category_'(Ctg, Prefix, _, _, _, _, _), 
    20102007    '$lgt_alias_pred'(Ctg, Prefix, Alias, Pred, _). 
    20112008 
    20122009'$lgt_alias_pred'(Obj, _, Alias, Pred, prototype) :- 
    20132010    '$lgt_extends_object_'(Obj, Parent, _), 
    2014     '$lgt_current_object_'(Parent, Prefix, _, _, _, _, _, _), 
     2011    '$lgt_current_object_'(Parent, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    20152012    '$lgt_alias_pred'(Parent, Prefix, Alias, Pred, prototype). 
    20162013 
    20172014'$lgt_alias_pred'(Instance, _, Alias, Pred, instance) :- 
    20182015    '$lgt_instantiates_class_'(Instance, Class, _), 
    2019     '$lgt_current_object_'(Class, Prefix, _, _, _, _, _, _), 
     2016    '$lgt_current_object_'(Class, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    20202017    '$lgt_alias_pred'(Class, Prefix, Alias, Pred, superclass). 
    20212018 
    20222019'$lgt_alias_pred'(Class, _, Alias, Pred, superclass) :- 
    20232020    '$lgt_specializes_class_'(Class, Superclass, _), 
    2024     '$lgt_current_object_'(Superclass, Prefix, _, _, _, _, _, _), 
     2021    '$lgt_current_object_'(Superclass, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    20252022    '$lgt_alias_pred'(Superclass, Prefix, Alias, Pred, superclass). 
    20262023 
     
    20592056 
    20602057'$lgt_abolish_chk'(Obj, Functor/Arity, Sender, Scope) :- 
    2061     '$lgt_current_object_'(Obj, Prefix, Dcl, _, _, _, _, _), 
     2058    '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, DDcl, DDef, _, _, _, _), 
    20622059    !, 
    20632060    (   functor(Pred, Functor, Arity), 
     
    20652062        (   (\+ \+ PScope = Scope; Sender = SCtn) -> 
    20662063            (   Compilation == (dynamic) -> 
    2067                 call_with_args(Prefix, _, _, _, _, _, DDcl, DDef, _), 
    20682064                (   call_with_args(DDcl, Pred, _) -> 
    20692065                    Clause =.. [DDcl, Pred, _], 
     
    21412137 
    21422138'$lgt_asserta_rule_chk'(Obj, (Head:-Body), Sender, TestScope, DclScope) :- 
    2143     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2144     !, 
    2145     call_with_args(Prefix, Dcl, Def, _, _, _, DDcl, DDef, _), 
     2139    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _), 
     2140    !, 
    21462141    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, Meta, SCtn, DclScope), 
    21472142    (   Type == (dynamic) -> 
     
    21762171 
    21772172'$lgt_asserta_fact_chk'(Obj, Head, Sender, TestScope, DclScope) :- 
    2178     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2179     !, 
    2180     call_with_args(Prefix, Dcl, Def, _, _, _, DDcl, DDef, _), 
     2173    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _), 
     2174    !, 
    21812175    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, _, SCtn, DclScope), 
    21822176    (   Type == (dynamic) -> 
     
    22452239 
    22462240'$lgt_assertz_rule_chk'(Obj, (Head:-Body), Sender, TestScope, DclScope) :- 
    2247     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2248     !, 
    2249     call_with_args(Prefix, Dcl, Def, _, _, _, DDcl, DDef, _), 
     2241    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _), 
     2242    !, 
    22502243    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, Meta, SCtn, DclScope), 
    22512244    (   Type == (dynamic) -> 
     
    22802273 
    22812274'$lgt_assertz_fact_chk'(Obj, Head, Sender, TestScope, DclScope) :- 
    2282     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2283     !, 
    2284     call_with_args(Prefix, Dcl, Def, _, _, _, DDcl, DDef, _), 
     2275    '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _), 
     2276    !, 
    22852277    '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, _, SCtn, DclScope), 
    22862278    (   Type == (dynamic) -> 
     
    23792371 
    23802372'$lgt_clause_chk'(Obj, Head, Body, Sender, Scope) :- 
    2381     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2382     !, 
    2383     call_with_args(Prefix, Dcl, Def, _, _, _, _, DDef, _), 
     2373    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _), 
     2374    !, 
    23842375    (   call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) -> 
    23852376        (   Type == (dynamic) -> 
     
    24532444 
    24542445'$lgt_retract_var_body_chk'(Obj, (Head:-Body), Sender, Scope) :- 
    2455     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2456     !, 
    2457     call_with_args(Prefix, Dcl, Def, _, _, _, _, DDef, _), 
     2446    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _), 
     2447    !, 
    24582448    (   call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) -> 
    24592449        (   Type == (dynamic) -> 
     
    25052495 
    25062496'$lgt_retract_rule_chk'(Obj, (Head:-Body), Sender, Scope) :- 
    2507     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2508     !, 
    2509     call_with_args(Prefix, Dcl, Def, _, _, _, _, DDef, _), 
     2497    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _), 
     2498    !, 
    25102499    (   call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) -> 
    25112500        (   Type == (dynamic) -> 
     
    25452534 
    25462535'$lgt_retract_fact_chk'(Obj, Head, Sender, Scope) :- 
    2547     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2548     !, 
    2549     call_with_args(Prefix, Dcl, Def, _, _, _, _, DDef, _), 
     2536    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _), 
     2537    !, 
    25502538    (   call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) -> 
    25512539        (   Type == (dynamic) -> 
     
    26112599 
    26122600'$lgt_retractall_chk'(Obj, Head, Sender, Scope) :- 
    2613     '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _), 
    2614     !, 
    2615     call_with_args(Prefix, Dcl, Def, _, _, _, _, DDef, _), 
     2601    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _), 
     2602    !, 
    26162603    (   call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) -> 
    26172604        (   Type == (dynamic) -> 
     
    27842771 
    27852772'$lgt_phrase'(Obj, NonTerminal, Input, Rest, Sender, Scope) :- 
    2786     (   '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, _) -> 
     2773    (   '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _) -> 
    27872774        NonTerminal =.. [Functor| Args], 
    27882775        '$lgt_append'(Args, [Input, Rest], Args2), 
     
    28012788            Obj = Sender, 
    28022789            (   call_with_args(Def, Pred, Obj, Obj, Obj, Call) 
    2803             ;   call_with_args(Prefix, _, _, _, _, _, _, DDef, _), call_with_args(DDef, Pred, Obj, Obj, Obj, Call) 
     2790            ;   call_with_args(DDef, Pred, Obj, Obj, Obj, Call) 
    28042791            )   -> 
    28052792                call(Call) 
     
    28402827 
    28412828'$lgt_term_expansion'(Obj, Term, Expansion, Sender, Scope) :- 
    2842     '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, _), 
     2829    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _), 
    28432830    (   (   call_with_args(Dcl, term_expansion(_, _), PScope, _, _, _, _, SCtn, _) -> 
    28442831            (   (\+ \+ PScope = Scope; Sender = SCtn) -> 
     
    28492836        (   call_with_args(Def, term_expansion(Term, Expansion), Obj, Obj, Obj, Call) -> 
    28502837            true 
    2851         ;   call_with_args(Prefix, _, _, _, _, _, _, DDef, _), 
    2852             call_with_args(DDef, term_expansion(Term, Expansion), Obj, Obj, Obj, Call) 
     2838        ;   call_with_args(DDef, term_expansion(Term, Expansion), Obj, Obj, Obj, Call) 
    28532839        ) 
    28542840    ), 
     
    28862872 
    28872873'$lgt_send_to_self_nv'(Obj, Pred, Sender) :- 
    2888     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _), 
     2874    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _, _, _), 
    28892875    (   call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) ->                    % lookup declaration 
    28902876        (   (Scope = p(_); Sender = SCtn) ->                                        % check scope 
     
    29332919 
    29342920'$lgt_send_to_object_nv'(Obj, Pred, Sender) :- 
    2935     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _), 
     2921    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _, _, _), 
    29362922    !, 
    29372923    (   call_with_args(Dcl, Pred, Scope, _, _, _, _, _, _) ->                       % lookup declaration 
     
    29922978 
    29932979'$lgt_send_to_object_ne_nv'(Obj, Pred, Sender) :- 
    2994     '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _), 
     2980    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _, _, _), 
    29952981    !, 
    29962982    (   call_with_args(Dcl, Pred, Scope, _, _, _, _, _, _) ->                   % lookup declaration 
     
    30443030 
    30453031'$lgt_send_to_super_nv'(Self, Pred, This, Sender) :- 
    3046     '$lgt_current_object_'(Self, _, Dcl, _, _, _, _, _), 
     3032    '$lgt_current_object_'(Self, _, Dcl, _, _, _, _, _, _, _, _, _, _), 
    30473033    call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _), 
    30483034    !, 
    30493035    (   (Scope = p(_); This = SCtn) ->                                                      % check scope 
    3050         '$lgt_current_object_'(This, _, _, _, Super, _, _, _), 
     3036        '$lgt_current_object_'(This, _, _, _, Super, _, _, _, _, _, _, _, _), 
    30513037        functor(Pred, PFunctor, PArity), functor(GPred, PFunctor, PArity),                  % construct predicate template 
    30523038        functor(This, TFunctor, TArity), functor(GThis, TFunctor, TArity),                  % construct "this" template 
     
    31363122'$lgt_metacall_in_object'(Pred, local, Sender, This, Self) :- 
    31373123    !, 
    3138     '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _), 
     3124    '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    31393125    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, Prefix, [], _), 
    31403126    '$lgt_tr_body'(Pred, Call, DCall, Ctx), 
     
    31463132'$lgt_metacall_in_object'(Pred, MetaVars, Sender, This, Self) :- 
    31473133    (   \+ '$lgt_member'(Pred, MetaVars) -> 
    3148         '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _), 
     3134        '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    31493135        '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, Prefix, [], _) 
    3150     ;   '$lgt_current_object_'(Sender, Prefix, _, _, _, _, _, _), 
     3136    ;   '$lgt_current_object_'(Sender, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
    31513137        '$lgt_ctx_ctx'(Ctx, _, Sender, Sender, Self, Prefix, [], _)  
    31523138    ), 
     
    31653151'$lgt_call_built_in'(Pred, Ctx) :- 
    31663152    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), 
    3167     '$lgt_current_object_'(This, _, _, Def, _, _, _, _), 
     3153    '$lgt_current_object_'(This, _, _, Def, _, _, _, _, _, _, _, _, _), 
    31683154    (   call_with_args(Def, Pred, Sender, This, Self, Call) -> 
    31693155        call(Call) 
     
    31793165'$lgt_call_within_context'(Obj, Goal, This) :- 
    31803166    (   '$lgt_compiler_flag'(context_switching_calls, allow) -> 
    3181         (   '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _) -> 
     3167        (   '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _, _, _, _, _, _) -> 
    31823168            '$lgt_ctx_ctx'(Ctx, _, Obj, Obj, Obj, Prefix, [], _), 
    31833169            '$lgt_tr_body'(Goal, TGoal, DGoal, Ctx), 
     
    32003186    (   call_with_args(Dcl, Pred, _, _, _, _, _, _, _) -> 
    32013187        (   '$lgt_imports_category_'(This, Ctg, _), 
    3202             '$lgt_current_category_'(Ctg, _, _, Def, _, _), 
     3188            '$lgt_current_category_'(Ctg, _, _, Def, _, _, _), 
    32033189            call_with_args(Def, Pred, Sender, This, Self, Call, _) -> 
    32043190            call(Call)