1:- set_module(class(development)).    2:- '$set_source_module'(baseKB).    3:- use_module(library(pfc_lib)).    4:- mpred_unload_file.    5:- ensure_abox(baseKB).    6:- set_fileAssertMt(baseKB).    7% ensure this file does not get unloaded with mpred_reset
    8:- prolog_load_context(file,F), ain(mpred_unload_option(F,never)).    9
   10
   11:- set_prolog_flag(do_renames,restore).   12:- set_prolog_flag_until_eof(do_renames,term_expansion).   13
   14/*
   15flatTrans(G)==> 
   16 ((
   17  t(G,A,B)/A\=B, 
   18  t(G,B,C)/(C\=B,C\=A))==> t(G,A,C)).
   19
   20flatTrans(G)==> (((t(G,A,B)/(A\=B,dif(A,C)),t(G,B,C)/(B\=C)))  ==> t(G,A,C)).
   21
   22*/
   23flatTrans(F)==>transIxyz(F,F,F).
   24
   25((transIxyz(X,Y,Z)/(maplist(into_mpred_form,[t(X,A,B),t(Y,B,C),t(Z,A,C)],[AB,BC,AC])))
   26  ==> ((AB/dif(A,C),BC/(B\=C))==>AC)).
   27
   28tooSlow==> flatTrans(genls).
   29flatTrans(subFormat).
   30flatTrans(genlPreds).
   31flatTrans(genlFuncs).
   32flatTrans(genlFunctions).
   33flatTrans(genlMt).
   34
   35%genlsUpTo(TT) ==> ((isa(T,TT),genls(C,T))==>isa(C,TT)).
   36genlsUpTo(ttTemporalType).
   37genlsUpTo(ttRelationType).
   38genlsUpTo(ttTypeType).
   39
   40
   41% genls(C,S):- cwc, (ground(C);ground(S)),C\==tCol, loop_check(tran_by_trans(genls,C,S)),C\=S.
   42
   43
   44% to load this files use  ?- ensure_mpred_file_loaded('logicmoo/pfc/system_genls.pfc').
   45:- dynamic(mudIsa/2).   46:- file_begin(pfc).   47
   48
   49tooSlow==>((type_checking ==> (((genls(X,Y),{X\=Y},genls(Y,X))) ==> {mpred_withdraw(genls(Y,X))}))).
   50
   51% (genls(C,SC)==>(tCol(SC),tCol(C),{repropagate(SC)})).
   52
   53:- sanity(get_lang(pfc)).   54
   55% TODO (genls(C,SC)==>(tCol(C),tCol(SC))).
   56
   57% rtAvoidForwardChain(functorDeclares).
   58rtAvoidForwardChain(C):- cwc, tCol(C),compound(C).
   59rtAvoidForwardChain(meta_argtypes).
   60% rtAvoidForwardChain(completeIsaAsserted).
   61
   62ttExpressionType(C)==>rtAvoidForwardChain(C).
   63
   64% TODO ((completeIsaAsserted(I), isa(I,Sub), {dif(Sub, Super)}, genls(Sub,Super),{ground(Sub:Super)}, \+ genls/*Fwd*/(Sub,Super), \+ ttExpressionType(Super))) ==> isa(I,Super).
   65%    \+ genlsFwd(Sub,Super), \+ ttExpressionType(Super))) ==> isa(I,Super).
   66
   67completeIsaAsserted(I) ==> ((isa(I,Sub)/ (\+ rtAvoidForwardChain(Sub))) ==> mudIsa(I,Sub)).
   68mudIsa(I,C),genls(C,P) ==> mudIsa(I,P).
   69/*
   70
   71% isRuntime ==> 
   72% (mudIsa(I,Sub)/(ground(mudIsa(I,Sub)), \+ rtAvoidForwardChain(Sub))) ==> isa(I,Sub).
   73((completelyAssertedCollection(Sub) / (\+ rtAvoidForwardChain(Sub)))) ==> ttMudIsaCol(Sub).
   74ttMudIsaCol(Sub) ==> (isa(I,Sub) ==> mudIsa(I,Sub)).
   75((completeIsaAsserted(I),mudIsa(I,Sub), {dif(Sub, Super)}, genls(Sub,Super),{ground(Sub:Super)}, \+ rtAvoidForwardChain(Super))) ==> mudIsa(I,Super).
   76*/
   77
   78
   79
   80:- set_prolog_flag(do_renames,restore).