-
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
3 changed files
with
65 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,55 @@ | ||
# ----------------- | ||
# Fibonacci numbers | ||
# ----------------- | ||
# | ||
# See https://en.wikipedia.org/wiki/Fibonacci_number | ||
|
||
@prefix math: <http://www.w3.org/2000/10/swap/math#>. | ||
@prefix log: <http://www.w3.org/2000/10/swap/log#>. | ||
@prefix : <http://example.org/ns#>. | ||
|
||
(_:X _:Y) log:onNegativeSurface ( | ||
(() log:negativeTriple (_:X :fibonacci _:Y)) | ||
((_:X 0 1) :fib _:Y) | ||
). | ||
|
||
(_:A _:B) log:onNegativeSurface ( | ||
(() log:negativeTriple ((0 _:A _:B) :fib _:A)) | ||
). | ||
|
||
(_:A _:B) log:onNegativeSurface ( | ||
(() log:negativeTriple ((1 _:A _:B) :fib _:B)) | ||
). | ||
|
||
(_:A _:B _:C _:D _:X _:Y) log:onNegativeSurface ( | ||
(() log:negativeTriple ((_:X _:A _:B) :fib _:Y)) | ||
(_:X math:greaterThan 1) | ||
((_:X 1) math:difference _:C) | ||
((_:A _:B) math:sum _:D) | ||
((_:C _:B _:D) :fib _:Y) | ||
). | ||
|
||
# query | ||
(_:X) log:onQuerySurface ( | ||
(1 :fibonacci _:X) | ||
). | ||
|
||
(_:X) log:onQuerySurface ( | ||
(2 :fibonacci _:X) | ||
). | ||
|
||
(_:X) log:onQuerySurface ( | ||
(3 :fibonacci _:X) | ||
). | ||
|
||
(_:X) log:onQuerySurface ( | ||
(91 :fibonacci _:X) | ||
). | ||
|
||
(_:X) log:onQuerySurface ( | ||
(283 :fibonacci _:X) | ||
). | ||
|
||
(_:X) log:onQuerySurface ( | ||
(3674 :fibonacci _:X) | ||
). |
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,8 @@ | ||
@prefix : <http://example.org/ns#>. | ||
|
||
1 :fibonacci 1 . | ||
2 :fibonacci 1 . | ||
3 :fibonacci 2 . | ||
91 :fibonacci 4660046610375530309 . | ||
283 :fibonacci 62232491515607091882574410635924603070626544377175485625797 . | ||
3674 :fibonacci 295872959797101479478634366815157108100573212705250690577871041398423606408217262643449728342664061812585639168722421830407677671667740585806703531229882783069925750619720511808616484846128237251921414441458265138672827487722512845223115526738192067144721087756159352711138340620702266509343657403678256247195010013499661223527119909308682062873140767135468966093474944529418214755911968500799987099146489838560114063096775586903976827512299123202488315139397181279903459556726060805948910609527571241968534269554079076649680403030083743420820438603816095671532163428933363322524736324029745871445486444623006627119156710782085648303485296149604974010598940800770684835758031137479033374229914629583184427269638360355586190323578625395157899987377625662075558684705457 . |
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,2 @@ | ||
#!/bin/bash | ||
eye --quiet --nope fibonacci.ttl --output out/fibonacci.ttl |