2:- set_module(class(development)). 3:- '$set_source_module'(baseKB). 4:- use_module(library(pfc_lib)). 5:- mpred_unload_file. 6:- '$set_source_module'(baseKB). 7:- ensure_abox(baseKB). 8:- set_fileAssertMt(baseKB). 10:- prolog_load_context(file,F), ain(mpred_unload_option(F,never)).
46:- file_begin(pfc). 47
48:- kb_shared(predicate_relaxed/1). 49
51:- if(current_prolog_flag(assert_attvars,true)). 52
53:- use_module(library(clause_attvars)). 54
55predicate_relaxed(MSpec),{ strip_module(MSpec,M,Spec),mpred_functor(Spec,F,A),functor(P,F,A)} ==>
56 macroExpandExact(P, relax_goal(P,Q),M:Q).
57
58predicate_relaxed(MSpec),
59 { strip_module(MSpec,M,Spec), mpred_functor(Spec,F,A),functor(LOOP,F,A),kb_shared(M:F/A),LOOP=..[F|ARGS]}
60 ==>
61 (((M:LOOP:- awc, \+ maplist(is_iz_or_iza,ARGS), LOOPY=LOOP,!,M:relax(LOOPY),!,M:call(LOOPY))),
62 prologOrdered(F)). 63
64:- else. 65
66predicate_relaxed(MSpec),
67 { strip_module(MSpec,M,Spec), mpred_functor(Spec,F,A),functor(LOOP,F,A),kb_shared(M:F/A),LOOP=..[F|ARGS]}
68 ==>
69 (((M:LOOP:- awc, \+ maplist(is_iz_or_iza,ARGS), LOOPY=LOOP,!,M:relax(LOOPY),!,M:call(LOOPY))),
70 prologOrdered(F)). 71
86
88prologOrdered(F),predSingleValued(F) ==> {trace_or_throw(unsupported(prologOrdered(F),predSingleValued(F)))}.
89
90:- endif. 91
93
94
95
96
97
98:- if((current_prolog_flag(runtime_safety,D),D>2)). 99
100predicate_relaxed(weak_test/2).
101
102weak_test("Weak1","Weak2").
103weak_test("Weak0","weAk2").
104
105:- export(weak_test/2). 106:- public(weak_test/2). 107:- if((current_prolog_flag(runtime_debug,D),D>1)). 108:- listing(weak_test/2). 109:- endif. 110
112
113:- if(\+ current_predicate(mpred_test/1)). 114:- use_module(library(pfc_test)). 115:- endif. 116
117:- if((current_prolog_flag(runtime_safety,D),D>2)). 118:- mpred_test((weak_test(weak1,"WeAK2")))->true;(writeln(mpred_test(weak_test(weak1,"WeAK2"))),break). 119:- if((current_prolog_flag(runtime_debug,D),D>1)). 120:- mpred_test(weak_test("Weak1","Weak2")). 121:- mpred_test(weak_test("Weak1","wEak2")). 122:- endif. 123:- endif. 124
125
128weac_test("Weac1","Weac2").
129weac_test("Weac0","weAc2").
130
131:- export(weac_test/2). 132:- public(weac_test/2). 133
135
136predicate_relaxed(weac_test/2).
137
139
140:- mpred_test(weac_test("Weac1","Weac2")). 141:- mpred_test(weac_test("Weac1","wEac2")). 142:- mpred_test((weac_test(weac1,"WeAC2")))->true;(writeln(mpred_test(weac_test(weac1,"WeAC2"))),break). 143
146
147
148:- endif.
system_constraints
% ============================================= % File 'system_constraints.pfc' % Purpose: Agent Reactivity for SWI-Prolog % Maintainer: Douglas Miles % Contact: $Author: dmiles $@users.sourceforge.net ; % Version: 'interface' 1.0.0 % Revision: $Revision: 1.9 $ % Revised At: $Date: 2002/06/27 14:13:20 $ % ============================================= % % PFC is a language extension for prolog.. there is so much that can be done in this language extension to Prolog % % %
props(Obj,[height(ObjHt)])
==t(height,Obj,ObjHt)
==rdf(Obj,height,ObjHt)
==t(height(Obj,ObjHt))
. %pain(Obj,[height(ObjHt)])
==prop_set(height,Obj,ObjHt,...)
==ain(height(Obj,ObjHt))
% [pdel/pclr](Obj,[height(ObjHt)
]) == [del/clr](height,Obj,ObjHt) == [del/clr]svo(Obj,height,ObjHt)
== [del/clr](height(Obj,ObjHt)
) %keraseall(AnyTerm)
. % % ANTECEEDANT CONSEQUENT % % P = test nesc trueassert(P)
,retract(~P) ,enable(P)
. % ~ P = test nesc false assert(~P),retract(P)
,disable(P)
% % ~ ~(P) = test possible (via not impossible)retract( ~(P))
,enable(P)
. % \+ ~(P) = test impossiblity is unknownretract( ~(P))
% ~ \+(P) = same as P same as P % \+(P) = testnaf(P)
retract(P)
% % Dec 13, 2035 % Douglas Miles */