Changeset 4440 for trunk/compiler

Show
Ignore:
Timestamp:
08/21/08 04:06:57 (5 months ago)
Author:
pmoura
Message:

Corrected a bug in the compilation of source file op/3 directives whose third argument is a list of operator specifiers instead of a single operator specifier.

Applied several optimizations to the Logtalk compiler, mostly related to non-detected deterministic predicates due to calls to dynamic predicates or due to limitations in clause indexing by most Prolog compilers.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4434 r4440  
    335335 
    336336'$lgt_runtime_error_handler'(error(existence_error(procedure, TFunctor/8), _)) :- 
    337     once((atom_concat(ObjArity, '__idcl', TFunctor); atom_concat(ObjArity, '__dcl', TFunctor))), 
     337    once((  atom_concat(ObjArity, '__idcl', TFunctor) 
     338        ;   atom_concat(ObjArity, '__dcl', TFunctor) 
     339    )), 
    338340    atom_chars(ObjArity, ObjArityChars), 
    339341    '$lgt_append'(FunctorChars, ['_', ArityChar| ArityChars], ObjArityChars), 
     
    361363 
    362364'$lgt_runtime_error_handler'(error(existence_error(procedure, TFunctor1/TArity1), context(':'(_, TFunctor2/TArity2), _))) :- 
     365    !, 
    363366    '$lgt_runtime_error_handler'(error(existence_error(procedure, TFunctor1/TArity1), context(TFunctor2/TArity2, _))). 
    364367 
     
    402405 
    403406'$lgt_runtime_error_handler'(logtalk_debugger_aborted) :- 
     407    !, 
    404408    write('Debugging session aborted by user. Debugger still on.'), nl, 
    405409    abort. 
     
    14151419 
    14161420threaded_wait(Message) :- 
    1417     '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
     1421    '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _) -> 
    14181422    '$lgt_thread_get_notifications'(Message, Prefix). 
    14191423 
     
    14311435 
    14321436threaded_notify(Message) :- 
    1433     '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _), 
     1437    '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _, _, _) -> 
    14341438    '$lgt_thread_send_notifications'(Message, Prefix). 
    14351439 
     
    15191523 
    15201524'$lgt_inc_compile_warnings_counter' :- 
    1521     retract('$lgt_pp_comp_warnings_counter_'(Old)), 
     1525    retract('$lgt_pp_comp_warnings_counter_'(Old)) -> 
    15221526    New is Old + 1, 
    15231527    asserta('$lgt_pp_comp_warnings_counter_'(New)), 
     
    15291533 
    15301534'$lgt_inc_load_warnings_counter' :- 
    1531     retract('$lgt_pp_load_warnings_counter_'(Old)), 
     1535    retract('$lgt_pp_load_warnings_counter_'(Old)) -> 
    15321536    New is Old + 1, 
    15331537    asserta('$lgt_pp_load_warnings_counter_'(New)). 
     
    15351539 
    15361540'$lgt_report_warning_numbers'(Term) :- 
    1537     (   retract('$lgt_pp_warnings_top_argument_'(Term)) ->              % if top compilation/loading goal then 
    1538         retract('$lgt_pp_comp_warnings_counter_'(CCounter)),            % report compilation and loading warnings 
    1539         retract('$lgt_pp_load_warnings_counter_'(LCounter)), 
     1541    (   retract('$lgt_pp_warnings_top_argument_'(Term)),                % if top compilation/loading goal then 
     1542        retract('$lgt_pp_comp_warnings_counter_'(CCounter)),            % report compilation and loading warnings 
     1543        retract('$lgt_pp_load_warnings_counter_'(LCounter)) -> 
    15401544        (   '$lgt_compiler_flag'(report, on) -> 
    15411545            (   CCounter + LCounter =:= 0 ->                            % no warnings 
     
    18911895 
    18921896'$lgt_visible_predicate'(Obj, Pred, Sender, Scope) :- 
    1893     '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _, _, _, _, _, _), 
     1897    '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _, _, _, _, _, _) -> 
    18941898    call_with_args(Dcl, Pred, PScope, _, _, _, _, SCtn, _), 
    18951899    once((\+ \+ PScope = Scope; Sender = SCtn)). 
     
    27852789'$lgt_phrase'(Obj, (GREither; GROr), Input, Rest, Sender, Scope) :- 
    27862790    !, 
    2787     ('$lgt_phrase'(Obj, GREither, Input, Rest, Sender, Scope) 
    2788      ; 
    2789      '$lgt_phrase'(Obj, GROr, Input, Rest, Sender, Scope)). 
     2791    (   '$lgt_phrase'(Obj, GREither, Input, Rest, Sender, Scope) 
     2792    ;   '$lgt_phrase'(Obj, GROr, Input, Rest, Sender, Scope) 
     2793    ). 
    27902794 
    27912795'$lgt_phrase'(Obj, (GRIf -> GRThen), Input, Rest, Sender, Scope) :- 
     
    28902894 
    28912895 
    2892 % '$lgt_send_to_self'(+object, ?term, +object) 
     2896% '$lgt_send_to_self'(+object_identifier, ?term, +object_identifier) 
    28932897 
    28942898'$lgt_send_to_self'(Obj, Pred, Sender) :- 
     
    29012905 
    29022906 
    2903 % '$lgt_send_to_self_nv'(+object, +term, +object) 
     2907% '$lgt_send_to_self_nv'(+object_identifier, +term, +object_identifier) 
    29042908 
    29052909'$lgt_send_to_self_nv'(Obj, Pred, Sender) :- 
     
    29102914'$lgt_send_to_self_nv'(Obj, Pred, Sender) :- 
    29112915    '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _, _, _), 
     2916    !, 
    29122917    (   call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) ->                    % lookup declaration 
    29132918        (   (Scope = p(_); Sender = SCtn) ->                                        % check scope 
     
    29312936 
    29322937 
    2933 % '$lgt_send_to_object'(@object, ?term, +object) 
     2938% '$lgt_send_to_object'(@object_identifier, ?term, +object_identifier) 
    29342939 
    29352940'$lgt_send_to_object'(Obj, Pred, Sender) :- 
     
    29462951 
    29472952 
    2948 % '$lgt_send_to_object_nv'(+object, +term, +object) 
     2953% '$lgt_send_to_object_nv'(+object_identifier, +term, +object_identifier) 
    29492954 
    29502955'$lgt_send_to_object_nv'(Obj, Pred, Sender) :- 
     
    29922997 
    29932998 
    2994 % '$lgt_send_to_object_ne'(@object, ?term, +object) 
     2999% '$lgt_send_to_object_ne'(@object_identifier, ?term, +object_identifier) 
    29953000 
    29963001'$lgt_send_to_object_ne'(Obj, Pred, Sender) :- 
     
    30073012 
    30083013 
    3009 % '$lgt_send_to_object_ne_nv'(+object, +term, +object) 
     3014% '$lgt_send_to_object_ne_nv'(+object_identifier, +term, +object_identifier) 
    30103015 
    30113016'$lgt_send_to_object_ne_nv'(Obj, Pred, Sender) :- 
     
    30933098 
    30943099 
    3095 % '$lgt_metacall_in_object'(?term, ?term, ?term, +object, +object, +object) 
     3100% '$lgt_metacall_in_object'(?term, ?term, ?term, +object_identifier, +object_identifier, +object_identifier) 
    30963101% 
    30973102% performs a meta-call constructed from a closure and a list of addtional arguments 
     
    31513156 
    31523157 
    3153 % '$lgt_metacall_in_object'(?term, ?term, +object, +object, +object) 
     3158% '$lgt_metacall_in_object'(?term, ?term, +object_identifier, +object_identifier, +object_identifier) 
    31543159% 
    31553160% performs a meta-call at runtime 
     
    31713176    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, Prefix, [], _), 
    31723177    '$lgt_tr_body'(Pred, Call, DCall, Ctx), 
     3178    !, 
    31733179    (   '$lgt_dbg_debugging_', '$lgt_debugging_'(Sender) -> 
    31743180        call(DCall) 
     
    31843190    ), 
    31853191    '$lgt_tr_body'(Pred, Call, DCall, Ctx), 
     3192    !, 
    31863193    (   '$lgt_dbg_debugging_', '$lgt_debugging_'(Sender) -> 
    31873194        call(DCall) 
     
    31973204'$lgt_call_built_in'(Pred, Ctx) :- 
    31983205    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), 
    3199     '$lgt_current_object_'(This, _, _, Def, _, _, _, _, _, _, _, _, _), 
     3206    '$lgt_current_object_'(This, _, _, Def, _, _, _, _, _, _, _, _, _) -> 
    32003207    (   call_with_args(Def, Pred, Sender, This, Self, Call) -> 
    32013208        call(Call) 
     
    37453752 
    37463753'$lgt_dbg_leashing'(Port, Goal, DbgCtx, Code) :- 
    3747     '$lgt_dbg_leashing_'(Port), 
     3754    '$lgt_dbg_leashing_'(Port) -> 
    37483755    (   '$lgt_dbg_tracing_' -> 
    37493756        Code = ' ' 
     
    38223829            write(Code), '$lgt_dbg_write_port_name'(Port), writeq(Goal), write(' ? '), 
    38233830            catch('$lgt_read_single_char'(Option), _, fail), 
    3824         once('$lgt_dbg_valid_port_option'(Option, Port, Code)), 
     3831        '$lgt_dbg_valid_port_option'(Option, Port, Code), 
    38253832        '$lgt_dbg_do_port_option'(Option, Port, Goal, Error, DbgCtx, Action), 
    38263833        ! 
     
    38513858 
    38523859 
    3853 '$lgt_dbg_valid_port_option'(' ', _, _). 
    3854 '$lgt_dbg_valid_port_option'(c, _, _). 
    3855 '$lgt_dbg_valid_port_option'(l, _, _). 
    3856 '$lgt_dbg_valid_port_option'(s, _, _). 
    3857 '$lgt_dbg_valid_port_option'(i, call, _). 
    3858 '$lgt_dbg_valid_port_option'(i, redo, _). 
    3859 '$lgt_dbg_valid_port_option'(f, call, _). 
    3860 '$lgt_dbg_valid_port_option'(f, fact, _). 
    3861 '$lgt_dbg_valid_port_option'(f, rule, _). 
    3862 '$lgt_dbg_valid_port_option'(f, redo, _). 
    3863 '$lgt_dbg_valid_port_option'(n, _, _). 
    3864 '$lgt_dbg_valid_port_option'(!, _, _). 
    3865 '$lgt_dbg_valid_port_option'(@, _, _). 
    3866 '$lgt_dbg_valid_port_option'(b, _, _). 
    3867 '$lgt_dbg_valid_port_option'(a, _, _). 
    3868 '$lgt_dbg_valid_port_option'(q, _, _). 
    3869 '$lgt_dbg_valid_port_option'(d, _, _). 
    3870 '$lgt_dbg_valid_port_option'(x, _, _). 
    3871 '$lgt_dbg_valid_port_option'(h, _, _). 
    3872 '$lgt_dbg_valid_port_option'(?, _, _). 
    3873 '$lgt_dbg_valid_port_option'(=, _, _). 
    3874 '$lgt_dbg_valid_port_option'(*, _, ' '). 
    3875 '$lgt_dbg_valid_port_option'(+, _, ' '). 
    3876 '$lgt_dbg_valid_port_option'(-, _, +). 
    3877 '$lgt_dbg_valid_port_option'(e, exception, _). 
     3860'$lgt_dbg_valid_port_option'(' ', _, _) :- !. 
     3861'$lgt_dbg_valid_port_option'(c, _, _) :- !. 
     3862'$lgt_dbg_valid_port_option'(l, _, _) :- !. 
     3863'$lgt_dbg_valid_port_option'(s, _, _) :- !. 
     3864'$lgt_dbg_valid_port_option'(i, call, _) :- !. 
     3865'$lgt_dbg_valid_port_option'(i, redo, _) :- !. 
     3866'$lgt_dbg_valid_port_option'(f, call, _) :- !. 
     3867'$lgt_dbg_valid_port_option'(f, fact, _) :- !. 
     3868'$lgt_dbg_valid_port_option'(f, rule, _) :- !. 
     3869'$lgt_dbg_valid_port_option'(f, redo, _) :- !. 
     3870'$lgt_dbg_valid_port_option'(n, _, _) :- !. 
     3871'$lgt_dbg_valid_port_option'(!, _, _) :- !. 
     3872'$lgt_dbg_valid_port_option'(@, _, _) :- !. 
     3873'$lgt_dbg_valid_port_option'(b, _, _) :- !. 
     3874'$lgt_dbg_valid_port_option'(a, _, _) :- !. 
     3875'$lgt_dbg_valid_port_option'(q, _, _) :- !. 
     3876'$lgt_dbg_valid_port_option'(d, _, _) :- !. 
     3877'$lgt_dbg_valid_port_option'(x, _, _) :- !. 
     3878'$lgt_dbg_valid_port_option'(h, _, _) :- !. 
     3879'$lgt_dbg_valid_port_option'(?, _, _) :- !. 
     3880'$lgt_dbg_valid_port_option'(=, _, _) :- !. 
     3881'$lgt_dbg_valid_port_option'(*, _, ' ') :- !. 
     3882'$lgt_dbg_valid_port_option'(+, _, ' ') :- !. 
     3883'$lgt_dbg_valid_port_option'(-, _, +) :- !. 
     3884'$lgt_dbg_valid_port_option'(e, exception, _) :- !. 
    38783885 
    38793886 
     
    38943901'$lgt_dbg_do_port_option'(s, _, _, _, _, true). 
    38953902 
    3896 '$lgt_dbg_do_port_option'(i, call, _, _, _, ignore). 
    3897 '$lgt_dbg_do_port_option'(i, redo, _, _, _, ignore). 
     3903'$lgt_dbg_do_port_option'(i, _, _, _, _, ignore). 
    38983904 
    38993905'$lgt_dbg_do_port_option'(f, _, _, _, _, fail). 
     
    50205026 
    50215027'$lgt_pp_entity'(protocol, Entity, Prefix, Dcl, Mode) :- 
    5022     '$lgt_pp_protocol_'(Entity, Prefix, Dcl, _, Mode). 
     5028    '$lgt_pp_protocol_'(Entity, Prefix, Dcl, _, Mode), 
     5029    !. 
    50235030 
    50245031 
     
    50375044'$lgt_pp_rclause'('$lgt_current_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Mode, Synchronized, Threaded)) :- 
    50385045    '$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, Mode), 
     5046    !, 
    50395047    (   '$lgt_pp_synchronized_' -> 
    50405048        Synchronized = yes 
     
    50445052        Threaded = yes 
    50455053    ;   Threaded = no 
    5046     ), 
    5047     !. 
     5054    ). 
    50485055 
    50495056'$lgt_pp_rclause'('$lgt_current_protocol_'(Ptc, Prefix, Dcl, Rnm, Mode)) :- 
     
    50535060'$lgt_pp_rclause'('$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Mode, Synchronized)) :- 
    50545061    '$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, Mode), 
     5062    !, 
    50555063    (   '$lgt_pp_synchronized_' -> 
    50565064        Synchronized = yes 
     
    52075215% 
    52085216% translates file-level directives, i.e. directives that are not encapsulated in a Logtalk entity 
    5209 % error-checking is delegated to the back-end Prolog compiler 
     5217% error-checking is delegated in most cases to the back-end Prolog compiler 
    52105218 
    52115219'$lgt_tr_file_directive'(encoding(_)) :-        % the encoding/1 directive is already processed  
     
    52285236    op(Pr, Spec, Ops), 
    52295237    assertz('$lgt_pp_directive_'(op(Pr, Spec, Ops))), 
    5230     assertz('$lgt_pp_file_op_'(op(Pr, Spec, Ops))). 
     5238    (   atom(Ops) -> 
     5239        assertz('$lgt_pp_file_op_'(Pr, Spec, Ops)) 
     5240    ;   '$lgt_is_proper_list'(Ops) -> 
     5241        forall('$lgt_member'(Op, Ops), assertz('$lgt_pp_file_op_'(Pr, Spec, Op))) 
     5242    ). 
    52315243 
    52325244'$lgt_tr_file_directive'(set_prolog_flag(Flag, Value)) :- 
     
    52985310 
    52995311'$lgt_tr_directive'(end_protocol, [], _, Output) :- 
    5300     '$lgt_pp_protocol_'(Ptc, _, _, _, _) -> 
     5312    (   '$lgt_pp_protocol_'(Ptc, _, _, _, _) -> 
    53015313        '$lgt_tr_entity'(protocol, Ptc, Output), 
    53025314        '$lgt_report_compiled_entity'(protocol, Ptc) 
    5303         ; 
    5304         throw(closing_directive_mismatch). 
     5315    ;   throw(closing_directive_mismatch) 
     5316    ). 
    53055317 
    53065318 
     
    54705482    throw(instantiation_error). 
    54715483 
    5472 '$lgt_tr_directive'(uses, [Module, _], _, _) :- 
     5484'$lgt_tr_directive'(use_module, [Module, _], _, _) :- 
    54735485    \+ callable(Module), 
    54745486    throw(type_error(module_identifier, Module)). 
     
    56325644 
    56335645'$lgt_tr_alias_directive'(Entity, Functor1//Arity, Functor2//Arity) :- 
     5646    !, 
    56345647    Arity2 is Arity + 2, 
    56355648    '$lgt_tr_alias_directive'(Entity, Functor1/Arity2, Functor2/Arity2). 
     
    56675680'$lgt_gen_pred_mutex'(Mutex) :- 
    56685681    '$lgt_pp_entity'(_, _, Prefix, _, _), 
    5669     retract('$lgt_pp_pred_mutex_count_'(Old)), 
     5682    retract('$lgt_pp_pred_mutex_count_'(Old)) -> 
    56705683    New is Old + 1, 
    56715684    asserta('$lgt_pp_pred_mutex_count_'(New)), 
     
    71257138 
    71267139'$lgt_tr_body'(':'(Alias), TPred, '$lgt_dbg_goal'(':'(Alias), TPred, DbgCtx), Ctx) :- 
     7140    !, 
    71277141    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), 
    71287142    '$lgt_ctx_dbg_ctx'(Ctx, DbgCtx), 
     
    71347148        '$lgt_ctg_static_binding_cache'(Ctg, Pred, Sender, This, Self, TPred) -> 
    71357149        true 
    7136     ;   Pred = Alias, 
    7137         '$lgt_pp_object_'(_, _, Dcl, _, _, IDcl, _, _, _, Rnm, _), 
     7150    ;   % must resort to dynamic binding 
     7151        Pred = Alias, 
     7152        '$lgt_pp_object_'(_, _, Dcl, _, _, IDcl, _, _, _, Rnm, _) -> 
    71387153        (   \+ '$lgt_pp_instantiated_class_'(_, _, _, _, _, _, _, _, _, _), 
    71397154            \+ '$lgt_pp_specialized_class_'(_, _, _, _, _, _, _, _, _, _) -> 
     
    77087723 
    77097724'$lgt_optimizable_local_db_call'(Pred, TPred) :- 
    7710     '$lgt_pp_object_'(_, Prefix, _, _, _, _, _, _, _, _, _),    % exclude categories 
     7725    '$lgt_pp_object_'(_, Prefix, _, _, _, _, _, _, _, _, _) ->  % exclude categories 
    77117726    '$lgt_compiler_flag'(debug, off),                           % not debugging 
    77127727    (   Pred = (Head :- Body) ->                                % only facts allowed 
     
    77167731    callable(Head), 
    77177732    functor(Head, Functor, Arity), 
    7718     '$lgt_pp_dynamic_'(Functor, Arity),             % a dynamic directive must be present 
     7733    once('$lgt_pp_dynamic_'(Functor, Arity)),       % a dynamic directive must be present 
    77197734    once((  '$lgt_pp_public_'(Functor, Arity)       % a scope directive must be present 
    77207735        ;   '$lgt_pp_protected_'(Functor, Arity) 
     
    83148329 
    83158330'$lgt_tr_super_call'(Pred, TPred, Ctx) :-   % translation performed at runtime 
    8316     '$lgt_pp_object_'(_, _, _, _, Super, _, _, _, _, _, _), 
    8317     !, 
    83188331    '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), 
    8319     TPred = '$lgt_obj_super_call'(Super, Pred, Sender, This, Self). 
    8320  
    8321 '$lgt_tr_super_call'(Pred, TPred, Ctx) :-   % translation performed at runtime 
    8322     '$lgt_pp_category_'(Ctg, _, _, Def, _, _), 
    8323     '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), 
    8324     TPred = '$lgt_ctg_super_call'(Ctg, Def, Pred, Sender, This, Self). 
     8332    (   '$lgt_pp_object_'(_, _, _, _, Super, _, _, _, _, _, _) -> 
     8333        TPred = '$lgt_obj_super_call'(Super, Pred, Sender, This, Self) 
     8334    ;   '$lgt_pp_category_'(Ctg, _, _, Def, _, _) -> 
     8335        TPred = '$lgt_ctg_super_call'(Ctg, Def, Pred, Sender, This, Self) 
     8336    ). 
    83258337 
    83268338 
     
    86988710 
    86998711'$lgt_update_entity_comp_mode' :- 
    8700     retract('$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, _)), 
    8701     assertz('$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, (dynamic))), 
    8702     !. 
    8703  
    8704 '$lgt_update_entity_comp_mode' :- 
    8705     retract('$lgt_pp_protocol_'(Ptc, Prefix, Dcl, Rnm, _)), 
    8706     assertz('$lgt_pp_protocol_'(Ptc, Prefix, Dcl, Rnm, (dynamic))), 
    8707     !. 
    8708  
    8709 '$lgt_update_entity_comp_mode' :- 
    8710     retract('$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, _)), 
    8711     assertz('$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, (dynamic))). 
     8712    (   retract('$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, _)) -> 
     8713        assertz('$lgt_pp_object_'(Obj, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, (dynamic))) 
     8714    ;   retract('$lgt_pp_protocol_'(Ptc, Prefix, Dcl, Rnm, _)) -> 
     8715        assertz('$lgt_pp_protocol_'(Ptc, Prefix, Dcl, Rnm, (dynamic))) 
     8716    ;   retract('$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, _)) -> 
     8717        assertz('$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, (dynamic))) 
     8718    ). 
    87128719 
    87138720 
     
    89228929 
    89238930'$lgt_tr_complements_category'(Objs, Ctg) :- 
    8924     '$lgt_pp_category_'(Ctg, _, Dcl, Def, _, _), 
     8931    '$lgt_pp_category_'(Ctg, _, Dcl, Def, _, _) -> 
    89258932    '$lgt_tr_complements_category'(Objs, Ctg, Dcl, Def). 
    89268933 
     
    91079114    HeadTemplateDef =.. [TFunctor| HeadTemplateArgsDef], 
    91089115    HeadDef =.. [TFunctor| HeadArgsDef], 
    9109     (   '$lgt_pp_object_'(_, _, _, Def, _, _, _, _, _, _, _) -> 
    9110         true 
    9111     ;   '$lgt_pp_category_'(_, _, _, Def, _, _) 
    9112     ), 
     9116    once((  '$lgt_pp_object_'(_, _, _, Def, _, _, _, _, _, _, _) 
     9117        ;   '$lgt_pp_category_'(_, _, _, Def, _, _) 
     9118    )), 
    91139119    Clause =.. [Def, HeadTemplate, Sender2, This2, Self2, HeadTemplateDef], 
    91149120    (   '$lgt_pp_def_'(Clause) -> 
     
    91519157    HeadTemplateDef =.. [TFunctor| HeadTemplateArgsDef], 
    91529158    HeadDef =.. [TFunctor| HeadArgsDef], 
    9153     '$lgt_pp_object_'(_, _, _, _, _, _, _, _, DDef, _, _), 
     9159    once('$lgt_pp_object_'(_, _, _, _, _, _, _, _, DDef, _, _)), 
    91549160    Clause =.. [DDef, HeadTemplate, Sender2, This2, Self2, HeadTemplateDef], 
    91559161    (   '$lgt_pp_ddef_'(Clause) -> 
     
    92799285 
    92809286'$lgt_gen_dynamic_object_dynamic_directives' :- 
    9281     '$lgt_pp_object_'(_, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, _), 
     9287    '$lgt_pp_object_'(_, Prefix, Dcl, Def, Super, IDcl, IDef, DDcl, DDef, Rnm, _) -> 
    92829288    assertz('$lgt_pp_directive_'(dynamic(Prefix/8))), 
    92839289    assertz('$lgt_pp_directive_'(dynamic(Dcl/6))), 
     
    94379443 
    94389444'$lgt_gen_protocol_linking_clauses'(true) :- 
    9439     '$lgt_pp_protocol_'(Ptc, _, PDcl, _, _), 
     9445    '$lgt_pp_protocol_'(Ptc, _, PDcl, _, _) -> 
    94409446    Head =.. [PDcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Ptc], 
    94419447    Body =.. [PDcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized], 
     
    94799485        true 
    94809486    ;   % empty, standalone protocol  
    9481         '$lgt_pp_protocol_'(_, _, Dcl, _, _), 
     9487        '$lgt_pp_protocol_'(_, _, Dcl, _, _) -> 
    94829488        Head =.. [Dcl, _, _, _, _, _, _, _], 
    94839489        assertz('$lgt_pp_dcl_'((Head:-fail))) 
     
    95029508 
    95039509'$lgt_gen_category_linking_dcl_clauses'(true) :- 
    9504     '$lgt_pp_category_'(Ctg, _, CDcl, _, _, _), 
     9510    '$lgt_pp_category_'(Ctg, _, CDcl, _, _, _) -> 
    95059511    Head =.. [CDcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Ctg], 
    95069512    Body =.. [CDcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized], 
     
    95689574        true 
    95699575    ;   % standalone category with no local predicate declarations 
    9570         '$lgt_pp_category_'(_, _, Dcl, _, _, _), 
     9576        '$lgt_pp_category_'(_, _, Dcl, _, _, _) -> 
    95719577        Head =.. [Dcl, _, _, _, _, _, _, _], 
    95729578        assertz('$lgt_pp_dcl_'((Head:-fail))) 
     
    95829588 
    95839589'$lgt_gen_category_linking_def_clauses' :- 
    9584     '$lgt_pp_category_'(Ctg, _, _, Def, _, _), 
     9590    '$lgt_pp_category_'(Ctg, _, _, Def, _, _) -> 
    95859591    Head =.. [Def, Pred, Sender, This, Self, Call, Ctg], 
    95869592    (   '$lgt_pp_fdef_'(_) -> 
     
    96189624 
    96199625'$lgt_gen_object_catchall_dcl_clauses'(false) :- 
    9620     '$lgt_pp_object_'(_, _, Dcl, _, _, _, _, _, _, _, _),   % generate a catchall clause for 
     9626    '$lgt_pp_object_'(_, _, Dcl, _, _, _, _, _, _, _, _) -> % generate a catchall clause for 
    96219627    Head =.. [Dcl, _, _, _, _, _, _],                       % objects that do not contain 
    96229628    assertz('$lgt_pp_dcl_'((Head:-fail))).                  % predicate declarations 
     
    96269632 
    96279633'$lgt_gen_object_catchall_def_clauses'(false) :- 
    9628     '$lgt_pp_object_'(_, _, _, Def, _, _, _, _, _, _, _),   % generate a catchall clause 
     9634    '$lgt_pp_object_'(_, _, _, Def, _, _, _, _, _, _, _) -> % generate a catchall clause 
    96299635    Head =.. [Def, _, _, _, _, _],                          % for objects that do not  
    96309636    assertz('$lgt_pp_fdef_'((Head:-fail))).                 % contain predicate definitions 
     
    96509656 
    96519657'$lgt_gen_prototype_linking_dcl_clauses'(true) :- 
    9652     '$lgt_pp_object_'(Obj, _, Dcl, _, _, _, _, DDcl, _, _, _), 
     9658    '$lgt_pp_object_'(Obj, _, Dcl, _, _, _, _, DDcl, _, _, _) -> 
    96539659    HeadDcl =.. [Dcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Obj, Obj], 
    96549660    BodyDcl =.. [Dcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized], 
     
    96599665 
    96609666'$lgt_gen_prototype_linking_dcl_clauses'(false) :- 
    9661     '$lgt_pp_object_'(Obj, _, Dcl, _, _, _, _, DDcl, _, _, _), 
     9667    '$lgt_pp_object_'(Obj, _, Dcl, _, _, _, _, DDcl, _, _, _) -> 
    96629668    HeadDDcl =.. [Dcl, Pred, Scope, (dynamic), no, no, no, Obj, Obj], 
    96639669    BodyDDcl =.. [DDcl, Pred, Scope], 
     
    97119717 
    97129718'$lgt_gen_prototype_imports_dcl_clauses' :- 
    9713     '$lgt_pp_object_'(Obj, _, ODcl, _, _, _, _, _, _, _, _), 
     9719    '$lgt_pp_object_'(Obj, _, ODcl, _, _, _, _, _, _, _, _) -> 
    97149720    Head =.. [ODcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Obj, Ctn], 
    97159721    Lookup = '$lgt_complemented_object'(Obj, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Ctn), 
     
    97569762 
    97579763'$lgt_gen_prototype_linking_def_clauses'(true) :- 
    9758     '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _), 
     9764    '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _) -> 
    97599765    Head =.. [Def, Pred, Sender, This, Self, Call, Obj], 
    97609766    BodyDef =.. [Def, Pred, Sender, This, Self, Call], 
     
    97649770 
    97659771'$lgt_gen_prototype_linking_def_clauses'(false) :- 
    9766     '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _), 
     9772    '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _) -> 
    97679773    Head =.. [Def, Pred, Sender, This, Self, Call, Obj], 
    97689774    BodyDDef =.. [DDef, Pred, Sender, This, Self, Call], 
     
    97869792 
    97879793'$lgt_gen_prototype_imports_def_clauses' :- 
    9788     '$lgt_pp_object_'(Obj, _, _, ODef, _, _, _, _, _, _, _), 
     9794    '$lgt_pp_object_'(Obj, _, _, ODef, _, _, _, _, _, _, _) -> 
    97899795    Head =.. [ODef, Pred, Sender, Obj, Self, Call, Ctn], 
    97909796    Lookup = '$lgt_complemented_object'(Pred, Sender, Obj, Self, Call, Ctn), 
     
    98569862 
    98579863'$lgt_gen_ic_hierarchy_dcl_clauses' :- 
     9864    '$lgt_pp_object_'(_, _, ODcl, _, _, _, _, _, _, _, _), 
    98589865    \+ '$lgt_pp_instantiated_class_'(_, _, _, _, _, _, _, _, _, _), 
    98599866    !, 
    9860     '$lgt_pp_object_'(_, _, ODcl, _, _, _, _, _, _, _, _), 
    98619867    Head =.. [ODcl, _, _, _, _, _, _, _, _], 
    98629868    assertz('$lgt_pp_dcl_'((Head:-fail))). 
     
    98989904 
    98999905'$lgt_gen_ic_linking_idcl_clauses'(true) :- 
    9900     '$lgt_pp_object_'(Obj, _, Dcl, _, _, IDcl, _, DDcl, _, _, _), 
     9906    '$lgt_pp_object_'(Obj, _, Dcl, _, _, IDcl, _, DDcl, _, _, _) -> 
    99019907    HeadDcl =.. [IDcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Obj, Obj], 
    99029908    BodyDcl =.. [Dcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized], 
     
    99079913 
    99089914'$lgt_gen_ic_linking_idcl_clauses'(false) :- 
    9909     '$lgt_pp_object_'(Obj, _, _, _, _, IDcl, _, DDcl, _, _, _), 
     9915    '$lgt_pp_object_'(Obj, _, _, _, _, IDcl, _, DDcl, _, _, _) -> 
    99109916    HeadDDcl =.. [IDcl, Pred, Scope, (dynamic), no, no, no, Obj, Obj], 
    99119917    BodyDDcl =.. [DDcl, Pred, Scope], 
     
    99599965 
    99609966'$lgt_gen_ic_category_idcl_clauses' :- 
    9961     '$lgt_pp_object_'(Obj, _, _, _, _, OIDcl, _, _, _, _, _), 
     9967    '$lgt_pp_object_'(Obj, _, _, _, _, OIDcl, _, _, _, _, _) -> 
    99629968    Head =.. [OIDcl, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Obj, Ctn], 
    99639969    Lookup = '$lgt_complemented_object'(Obj, Pred, Scope, Compilation, Meta, NonTerminal, Synchronized, Ctn), 
     
    1000510011 
    1000610012'$lgt_gen_ic_linking_def_clauses'(true) :- 
    10007     '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _), 
     10013    '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _) -> 
    1000810014    Head =.. [Def, Pred, Sender, This, Self, Call, Obj], 
    1000910015    BodyDef =.. [Def, Pred, Sender, This, Self, Call], 
     
    1001310019 
    1001410020'$lgt_gen_ic_linking_def_clauses'(false) :- 
    10015     '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _), 
     10021    '$lgt_pp_object_'(Obj, _, _, Def, _, _, _, _, DDef, _, _) -> 
    1001610022    Head =.. [Def, Pred, Sender, This, Self, Call, Obj], 
    1001710023    BodyDDef =.. [DDef, Pred, Sender, This, Self, Call], 
     
    1003510041 
    1003610042'$lgt_gen_ic_imports_def_clauses' :- 
    10037     '$lgt_pp_object_'(Obj, _, _, ODef, _, _, _, _, _, _, _), 
     10043    '$lgt_pp_object_'(Obj, _, _, ODef, _, _, _, _, _, _, _) -> 
    1003810044    Head =.. [ODef, Pred, Sender, Obj, Self, Call, Ctn], 
    1003910045    Lookup = '$lgt_complemented_object'(Pred, Sender, Obj, Self, Call, Ctn),