Toggle navigation
?
users online
Logout
Open hangout
Open chat for current file
% https://suttacentral.net/sn22.59/en/sujato % Here, I will try to show ways to "section off knowledge" for the purpose of interacting with only one area of text. % This is primarily useful for when there are two explanations for the same thing which overlap in info, % making queries nonsense; referring to many different things which suppsedly refer to the same thing simultaneously. % this method is better with smaller amounts of data % these don't work on this website, you have to run it on your machine sections([ '2.1-5.5'-[ not(self(form)), self(form) :- false, not('lead to affliction'(form)) :- self(form), compel(form), 'lead to affliction'(form) :- not(self(form)), not(compel(form)), 'lead to affliction'(form) :- not(compel(form)) ], '6.1-6.18'-[ impermanent(form), suffering(form) :- impermanent(form) ] % not full content ]). % 1-indexed load_section(N) :- sections(List), nth1(N, List, _-Section), maplist(assertz, Section). unload_section(N) :- sections(List), nth1(N, List, _-Section), maplist(abolish_fact, Section). abolish_fact(T) :- functor(T, N, A), abolish(N/A). % example ordered queries: % % load_section(1). % not(self(X)). % X = form % load_section(2). % impermanent(X), not(compel(X)). % X = form % unload_section(1). % not(compel(X)). % Error % second method: records, specialized key value database use_module(library(record)). % the IDs would have to be carefully managed to sections. Something like this: % pli edition: 1, sn: 3, 22.59: 2259, 2.1: 21 id_data-['1'-['3'-['22.59'-[ '1.1-1.5', '2.1-5.5', '6.1-6.18', '7.1-10.1', '11.1-11.3', '12.1-12.4' ]]]] recorda('13225921', (not(self(form)), self(form) :- false)). recorda('13225922', 'lead to affliction'(self) :- form(self)). % recorded('13225921', V, R). to retrieve its fact