Changeset 4511 for trunk/compiler
- Timestamp:
- 10/17/08 08:30:34 (3 months ago)
- Files:
-
- 1 modified
-
trunk/compiler/logtalk.pl (modified) (77 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/compiler/logtalk.pl
r4507 r4511 65 65 66 66 67 % tables of loaded entities and respective relationships67 % tables of loaded entities, entity properties, and entity relations 68 68 69 69 :- multifile('$lgt_current_protocol_'/5). % '$lgt_current_protocol_'(Ptc, Prefix, Dcl, Rnm, Type) 70 70 :- dynamic('$lgt_current_protocol_'/5). 71 71 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 79 81 :- multifile('$lgt_implements_protocol_'/3). % '$lgt_implements_protocol_'(ObjOrCtg, Ptc, Scope) 80 82 :- dynamic('$lgt_implements_protocol_'/3). … … 348 350 ; '$lgt_extends_object_'(_, Obj, _) 349 351 ), 350 \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _ , _, _),352 \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 351 353 throw(error(existence_error(object, Obj), _, _)). 352 354 … … 357 359 ; '$lgt_extends_protocol_'(_, CtgOrPtc, _), \+ '$lgt_current_protocol_'(CtgOrPtc, _, _, _, _) -> 358 360 throw(error(existence_error(protocol, CtgOrPtc), _, _)) 359 ; '$lgt_imports_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _ , _) ->361 ; '$lgt_imports_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _) -> 360 362 throw(error(existence_error(category, CtgOrPtc), _, _)) 361 ; '$lgt_extends_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _ , _) ->363 ; '$lgt_extends_category_'(_, CtgOrPtc, _), \+ '$lgt_current_category_'(CtgOrPtc, _, _, _, _, _) -> 362 364 throw(error(existence_error(category, CtgOrPtc), _, _)) 363 365 ). … … 432 434 433 435 current_object(Obj) :- 434 '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _ , _, _).436 '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _). 435 437 436 438 … … 456 458 457 459 current_category(Ctg) :- 458 '$lgt_current_category_'(Ctg, _, _, _, _, _ , _).460 '$lgt_current_category_'(Ctg, _, _, _, _, _). 459 461 460 462 … … 477 479 478 480 object_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 483 object_property(Obj, Prop) :- 484 '$lgt_entity_property_'(Obj, Prop). 486 485 487 486 … … 500 499 501 500 category_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 503 category_property(Ctg, Prop) :- 504 '$lgt_entity_property_'(Ctg, Prop). 506 505 507 506 … … 522 521 '$lgt_current_protocol_'(Ptc, _, _, _, Prop). 523 522 523 protocol_property(Ptc, Prop) :- 524 '$lgt_entity_property_'(Ptc, Prop). 525 524 526 525 527 … … 537 539 create_object(Obj, Rels, Dirs, Clauses) :- 538 540 nonvar(Obj), 539 '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _ , _, _),541 '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 540 542 throw(error(permission_error(modify, object, Obj), create_object(Obj, Rels, Dirs, Clauses))). 541 543 542 544 create_object(Obj, Rels, Dirs, Clauses) :- 543 545 nonvar(Obj), 544 '$lgt_current_category_'(Obj, _, _, _, _, _ , _),546 '$lgt_current_category_'(Obj, _, _, _, _, _), 545 547 throw(error(permission_error(modify, category, Obj), create_object(Obj, Rels, Dirs, Clauses))). 546 548 … … 595 597 create_category(Ctg, Rels, Dirs, Clauses) :- 596 598 nonvar(Ctg), 597 '$lgt_current_category_'(Ctg, _, _, _, _, _ , _),599 '$lgt_current_category_'(Ctg, _, _, _, _, _), 598 600 throw(error(permission_error(modify, category, Ctg), create_category(Ctg, Rels, Dirs, Clauses))). 599 601 600 602 create_category(Ctg, Rels, Dirs, Clauses) :- 601 603 nonvar(Ctg), 602 '$lgt_current_object_'(Ctg, _, _, _, _, _, _, _, _, _, _ , _, _),604 '$lgt_current_object_'(Ctg, _, _, _, _, _, _, _, _, _, _), 603 605 throw(error(permission_error(modify, object, Ctg), create_category(Ctg, Rels, Dirs, Clauses))). 604 606 … … 657 659 create_protocol(Ptc, Rels, Dirs) :- 658 660 nonvar(Ptc), 659 '$lgt_current_object_'(Ptc, _, _, _, _, _, _, _, _, _, _ , _, _),661 '$lgt_current_object_'(Ptc, _, _, _, _, _, _, _, _, _, _), 660 662 throw(error(permission_error(modify, object, Ptc), create_protocol(Ptc, Rels, Dirs))). 661 663 662 664 create_protocol(Ptc, Rels, Dirs) :- 663 665 nonvar(Ptc), 664 '$lgt_current_category_'(Ptc, _, _, _, _, _ , _),666 '$lgt_current_category_'(Ptc, _, _, _, _, _), 665 667 throw(error(permission_error(modify, category, Ptc), create_protocol(Ptc, Rels, Dirs))). 666 668 … … 697 699 atom_codes(Id, [Base| Codes]), 698 700 \+ '$lgt_current_protocol_'(Id, _, _, _, _), 699 \+ '$lgt_current_object_'(Id, _, _, _, _, _, _, _, _, _, _ , _, _),700 \+ '$lgt_current_category_'(Id, _, _, _, _, _ , _),701 \+ '$lgt_current_object_'(Id, _, _, _, _, _, _, _, _, _, _), 702 \+ '$lgt_current_category_'(Id, _, _, _, _, _), 701 703 !. 702 704 … … 720 722 721 723 abolish_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) -> 723 725 ( Type == (dynamic) -> 724 726 '$lgt_abolish_entity_predicates'(Def), … … 735 737 abolish(Rnm/3), 736 738 abolish(Prefix/8), 737 retractall('$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _, _, _)), 739 retractall('$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _)), 740 retractall('$lgt_entity_property_'(Obj, _)), 738 741 retractall('$lgt_extends_object_'(Obj, _, _)), 739 742 retractall('$lgt_instantiates_class_'(Obj, _, _)), … … 761 764 762 765 abolish_category(Ctg) :- 763 ( '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type , _) ->766 ( '$lgt_current_category_'(Ctg, Prefix, Dcl, Def, Rnm, Type) -> 764 767 ( Type == (dynamic) -> 765 768 '$lgt_abolish_entity_predicates'(Def), … … 769 772 abolish(Rnm/3), 770 773 abolish(Prefix/3), 771 retractall('$lgt_current_category_'(Ctg, _, _, _, _, _, _)), 774 retractall('$lgt_current_category_'(Ctg, _, _, _, _, _)), 775 retractall('$lgt_entity_property_'(Ctg, _)), 772 776 retractall('$lgt_extends_category_'(Ctg, _, _)), 773 777 retractall('$lgt_implements_protocol_'(Ctg, _, _)), … … 798 802 abolish(Prefix/2), 799 803 retractall('$lgt_current_protocol_'(Ptc, _, _, _, _)), 804 retractall('$lgt_entity_property_'(Ptc, _)), 800 805 retractall('$lgt_extends_protocol_'(Ptc, _, _)), 801 806 '$lgt_clean_lookup_caches' … … 1145 1150 1146 1151 define_events(Event, Obj, Msg, Sender, Monitor) :- 1147 \+ '$lgt_current_object_'(Monitor, _, _, _, _, _, _, _, _, _, _ , _, _),1152 \+ '$lgt_current_object_'(Monitor, _, _, _, _, _, _, _, _, _, _), 1148 1153 throw(error(existence_error(object, Monitor), define_events(Event, Obj, Msg, Sender, Monitor))). 1149 1154 … … 1151 1156 var(Event), 1152 1157 !, 1153 '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _ , _, _),1158 '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _), 1154 1159 ( call_with_args(Def, before(Obj, Msg, Sender), Monitor, Monitor, Monitor, BCall, _) -> 1155 1160 ( call_with_args(Def, after(Obj, Msg, Sender), Monitor, Monitor, Monitor, ACall, _) -> … … 1162 1167 1163 1168 define_events(before, Obj, Msg, Sender, Monitor) :- 1164 '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _ , _, _),1169 '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _), 1165 1170 call_with_args(Def, before(Obj, Msg, Sender), Monitor, Monitor, Monitor, Call, _) -> 1166 1171 retractall('$lgt_before_'(Obj, Msg, Sender, Monitor, _)), … … 1168 1173 1169 1174 define_events(after, Obj, Msg, Sender, Monitor) :- 1170 '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _ , _, _),1175 '$lgt_current_object_'(Monitor, _, _, Def, _, _, _, _, _, _, _), 1171 1176 call_with_args(Def, after(Obj, Msg, Sender), Monitor, Monitor, Monitor, Call, _) -> 1172 1177 retractall('$lgt_after_'(Obj, Msg, Sender, Monitor, _)), … … 1464 1469 1465 1470 threaded_wait(Message) :- 1466 '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _ , _, _) ->1471 '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _) -> 1467 1472 '$lgt_thread_get_notifications'(Message, Prefix). 1468 1473 … … 1480 1485 1481 1486 threaded_notify(Message) :- 1482 '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _ , _, _) ->1487 '$lgt_current_object_'(user, Prefix, _, _, _, _, _, _, _, _, _) -> 1483 1488 '$lgt_thread_send_notifications'(Message, Prefix). 1484 1489 … … 1891 1896 1892 1897 '$lgt_obj_exists'(Obj, Pred, Sender) :- 1893 ( '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _ , _, _) ->1898 ( '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _) -> 1894 1899 true 1895 1900 ; throw(error(existence_error(object, Obj), Obj::Pred, Sender)) … … 1916 1921 1917 1922 '$lgt_current_predicate'(Obj, Functor/Arity, Sender, _) :- 1918 \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _ , _, _),1923 \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 1919 1924 throw(error(existence_error(object, Obj), Obj::current_predicate(Functor/Arity), Sender)). 1920 1925 … … 1940 1945 1941 1946 '$lgt_visible_predicate'(Obj, Pred, Sender, Scope) :- 1942 '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _, _, _, _ , _, _) ->1947 '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, _, _, _, _) -> 1943 1948 call_with_args(Dcl, Pred, PScope, _, _, _, _, SCtn, _), 1944 1949 once((\+ \+ PScope = Scope; Sender = SCtn)). … … 1962 1967 1963 1968 '$lgt_predicate_property'(Obj, Pred, Prop, Sender, _) :- 1964 \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _ , _, _),1969 \+ '$lgt_current_object_'(Obj, _, _, _, _, _, _, _, _, _, _), 1965 1970 throw(error(existence_error(object, Obj), Obj::predicate_property(Pred, Prop), Sender)). 1966 1971 1967 1972 '$lgt_predicate_property'(Obj, Pred, Prop, Sender, Scope) :- 1968 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, Rnm, _ , _, _),1973 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, Rnm, _), 1969 1974 call_with_args(Dcl, Pred, PScope, Type, Meta, NonTerminal, Synchronized, SCtn, TCtn), 1970 1975 !, … … 1981 1986 ; Synchronized \== no, 1982 1987 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, _, _, _) 1985 1990 ; '$lgt_current_protocol_'(TCtn, _, TCtnDcl, _, _) 1986 1991 )), … … 2079 2084 '$lgt_alias_pred'(Ctg1, _, Alias, Pred, _) :- 2080 2085 '$lgt_extends_category_'(Ctg1, Ctg2, _), 2081 '$lgt_current_category_'(Ctg2, _, _, _, Rnm, _ , _),2086 '$lgt_current_category_'(Ctg2, _, _, _, Rnm, _), 2082 2087 '$lgt_alias_pred'(Ctg2, Rnm, Alias, Pred, _). 2083 2088 2084 2089 '$lgt_alias_pred'(Obj, _, Alias, Pred, _) :- 2085 2090 '$lgt_imports_category_'(Obj, Ctg, _), 2086 '$lgt_current_category_'(Ctg, _, _, _, Rnm, _ , _),2091 '$lgt_current_category_'(Ctg, _, _, _, Rnm, _), 2087 2092 '$lgt_alias_pred'(Ctg, Rnm, Alias, Pred, _). 2088 2093 2089 2094 '$lgt_alias_pred'(Obj, _, Alias, Pred, prototype) :- 2090 2095 '$lgt_extends_object_'(Obj, Parent, _), 2091 '$lgt_current_object_'(Parent, _, _, _, _, _, _, _, _, Rnm, _ , _, _),2096 '$lgt_current_object_'(Parent, _, _, _, _, _, _, _, _, Rnm, _), 2092 2097 '$lgt_alias_pred'(Parent, Rnm, Alias, Pred, prototype). 2093 2098 2094 2099 '$lgt_alias_pred'(Instance, _, Alias, Pred, instance) :- 2095 2100 '$lgt_instantiates_class_'(Instance, Class, _), 2096 '$lgt_current_object_'(Class, _, _, _, _, _, _, _, _, Rnm, _ , _, _),2101 '$lgt_current_object_'(Class, _, _, _, _, _, _, _, _, Rnm, _), 2097 2102 '$lgt_alias_pred'(Class, Rnm, Alias, Pred, superclass). 2098 2103 2099 2104 '$lgt_alias_pred'(Class, _, Alias, Pred, superclass) :- 2100 2105 '$lgt_specializes_class_'(Class, Superclass, _), 2101 '$lgt_current_object_'(Superclass, _, _, _, _, _, _, _, _, Rnm, _ , _, _),2106 '$lgt_current_object_'(Superclass, _, _, _, _, _, _, _, _, Rnm, _), 2102 2107 '$lgt_alias_pred'(Superclass, Rnm, Alias, Pred, superclass). 2103 2108 … … 2136 2141 2137 2142 '$lgt_abolish_chk'(Obj, Functor/Arity, Sender, Scope) :- 2138 '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, DDcl, DDef, _, _ , _, _),2143 '$lgt_current_object_'(Obj, _, Dcl, _, _, _, _, DDcl, DDef, _, _), 2139 2144 !, 2140 2145 functor(Pred, Functor, Arity), … … 2217 2222 2218 2223 '$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), 2220 2225 !, 2221 2226 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, Meta, SCtn, DclScope), … … 2251 2256 2252 2257 '$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), 2254 2259 !, 2255 2260 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, _, SCtn, DclScope), … … 2319 2324 2320 2325 '$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), 2322 2327 !, 2323 2328 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, Meta, SCtn, DclScope), … … 2353 2358 2354 2359 '$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), 2356 2361 !, 2357 2362 '$lgt_assert_pred_dcl'(Dcl, DDcl, Head, Scope, PredType, _, SCtn, DclScope), … … 2451 2456 2452 2457 '$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), 2454 2459 !, 2455 2460 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> … … 2524 2529 2525 2530 '$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), 2527 2532 !, 2528 2533 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> … … 2575 2580 2576 2581 '$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), 2578 2583 !, 2579 2584 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> … … 2614 2619 2615 2620 '$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), 2617 2622 !, 2618 2623 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> … … 2679 2684 2680 2685 '$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), 2682 2687 !, 2683 2688 ( call_with_args(Dcl, Head, PScope, PredType, _, _, _, SCtn, _) -> … … 2860 2865 '$lgt_append'(Args, [Input, Rest], Args2), 2861 2866 Pred =.. [Functor| Args2], 2862 ( '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _ , _, _) ->2867 ( '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _) -> 2863 2868 ( call_with_args(Dcl, Pred, PScope, _, _, _, _, SCtn, _) -> 2864 2869 ( (\+ \+ PScope = Scope; Sender = SCtn) -> … … 2913 2918 2914 2919 '$lgt_term_expansion'(Obj, Term, Expansion, Sender, Scope) :- 2915 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _ , _, _),2920 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, DDef, _, _), 2916 2921 ( ( call_with_args(Dcl, term_expansion(_, _), PScope, _, _, _, _, SCtn, _) -> 2917 2922 ( (\+ \+ PScope = Scope; Sender = SCtn) -> … … 2958 2963 2959 2964 '$lgt_send_to_self_nv'(Obj, Pred, Sender) :- 2960 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _ , _, _),2965 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _), 2961 2966 !, 2962 2967 ( call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) -> % lookup declaration … … 3006 3011 3007 3012 '$lgt_send_to_object_nv'(Obj, Pred, Sender) :- 3008 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _ , _, _),3013 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _), 3009 3014 !, 3010 3015 ( call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) -> % lookup declaration … … 3065 3070 3066 3071 '$lgt_send_to_object_ne_nv'(Obj, Pred, Sender) :- 3067 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _ , _, _),3072 '$lgt_current_object_'(Obj, _, Dcl, Def, _, _, _, _, _, _, _), 3068 3073 !, 3069 3074 ( call_with_args(Dcl, Pred, Scope, _, _, _, _, SCtn, _) -> % lookup declaration … … 3218 3223 '$lgt_metacall_in_object'(Pred, local, Sender, This, Self) :- 3219 3224 !, 3220 '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _ , _, _),3225 '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _), 3221 3226 '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, Prefix, [], _), 3222 3227 '$lgt_tr_body'(Pred, Call, DCall, Ctx), … … 3229 3234 '$lgt_metacall_in_object'(Pred, MetaVars, Sender, This, Self) :- 3230 3235 ( \+ '$lgt_member'(Pred, MetaVars) -> 3231 '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _ , _, _),3236 '$lgt_current_object_'(This, Prefix, _, _, _, _, _, _, _, _, _), 3232 3237 '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, Prefix, [], _) 3233 ; '$lgt_current_object_'(Sender, Prefix, _, _, _, _, _, _, _, _, _ , _, _),3238 ; '$lgt_current_object_'(Sender, Prefix, _, _, _, _, _, _, _, _, _), 3234 3239 '$lgt_ctx_ctx'(Ctx, _, Sender, Sender, Self, Prefix, [], _) 3235 3240 ), … … 3249 3254 '$lgt_call_built_in'(Pred, Ctx) :- 3250 3255 '$lgt_ctx_ctx'(Ctx, _, Sender, This, Self, _, _, _), 3251 '$lgt_current_object_'(This, _, _, Def, _, _, _, _, _, _, _ , _, _) ->3256 '$lgt_current_object_'(This, _, _, Def, _, _, _, _, _, _, _) -> 3252 3257 ( call_with_args(Def, Pred, Sender, This, Self, Call) -> 3253 3258 call(Call) … … 3263 3268 '$lgt_call_within_context'(Obj, Goal, This) :- 3264 3269 ( '$lgt_compiler_flag'(context_switching_calls, allow) -> 3265 ( '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _, _, _, _ , _, _) ->3270 ( '$lgt_current_object_'(Obj, Prefix, _, _, _, _, _, _, _, _, _) -> 3266 3271 '$lgt_ctx_ctx'(Ctx, _, Obj, Obj, Obj, Prefix, [], _), 3267 3272 '$lgt_tr_body'(Goal, TGoal, DGoal, Ctx), … … 3285 3290 call_with_args(Rnm, Ctg, Pred, Alias), 3286 3291 ( '$lgt_imports_category_'(This, Ctg, _), 3287 '$lgt_current_category_'(Ctg, _, _, Def, _, _ , _),3292 '$lgt_current_category_'(Ctg, _, _, Def, _, _), 3288 3293 call_with_args(Def, Pred, Sender, This, Self, Call, _) -> 3289 3294 call(Call) … … 3351 3356 3352 3357 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). 3356 3361 3357 3362 3358 3363 '$lgt_current_protocol_'(expanding, '$lgt_bip_expanding_0_', '$lgt_bip_expanding_0__dcl', '$lgt_bip_expanding_0__alias', static). 3359 3364 '$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). 3360 3368 3361 3369 … … 3466 3474 3467 3475 '$lgt_hidden_functor'(Functor) :- 3468 '$lgt_current_category_'(_, Prefix, _, _, _, _ , _),3476 '$lgt_current_category_'(_, Prefix, _, _, _, _), 3469 3477 atom_concat(Prefix, _, Functor), 3470 3478 !. 3471 3479 3472 3480 '$lgt_hidden_functor'(Functor) :- 3473 '$lgt_current_object_'(_, Prefix, _, _, _, _, _, _, _, _, _ , _, _),3481 '$lgt_current_object_'(_, Prefix, _, _, _, _, _, _, _, _, _), 3474 3482 atom_concat(Prefix, _, Functor), 3475 3483 !. … … 4196 4204 '$lgt_check_redefined_entities' :- 4197 4205 ( '$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, _, _, _, _, _, _, _, _, _, _)) 4200 4208 ), 4201 4209 '$lgt_redefined_entity'(Entity, Type), … … 4213 4221 4214 4222 '$lgt_redefined_entity'(Entity, Type) :- 4215 ( '$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _ , _, _) ->4223 ( '$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _) -> 4216 4224 Type = object 4217 4225 ; '$lgt_current_protocol_'(Entity, _, _, _, _) -> 4218 4226 Type = protocol 4219 ; '$lgt_current_category_'(Entity, _, _, _, _, _ , _) ->4227 ; '$lgt_current_category_'(Entity, _, _, _, _, _) -> 4220 4228 Type = category 4221 4229 ). … … 4245 4253 retractall('$lgt_before_'(_, _, _, Entity, _)), 4246 4254 retractall('$lgt_after_'(_, _, _, Entity, _)), 4247 retractall('$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _ , _, _)),4255 retractall('$lgt_current_object_'(Entity, _, _, _, _, _, _, _, _, _, _)), 4248 4256 retractall('$lgt_current_protocol_'(Entity, _, _, _, _)), 4249 retractall('$lgt_current_category_'(Entity, _, _, _, _, _ , _)),4257 retractall('$lgt_current_category_'(Entity, _, _, _, _, _)), 4250 4258 retractall('$lgt_implements_protocol_'(Entity, _, _)), 4251 4259 retractall('$lgt_imports_category_'(Entity, _, _)), … … 4644 4652 4645 4653 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 4646 4670 % '$lgt_report_singletons'(+list, +term, @stream) 4647 4671 % 4648 % report the singleton variables found while compiling an entity term4672 % reports the singleton variables found while compiling an entity term 4649 4673 4650 4674 '$lgt_report_singletons'(TSingletons, Term, Input) :- … … 5092 5116 '$lgt_pp_rclause_'(Clause). 5093 5117 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)) :- 5095 5119 '$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 !. 5105 5121 5106 5122 '$lgt_pp_rclause'('$lgt_current_protocol_'(Ptc, Prefix, Dcl, Rnm, Mode)) :- … … 5108 5124 !. 5109 5125 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)) :- 5111 5127 '$lgt_pp_category_'(Ctg, Prefix, Dcl, Def, Rnm, Mode), 5112 !, 5113 ( '$lgt_pp_synchronized_' -> 5114 Synchronized = yes 5115 ; Synchronized = no 5116 ). 5128 !. 51
