Changeset 4500 for trunk/compiler
- Timestamp:
- 10/12/08 08:36:44 (3 months ago)
- Files:
-
- 1 modified
-
trunk/compiler/logtalk.pl (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/compiler/logtalk.pl
r4498 r4500 2217 2217 2218 2218 '$lgt_asserta_rule_chk'(Obj, (Head:-Body), Sender, TestScope, DclScope) :- 2219 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _),2220 !, 2221 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, Meta, SCtn, DclScope),2222 ( Type == (dynamic) ->2219 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 2220 !, 2221 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, Meta, SCtn, DclScope), 2222 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2223 2223 ( (\+ \+ Scope = TestScope; Sender = SCtn) -> 2224 2224 '$lgt_assert_pred_def'(Obj, Def, DDef, Prefix, Head, GSender, GThis, GSelf, THead, _), … … 2251 2251 2252 2252 '$lgt_asserta_fact_chk'(Obj, Head, Sender, TestScope, DclScope) :- 2253 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _),2254 !, 2255 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, _, SCtn, DclScope),2256 ( Type == (dynamic) ->2253 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 2254 !, 2255 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, _, SCtn, DclScope), 2256 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2257 2257 ( (\+ \+ Scope = TestScope; Sender = SCtn) -> 2258 2258 '$lgt_assert_pred_def'(Obj, Def, DDef, Prefix, Head, GSender, GThis, GSelf, THead, Update), … … 2261 2261 '$lgt_ctx_dbg_ctx'(Ctx, DbgCtx), 2262 2262 asserta((THead :- '$lgt_dbg_fact'(Head, 0, DbgCtx))) 2263 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, DclScope, Sender, THead, DDef, Update),2263 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, DclScope, PredType, Sender, THead, DDef, Update), 2264 2264 asserta(THead) 2265 2265 ) … … 2319 2319 2320 2320 '$lgt_assertz_rule_chk'(Obj, (Head:-Body), Sender, TestScope, DclScope) :- 2321 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _),2322 !, 2323 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, Meta, SCtn, DclScope),2324 ( Type == (dynamic) ->2321 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 2322 !, 2323 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, Meta, SCtn, DclScope), 2324 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2325 2325 ( (\+ \+ Scope = TestScope; Sender = SCtn) -> 2326 2326 '$lgt_assert_pred_def'(Obj, Def, DDef, Prefix, Head, GSender, GThis, GSelf, THead, _), … … 2353 2353 2354 2354 '$lgt_assertz_fact_chk'(Obj, Head, Sender, TestScope, DclScope) :- 2355 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, _, _, _),2356 !, 2357 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, Type, _, SCtn, DclScope),2358 ( Type == (dynamic) ->2355 '$lgt_current_object_'(Obj, Prefix, Dcl, Def, _, _, _, DDcl, DDef, _, ObjType, _, _), 2356 !, 2357 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, _, SCtn, DclScope), 2358 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2359 2359 ( (\+ \+ Scope = TestScope; Sender = SCtn) -> 2360 2360 '$lgt_assert_pred_def'(Obj, Def, DDef, Prefix, Head, GSender, GThis, GSelf, THead, Update), … … 2363 2363 '$lgt_ctx_dbg_ctx'(Ctx, DbgCtx), 2364 2364 assertz((THead :- '$lgt_dbg_fact'(Head, 0, DbgCtx))) 2365 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, DclScope, Sender, THead, DDef, Update),2365 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, DclScope, PredType, Sender, THead, DDef, Update), 2366 2366 assertz(THead) 2367 2367 ) … … 2451 2451 2452 2452 '$lgt_clause_chk'(Obj, Head, Body, Sender, Scope) :- 2453 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _),2454 !, 2455 ( call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) ->2456 ( Type == (dynamic) ->2453 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 2454 !, 2455 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 2456 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2457 2457 ( (\+ \+ PScope = Scope; Sender = SCtn) -> 2458 2458 ( (call_with_args(DDef, Head, _, _, _, Call); call_with_args(Def, Head, _, _, _, Call)) -> … … 2524 2524 2525 2525 '$lgt_retract_var_body_chk'(Obj, (Head:-Body), Sender, Scope) :- 2526 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _),2527 !, 2528 ( call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) ->2529 ( Type == (dynamic) ->2526 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 2527 !, 2528 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 2529 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2530 2530 ( (\+ \+ PScope = Scope; Sender = SCtn) -> 2531 2531 ( call_with_args(DDef, Head, _, _, _, Call) -> … … 2575 2575 2576 2576 '$lgt_retract_rule_chk'(Obj, (Head:-Body), Sender, Scope) :- 2577 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _),2578 !, 2579 ( call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) ->2580 ( Type == (dynamic) ->2577 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 2578 !, 2579 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 2580 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2581 2581 ( (\+ \+ PScope = Scope; Sender = SCtn) -> 2582 2582 ( call_with_args(DDef, Head, _, _, _, Call) -> … … 2614 2614 2615 2615 '$lgt_retract_fact_chk'(Obj, Head, Sender, Scope) :- 2616 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _),2617 !, 2618 ( call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) ->2619 ( Type == (dynamic) ->2616 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 2617 !, 2618 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 2619 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2620 2620 ( (\+ \+ PScope = Scope; Sender = SCtn) -> 2621 2621 ( call_with_args(DDef, Head, _, _, _, Call) -> 2622 2622 ( '$lgt_debugging_'(Obj) -> 2623 2623 retract((Call :- '$lgt_dbg_fact'(_, _, _))) 2624 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, PScope, Sender, Call, DDef, true),2624 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, PScope, PredType, Sender, Call, DDef, true), 2625 2625 retract(Call) 2626 2626 ), … … 2629 2629 ( '$lgt_debugging_'(Obj) -> 2630 2630 retract((Call :- '$lgt_dbg_fact'(_, _, _))) 2631 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, PScope, Sender, Call),2631 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, PScope, PredType, Sender, Call), 2632 2632 retract(Call) 2633 2633 ) … … 2646 2646 ( '$lgt_debugging_'(Obj) -> 2647 2647 retract((Call :- '$lgt_dbg_fact'(_, _, _))) 2648 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, p, Sender, Call),2648 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, p, PredType, Sender, Call), 2649 2649 retract(Call) 2650 2650 ) … … 2679 2679 2680 2680 '$lgt_retractall_chk'(Obj, Head, Sender, Scope) :- 2681 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _, _, _),2682 !, 2683 ( call_with_args(Dcl, Head, PScope, Type, _, _, _, SCtn, _) ->2684 ( Type == (dynamic) ->2681 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, ObjType, _, _), 2682 !, 2683 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> 2684 ( (PredType == (dynamic); ObjType == (dynamic), Sender = SCtn) -> 2685 2685 ( (\+ \+ PScope = Scope; Sender = SCtn) -> 2686 2686 ( call_with_args(DDef, Head, _, _, _, Call) -> … … 2690 2690 ( '$lgt_debugging_'(Obj) -> 2691 2691 true 2692 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, PScope, Sender, Call)2692 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, PScope, PredType, Sender, Call) 2693 2693 ), 2694 2694 retractall(Call) … … 2709 2709 ( '$lgt_debugging_'(Obj) -> 2710 2710 true 2711 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, p, Sender, Call)2711 ; '$lgt_add_db_lookup_cache_entry'(Obj, Head, p, PredType, Sender, Call) 2712 2712 ), 2713 2713 retractall(Call) … … 2730 2730 2731 2731 2732 % '$lgt_add_db_lookup_cache_entry'(@object_identifier, @callable, @callable, @object_identifier, @callable)2732 % '$lgt_add_db_lookup_cache_entry'(@object_identifier, @callable, @callable, +atom, @object_identifier, @callable) 2733 2733 % 2734 2734 % adds a new database lookup cache entry (when an update goal is not needed) 2735 2735 2736 '$lgt_add_db_lookup_cache_entry'(Obj, Head, Scope, Sender, Call) :-2736 '$lgt_add_db_lookup_cache_entry'(Obj, Head, Scope, Type, Sender, Call) :- 2737 2737 functor(Obj, OFunctor, OArity), 2738 2738 functor(GObj, OFunctor, OArity), … … 2744 2744 GCall =.. [_| ExtArgs], 2745 2745 '$lgt_unify_args'(Args, ExtArgs), 2746 ( Scope = p(p(p)) ->2746 ( (Scope = p(p(p)), Type == (dynamic)) -> 2747 2747 asserta('$lgt_db_lookup_cache_'(GObj, GHead, _, GCall, true)) 2748 2748 ; functor(Sender, SFunctor, SArity), … … 2752 2752 2753 2753 2754 % '$lgt_add_db_lookup_cache_entry'(@object_identifier, @callable, @callable, @callable, @object_identifier, @callable, +atom, +atom)2754 % '$lgt_add_db_lookup_cache_entry'(@object_identifier, @callable, @callable, @callable, +atom, @object_identifier, @callable, +atom, +atom) 2755 2755 % 2756 2756 % adds a new database lookup cache entry 2757 2757 2758 '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, Scope, Sender, Call, DDef, NeedsUpdate) :-2758 '$lgt_add_db_lookup_cache_entry'(Obj, Head, SCtn, Scope, Type, Sender, Call, DDef, NeedsUpdate) :- 2759 2759 functor(Obj, OFunctor, OArity), 2760 2760 functor(GObj, OFunctor, OArity), … … 2770 2770 functor(UCall, CFunctor, CArity), 2771 2771 UClause =.. [DDef, UHead, _, _, _, _], 2772 ( Scope = p(p(p)) ->2772 ( (Scope = p(p(p)), Type == (dynamic)) -> 2773 2773 asserta('$lgt_db_lookup_cache_'(GObj, GHead, _, GCall, '$lgt_update_ddef_table_opt'(UHead, UCall, UClause))) 2774 2774 ; functor(Sender, SFunctor, SArity), … … 2776 2776 asserta('$lgt_db_lookup_cache_'(GObj, GHead, GSender, GCall, '$lgt_update_ddef_table_opt'(UHead, UCall, UClause))) 2777 2777 ) 2778 ; ( Scope = p(p(p)) ->2778 ; ( (Scope = p(p(p)), Type == (dynamic)) -> 2779 2779 asserta('$lgt_db_lookup_cache_'(GObj, GHead, _, GCall, true)) 2780 2780 ; functor(Sender, SFunctor, SArity),
