From f5c55e491b7de50380229831fbb620cc0cc19b6a Mon Sep 17 00:00:00 2001 From: josd Date: Mon, 27 Nov 2023 13:32:07 +0100 Subject: [PATCH] refreshing --- reasoning/blogic/temp/fibonacci.ttl | 55 +++++++++++++++++++++++++ reasoning/blogic/temp/out/fibonacci.ttl | 8 ++++ reasoning/blogic/temp/test | 2 + 3 files changed, 65 insertions(+) create mode 100644 reasoning/blogic/temp/fibonacci.ttl create mode 100644 reasoning/blogic/temp/out/fibonacci.ttl create mode 100755 reasoning/blogic/temp/test diff --git a/reasoning/blogic/temp/fibonacci.ttl b/reasoning/blogic/temp/fibonacci.ttl new file mode 100644 index 000000000..ec870cfd0 --- /dev/null +++ b/reasoning/blogic/temp/fibonacci.ttl @@ -0,0 +1,55 @@ +# ----------------- +# Fibonacci numbers +# ----------------- +# +# See https://en.wikipedia.org/wiki/Fibonacci_number + +@prefix math: . +@prefix log: . +@prefix : . + +(_: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) +). diff --git a/reasoning/blogic/temp/out/fibonacci.ttl b/reasoning/blogic/temp/out/fibonacci.ttl new file mode 100644 index 000000000..16a4df47c --- /dev/null +++ b/reasoning/blogic/temp/out/fibonacci.ttl @@ -0,0 +1,8 @@ +@prefix : . + +1 :fibonacci 1 . +2 :fibonacci 1 . +3 :fibonacci 2 . +91 :fibonacci 4660046610375530309 . +283 :fibonacci 62232491515607091882574410635924603070626544377175485625797 . +3674 :fibonacci 295872959797101479478634366815157108100573212705250690577871041398423606408217262643449728342664061812585639168722421830407677671667740585806703531229882783069925750619720511808616484846128237251921414441458265138672827487722512845223115526738192067144721087756159352711138340620702266509343657403678256247195010013499661223527119909308682062873140767135468966093474944529418214755911968500799987099146489838560114063096775586903976827512299123202488315139397181279903459556726060805948910609527571241968534269554079076649680403030083743420820438603816095671532163428933363322524736324029745871445486444623006627119156710782085648303485296149604974010598940800770684835758031137479033374229914629583184427269638360355586190323578625395157899987377625662075558684705457 . diff --git a/reasoning/blogic/temp/test b/reasoning/blogic/temp/test new file mode 100755 index 000000000..3456e5f20 --- /dev/null +++ b/reasoning/blogic/temp/test @@ -0,0 +1,2 @@ +#!/bin/bash +eye --quiet --nope fibonacci.ttl --output out/fibonacci.ttl