@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix list: <http://www.w3.org/2000/10/swap/list#>.
@prefix graph: <http://www.w3.org/2000/10/swap/graph#>.

# resolution A (proof by cases)
{
    ?A => ?B.
    ?B list:select (?C ?D).
    ?C => ?E.
    ?E list:isList false.
    ?G list:firstRest (?E ?D).
} => {
    ?A => ?G.
}.

# resolution B (proof by cases)
{
    ?A => ?B.
    ?B list:select (?C ?D).
    ?C => ($ $).
} => {
    ?A => ?D.
}.

# resolution C (modus tollens)
{
    ?A => ?B.
    ?B list:isList false.
    ?B => ($ $).
} => {
    ?A => ($ $).
}.

# rewriting A (factoring)
{
    ?A => ?B.
    ?B list:removeDuplicates (?C).
} => {
    ?A => ?C.
}.

# rewriting B (contrapositive)
{
    ?A => ?B.
    ?B list:select (?C ?D).
    ({ ?C => ($ $) } ?A) graph:union ?E.
} => {
    ?E => ?D.
}.

# rewriting C (contrapositive)
{
    ?A => ($ $).
    ?A graph:list ?B.
    ?B list:select (?C ?M).
    ?C log:isBuiltin false.
    ?E graph:list ?M.
} => {
    ?E => {
        ?C => ($ $).
    }.
}.

# inference fuse
{
    ?A => ($ $).
    ?A log:call true.
} => false.
