explain(true(Pred),L) :- !, indent(L), print('TRUE: '),print_bexpr(Pred),nl.
explain(false(Pred),L) :- !, indent(L), print('FALSE: '),print_bexpr(Pred),nl.
explain(conjunct_true(PosNr,Pred,InnerTree),L) :- !,
indent(L), format('Conjunct ~w TRUE: ',[PosNr]), print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(conjunct_false(PosNr,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Conjunct ~w~w individually FALSE: ',[PosNr,PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(disjunct_true(PosNr,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Disjunct ~w~w individually TRUE: ',[PosNr,PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(disjunct_false(PosNr,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Disjunct ~w~w FALSE: ',[PosNr,PI]), print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(implication_true(lhs_false,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Implication LHS~w individually FALSE: ',[PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(implication_true(rhs_true,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Implication RHS~w individually TRUE: ',[PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(equivalence_true(rhs_false,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Equivalence RHS~w FALSE: ',[PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(equivalence_true(lhs_true,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Equivalence LHS~w TRUE: ',[PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(equivalence_false(Pos,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Equivalence ~w ~w: ',[Pos,PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(negation(InnerTree),L) :- !,
indent(L), print('NEGATION'),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(implication_false(lhs_true,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Implication F with LHS~w TRUE: ',[PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(implication_false(rhs_false,Pred,InnerTree),L) :- !,
get_position_info(Pred,PI),
indent(L), format('Implication F with RHS~w FALSE: ',[PI]), %print_bexpr(Pred),
nl,
L1 is L+1, explain(InnerTree,L1).
explain(Term,L) :- indent(L), print(Term),nl,
add_internal_error('Uncovered Info Tree: ', explain(Term,L)).