#!/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/'sanity_abc.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)). :- debug_logicmoo(_). :- nodebug_logicmoo(http(_)). :- debug_logicmoo(logicmoo(_)). % :- mpred_trace_exec. :- mpred_trace. :- begin_pfc. :- dynamic(ddmost/1). meta_argtypes(ddmost(ftAssertable)). % BWD chaining ddmost((Q <- P))/mpred_literal(Q) ==> (Q <- (P, \+ ~(Q))). % FWD chaining ddmost(P==>Q)/nonvar(Q) ==> (((P ==> ddmost(Q)))). % NEG chaining ddmost(~Q)/mpred_positive_literal(Q) ==> (( \+ Q ) ==> ~ Q ). % POS chaining 1 ddmost(Q)/(mpred_positive_literal(Q),if_missing_mask(Q,R,Test)) ==> ( ( ( \+R /Test, (\+ ~Q )) ==> Q )). % POS chaining 2 ddmost(Q)/(mpred_positive_literal(Q),if_missing_mask(Q,R,Test)) ==> ( ((R/( Test, \+(R=Q))) ==> (\+ Q))). % POS chaining 1+2 % ddmost(Q)/(mpred_positive_literal(Q),if_missing_mask(Q,R,Test)) ==> ( ( ( \+R /Test ) ==> Q ) ,((R/( \+(R=Q), Test)) ==> (\+ Q))). :- dynamic(b/1). :- dynamic(c/1). ddmost(c(X)==>b(X)). c(1). :- mpred_test(ddmost(b(1))). :- mpred_test(b(1)). % to start in correct module (for debugging). :- initialization(module(header_sane)). :- mpred_trace. % :- mpred_trace_exec. :- ain(b(2)). % test breaks here :- listing(b/1). :- (b(1),clause(b(1),_))->break;true. :- mpred_test(\+ b(1)). :- mpred_test( b(2)). \+ b(2). :- listing(b/1). :- mpred_test(\+ b(2)). :- mpred_test( b(1)).