-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
17,929 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
------------------ | ||
Collatz conjecture | ||
------------------ | ||
|
||
See https://en.wikipedia.org/wiki/Collatz_conjecture |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@prefix math: <http://www.w3.org/2000/10/swap/math#>. | ||
@prefix log: <http://www.w3.org/2000/10/swap/log#>. | ||
@prefix : <urn:example:>. | ||
|
||
{ | ||
256 log:repeat ?N0. | ||
(?N0 1) math:sum ?N. | ||
?N :collatz (1 ?M). | ||
} => { | ||
?N :collatz (1 ?M). | ||
}. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@prefix math: <http://www.w3.org/2000/10/swap/math#>. | ||
@prefix list: <http://www.w3.org/2000/10/swap/list#>. | ||
@prefix log: <http://www.w3.org/2000/10/swap/log#>. | ||
@prefix : <urn:example:>. | ||
|
||
{ ?N :collatz (?N (?N)) } <= { | ||
true log:callWithCut true. | ||
}. | ||
|
||
{ ?N0 :collatz (?N ?M)} <= { | ||
( { (?N0 2) math:remainder 0 } | ||
{ (?N0 2) math:integerQuotient ?N1 } | ||
{ ((3 ?N0)!math:product 1) math:sum ?N1 } | ||
) log:ifThenElseIn ?SCOPE. | ||
?N1 :collatz (?N ?J). | ||
?M list:firstRest (?N0 ?J). | ||
}. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
eye --quiet --skolem-genid 8b98b360-9a70-4845-b52c-c675af60ad01 --wcache https://eyereasoner.github.io/eye/reasoning .. --nope https://eyereasoner.github.io/eye/reasoning/collatz/collatz.n3 --query https://eyereasoner.github.io/eye/reasoning/collatz/collatz-query.n3 --output collatz-answer.n3 | ||
eye --quiet --skolem-genid 8b98b360-9a70-4845-b52c-c675af60ad01 --wcache https://eyereasoner.github.io/eye/reasoning .. https://eyereasoner.github.io/eye/reasoning/collatz/collatz.n3 --query https://eyereasoner.github.io/eye/reasoning/collatz/collatz-query.n3 --output collatz-proof.n3 |