#!/usr/bin/env swipl % % PFC is a language extension for prolog.. there is so much that can be done in this language extension to Prolog % % Dec 13, 2035 % Douglas Miles % cls ; kill -9 %1 ; fg ; swipl -g "ensure_loaded(pack(logicmoo_base/t/examples/base/'dmost_01.pfc'))." % was_module(sanity,[]). :- include(test_header). :- asserta((was_missing(Q):- mpred_literal_nv(Q), \+ ~Q, if_missing_mask(Q,R,Test),!, lookup_u(R), Test)). :- nodebug_logicmoo(_). :- nodebug_logicmoo(http(_)). :- debug_logicmoo(logicmoo(_)). % :- mpred_trace_exec. :- mpred_trace. :- begin_pfc. :- dynamic(dmost/1). meta_argtypes(dmost(ftAssertable)). % BWD chaining dmost((Q <- P))/mpred_literal(Q) ==> (Q <-(P, \+ ~(Q))). % FWD chaining dmost(P==>Q)/nonvar(Q) ==> (((P ==> dmost(Q)))). % NEG chaining dmost(~Q)/mpred_positive_literal(Q) ==> (( \+ Q ) ==> ~ Q ). % POS chaining 1 dmost(Q)/(mpred_positive_literal(Q),if_missing_mask(Q,R,Test)) ==> ( ( ( \+R /Test, (\+ ~Q )) ==> Q )). % POS chaining 2 dmost(Q)/(mpred_positive_literal(Q),if_missing_mask(Q,R,Test)) ==> ( ((R/( \+(R=Q), Test)) ==> (\+ Q))). % POS chaining 1+2 % dmost(Q)/(mpred_positive_literal(Q),if_missing_mask(Q,R,Test)) ==> ( ( ( \+R /Test ) ==> Q ) ,((R/( \+(R=Q), Test)) ==> (\+ Q))). :- dynamic(b/1). :- mpred_trace_exec. dmost(b(1)). :- listing(b/1). :- mpred_why(dmost(b(1))). :- mpred_why(b(1)). ==> b(2). :- listing(b/1). :- mpred_why(\+ b(1)). :- mpred_why( b(2)). ~ b(2). :- listing(b/1). :- mpred_test(\+ b(2)). :- mpred_why( b(1)).