Created
September 22, 2020 12:38
-
-
Save pchampin/a7986233be1f158f277dbf94937a47d5 to your computer and use it in GitHub Desktop.
N3 axiomatization of builtin predicate `list:memberAt`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. | |
@prefix math: <http://www.w3.org/2000/10/swap/math#>. | |
@prefix : <#>. | |
{ (?lst 1) :memberAt ?elt } <= { ?lst rdf:first ?elt. }. | |
{ (?lst ?i) :memberAt ?elt } <= { ?lst rdf:first ?elt. ?i math:equalTo 1. }. | |
{ (?lst ?i) :memberAt ?elt } <= { ?lst rdf:rest ?rest. (?rest ?j) :memberAt ?elt. (?j 1) math:sum ?i. }. | |
{ ((41) 1) :memberAt 41 } => { :TEST :PASS 1 }. | |
{ ((41) 1.0) :memberAt 41 } => { :TEST :PASS 2 }. | |
{ ((41) 1) :memberAt ?x } => { :TEST :PASS (3 ?x) }. | |
{ ((41) ?i) :memberAt 41 } => { :TEST :PASS (4 ?i) }. | |
{ ((41 42 43) 1) :memberAt 41 } => { :TEST :PASS 5 }. | |
{ ((41 42 43) 2) :memberAt 42 } => { :TEST :PASS 6 }. | |
{ ((41 42 43) 3) :memberAt 43 } => { :TEST :PASS 7 }. | |
{ ((41 42 43) 2.0) :memberAt 42 } => { :TEST :PASS 8 }. | |
{ ((41 42 41) ?i) :memberAt 41 } => { :TEST :PASS (9 ?i) }. | |
{ ((41 42 43) 2) :memberAt ?x } => { :TEST :PASS (10 ?x) }. | |
{ ((41) 0) :memberAt 41 } => { :TEST :SHOULDNT_PASS 1 }. | |
{ ((41) 1) :memberAt 42 } => { :TEST :SHOULDNT_PASS 2 }. | |
{ ((41) 2) :memberAt 41 } => { :TEST :SHOULDNT_PASS 3 }. | |
{ ((41 42 43) 0) :memberAt 41 } => { :TEST :SHOULDNT_PASS 4 }. | |
{ ((41 42 43) 1) :memberAt 42 } => { :TEST :SHOULDNT_PASS 5 }. | |
{ ((41 42 43) 2) :memberAt 41 } => { :TEST :SHOULDNT_PASS 6 }. | |
{ ((41 42 43) 2) :memberAt 43 } => { :TEST :SHOULDNT_PASS 7 }. | |
{ ((41 42 43) 4) :memberAt 44 } => { :TEST :SHOULDNT_PASS 8 }. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment