#    Test filter in N3
# Use
# cwm rules12.n3 -think -filter=filter12.n3
#  should conclude that  granpa is ancestor of bill
# 
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix daml: <http://www.daml.org/2001/03/daml+oil#> .
@prefix : <#> .
@prefix rules: <#> .

# SimplifiedDanC challenge  - simplied version of rules13.n3

this log:forAll <#p> .
#moved this out of the consequent --BJP

#Ok, I understand the problem with it being in the consquent, ye old []
#in consquent problem. You want the inner "this" to be scoped to the
#context where it is inserted, rather than the defining context. So, you
#want a generator, or rather, to defer binding "this" until you enter it.

#Ugh, "this" is a variable, I guess, but a dynamic rather than a lexical one?

{  <#p> a daml:TransitiveProperty . } log:implies

{
    { <#x> <#p> <#y>. <#y> <#p> <#z>. } log:implies { <#x> <#p> <#z>. }.
this log:forAll <#x> , <#y> , <#z>.  
} .


<#ancestor>  a daml:TransitiveProperty .
<#granpa> <#ancestor> <#pa> .
<#pa> <#ancestor> <#bill> .

