1/* <module> logicmoo_plarkc - special module hooks into the logicmoo engine allow 2% clif syntax to be recocogized via our CycL/KIF handlers 3% 4% Logicmoo Project: A LarKC Server written in Prolog 5% Maintainer: Douglas Miles 6% Dec 13, 2035 7% 8*/ 9:- module(lm_cyc,[cyc_exec/1,cyc_exec/2]). 10 11% ============================================ 12% Prolog to Cyc Predicate Mapping 13% 14% the following will all do the same things: 15% 16% :- decl_mpred('BaseKB':isa/2). 17% :- decl_mpred('BaseKB':isa(_,_)). 18% :- decl_mpred(isa(_,_),'BaseKB'). 19% :- decl_mpred('BaseKB',isa,2). 20% 21% Will make calls 22% :- isa(X,Y) 23% Query into #$BaseKB for (#$isa ?X ?Y) 24% 25% decl_mpred/N 26% 27% ============================================ 28 29:- dynamic(lmcache:isCycUnavailable_known/1). 30 31/* 32https://www.dropbox.com/sh/9jexwgm9amw80mj/AADieFX-yQ_p6AfoF-Yy4muAa?dl=0 33 34https://www.dropbox.com/sh/n506umkk6tqqhkm/AACFbLDyCAkf392zE2Z05u2ta?dl=0 35 36:- was_export(isCycAvailable/0). 37isCycAvailable:-lmcache:isCycUnavailable_known(_),!,fail. 38isCycAvailable:-lmcache:isCycAvailable_known,!. 39isCycAvailable:-checkCycAvailablity,isCycAvailable. 40 41:- was_export(isCycUnavailable/0). 42isCycUnavailable:-lmcache:isCycUnavailable_known(_),!. 43isCycUnavailable:-lmcache:isCycAvailable_known,!,fail. 44isCycUnavailable:-checkCycAvailablity,isCycUnavailable. 45 46:- was_export(checkCycAvailablity/0). 47checkCycAvailablity:- (lmcache:isCycAvailable_known;lmcache:isCycUnavailable_known(_)),!. 48checkCycAvailablity:- catchv((current_predicate(invokeSubL/2),ignore((invokeSubL("(+ 1 1)",R))),(R==2->assert_if_new(lmcache:isCycAvailable_known);assert_if_new(lmcache:isCycUnavailable_known(R)))),E,assert_if_new(lmcache:isCycUnavailable_known(E))),!. 49*/ 50 51 52 53 54 55 56:- use_module(library(jpl)). 57 58 59cyc_exec(X):-cyc_exec(X,_). 60 61cyc_exec(X,X). 62 63:- fixup_exports.