%% Copyright (C) 2017, 2019 Dennis J. Darland %% trouble with commit made this change!!! %% This file is part of darland's philosophy. %% darland's philosophy is free software: you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation, either version 3 of the License, or %% (at your option) any later version. %% darland's philosophy is distributed in the hope that it will be useful, %% but WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %% GNU General Public License for more details. %% You should have received a copy of the GNU General Public License %% along with darland's philosophy. If not, see . %% Common Prolog & Life predicates to simulate Dennis J. Darlands philosophy. %% Started Writing 1/4/2017 %% This is a total rewrite of what I started about 10 years ago. %% %% %% %% Arity & Type are not much used yet, but they may be handy in the future. %% %% There are two primitive sorts of belief %% One in words %% believes_in_words(Subject, Time, Type, Arity, %% [Relation_Word, %% A_Word, %% B_Word, %% C_Word, ...]) %% And One in ideas %% believes_in_ideas(Subject, Time, Type, Arity, %% [Relation_Word, %% A_Idea, %% B_Idea, %% C_Idea, ... ]) %% Either may exist with or without the other. %% beliefs in words exist without ideas exist, e.g. when we %% compute without thinking. But I think we must have subconscious %% ideas if the words are about anything. %% beliefs in ideas exist without words, exist, e.g. when we %% cannot think of a person's name. % if a person belives in words & ideas & connects them to objects then: % they must have the correct relation among the words % they must have the correct relation among their ideas % and understand the relation between the words, ideas and objects. % This ammounts to the rrrr & ssss relations holding. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_word_idea_object_L(Subject, Time, Type, Arity, Triple_List) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, Word_List), believes_in_ideas(Subject, Time, Type, Arity, Idea_List), match_triple_list_L(Subject, Time, Type, Arity, Word_List, Idea_List, [], Triple_List). match_triple_list_L(Subject, Time, Type, Arity, [], [], Triple_List_In, Triple_List) :- Triple_List = Triple_List_In. match_triple_list_L(Subject, Time, Type, Arity, [Word_Head | Word_Tail], [Idea_Head | Idea_Tail], Triple_List_In, Triple_List) :- rrrr(Subject, Time, Type_X1, Word_Head, Idea_Head), ssss(Subject, Time, Type_X2, Idea_Head, Object), app2(Triple_List_In, [[Word_Head, Idea_Head, Object]]) = Triple_List_In_2, match_triple_list_L(Subject, Time, Type, Arity - 1, Word_Tail, Idea_Tail, Triple_List_In_2, Triple_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_word_idea_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word]), Type > 0, Arity = 1, believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), understands_words_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object]]). believes_word_idea_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object], [B_Word, B_Idea, B_Object]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word, B_Word]), Type > 0, Arity = 2, believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), understands_words_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object], [B_Word, B_Idea, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person belives in words about objects then: % they must have the correct relation among the words % they must have the correct relation among their ideas % and understand the relation between the words, ideas and objects. % NOTE: The only way to connect the words to the objects is via ideas. % This means the rrss relations hold. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_word_object_L(Subject, Time, Type, Arity, Pair_List) :- %% list of word, idea object pairs believes_in_words(Subject, Time, Type, Arity, Word_List), believes_in_ideas(Subject, Time, Type, Arity, Idea_List), match_pair_list_L(Subject, Time, Type, Arity, Word_List, Idea_List, [], Pair_List). match_pair_list_L(Subject, Time, Type, Arity, [], [], Pair_List_In, Pair_List) :- Pair_List = Pair_List_In. match_pair_list_L(Subject, Time, Type, Arity, [Word_Head | Word_Tail], [Idea_Head | Idea_Tail], Pair_List_In, Pair_List) :- rrrr(Subject, Time, Type_X1, Word_Head, Idea_Head), ssss(Subject, Time, Type_X2, Idea_Head, Object), app2(Pair_List_In, [[Word_Head, Object]]) = Pair_List_In_2, match_pair_list_L(Subject, Time, Type, Arity - 1, Word_Tail, Idea_Tail, Pair_List_In_2, Pair_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_word_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word]), Type > 0, Arity = 1, understands_words_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object]]). believes_word_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object], [B_Word, B_Object]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word, B_Word]), Type > 0, Arity = 2, understands_words_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object], [B_Word, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person believes in words and ideas then: % they must have the correct relation among the words % they must have the correct relation among their ideas % and understand the relation between the words and ideas. % % This amounts to the correct rrrr relations holding. % There might not even be corresponding objects. believes_word_idea_L(Subject, Time, Type, Arity, Pair_List) :- %% list of word, idea object pairs believes_in_words(Subject, Time, Type, Arity, Word_List), match_WI_pair_list_L(Subject, Time, Type, Arity, Word_List, [], Pair_List). match_WI_pair_list_L(Subject, Time, Type, Arity, [], Pair_List_In, Pair_List) :- Pair_List = Pair_List_In. match_WI_pair_list_L(Subject, Time, Type, Arity, [Word_Head | Word_Tail], Pair_List_In, Pair_List) :- rrrr(Subject, Time, Type_X1, Word_Head, Idea), app2(Pair_List_In, [[Word_Head, Idea]]) = Pair_List_In_2, match_WI_pair_list_L(Subject, Time, Type, Arity - 1, Word_Tail, Pair_List_In_2, Pair_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_word_idea_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word]), Type > 0, Arity = 1, believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), understands_words_ideas_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea]]). believes_word_idea_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea], [B_Word, B_Idea]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word, B_Word]), Type > 0, Arity = 2, believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), understands_words_ideas_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea], [B_Word, B_Idea]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person believes in ideas about objects then: % they must have the correct relation among their ideas % and understand the relation between the ideas and objects. % % This amounts to the correct ssss relations holding. % There might not even be corresponding words. believes_idea_object_L(Subject, Time, Type, Arity, Pair_List) :- %% list of idea, idea object pairs believes_in_ideas(Subject, Time, Type, Arity, Idea_List), match_IO_pair_list_L(Subject, Time, Type, Arity, Idea_List, [], Pair_List). match_IO_pair_list_L(Subject, Time, Type, Arity, [], Pair_List_In, Pair_List) :- Pair_List = Pair_List_In. match_IO_pair_list_L(Subject, Time, Type, Arity, [Idea_Head | Idea_Tail], Pair_List_In, Pair_List) :- ssss(Subject, Time, Type_X1, Idea_Head, Object), app2(Pair_List_In, [[Idea_Head, Object]]) = Pair_List_In_2, match_IO_pair_list_L(Subject, Time, Type_X2, Arity - 1, Idea_Tail, Pair_List_In_2, Pair_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_idea_object_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object]]) :- believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), Type > 0, Arity = 1, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object]]). believes_idea_object_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object], [B_Idea, B_Object]]) :- %% list of word, idea object triples believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), Type > 0, Arity = 2, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object], [B_Idea, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person believes about objects then: % they must have the correct relation among their ideas % and understand the relation between the ideas and objects. % % This amounts to the correct ssss relations holding. % There might not even be corresponding words. believes_object_L(Subject, Time, Type, Arity, Object_List) :- %% list of idea, idea object pairs believes_in_ideas(Subject, Time, Type, Arity, Idea_List), match_O_list_L(Subject, Time, Type, Arity, Idea_List, [], Object_List). match_O_list_L(Subject, Time, Type, Arity, [], Pair_List_In, Pair_List) :- Pair_List = Pair_List_In. match_O_list_L(Subject, Time, Type, Arity, [Idea_Head | Idea_Tail], Pair_List_In, Pair_List) :- ssss(Subject, Time, Type_X1, Idea_Head, Object), app2(Pair_List_In, [[Object]]) = Pair_List_In_2, match_O_list_L(Subject, Time, Type_X2, Arity - 1, Idea_Tail, Pair_List_In_2, Pair_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_object_A(Subject, Time, Type, Arity, [[Relation], [A_Object]]) :- believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), Type > 0, Arity = 1, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object]]). believes_object_A(Subject, Time, Type, Arity, [[Relation], [A_Object], [B_Object]]) :- %% list of word, idea object triples believes_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), Type > 0, Arity = 2, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object], [B_Idea, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% now believes not cases. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_not_word_idea_object_L(Subject, Time, Type, Arity, Triple_List) :- %% list of word, idea object triples believes_not_in_words(Subject, Time, Type, Arity, Word_List), believes_not_in_ideas(Subject, Time, Type, Arity, Idea_List), match_triple_list_L(Subject, Time, Type, Arity, Word_List, Idea_List, [], Triple_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_not_word_idea_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word]), Type > 0, Arity = 1, believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), understands_words_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object]]). believes_not_word_idea_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object], [B_Word, B_Idea, B_Object]]) :- %% list of word, idea object triples believes_not_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word, B_Word]), Type > 0, Arity = 2, believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), understands_words_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object], [B_Word, B_Idea, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person belives in words about objects then: % they must have the correct relation among the words % they must have the correct relation among their ideas % and understand the relation between the words, ideas and objects. % NOTE: The only way to connect the words to the objects is via ideas. % This means the rrss relations hold. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_not_word_object_L(Subject, Time, Type, Arity, Pair_List) :- %% list of word, idea object pairs believes_not_in_words(Subject, Time, Type, Arity, Word_List), believes_not_in_ideas(Subject, Time, Type, Arity, Idea_List), match_pair_list_L(Subject, Time, Type, Arity, Word_List, Idea_List, [], Pair_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_not_word_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object]]) :- %% list of word, idea object triples believes_not_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word]), Type > 0, Arity = 1, understands_words_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object]]). believes_not_word_object_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object], [B_Word, B_Object]]) :- %% list of word, idea object triples believes_not_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word, B_Word]), Type > 0, Arity = 2, understands_words_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object], [B_Word, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person believes in words and ideas then: % they must have the correct relation among the words % they must have the correct relation among their ideas % and understand the relation between the words and ideas. % % This amounts to the correct rrrr relations holding. % There might not even be corresponding objects. believes_not_word_idea_L(Subject, Time, Type, Arity, Pair_List) :- %% list of word, idea object pairs believes_not_in_words(Subject, Time, Type, Arity, Word_List), match_WI_pair_list_L(Subject, Time, Type, Arity, Word_List, [], Pair_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_not_word_idea_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea]]) :- %% list of word, idea object triples believes_not_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word]), Type > 0, Arity = 1, believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), understands_words_ideas_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea]]). believes_not_word_idea_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea], [B_Word, B_Idea]]) :- %% list of word, idea object triples believes_in_words(Subject, Time, Type, Arity, [Relation_Word, A_Word, B_Word]), Type > 0, Arity = 2, believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), understands_words_ideas_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea], [B_Word, B_Idea]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person believes in ideas about objects then: % they must have the correct relation among their ideas % and understand the relation between the ideas and objects. % % This amounts to the correct ssss relations holding. % There might not even be corresponding words. believes_not_idea_object_L(Subject, Time, Type, Arity, Pair_List) :- %% list of idea, idea object pairs believes_not_in_ideas(Subject, Time, Type, Arity, Idea_List), match_IO_pair_list_L(Subject, Time, Type, Arity, Idea_List, [], Pair_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_not_idea_object_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object]]) :- believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), Type > 0, Arity = 1, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object]]). believes_not_idea_object_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object], [B_Idea, B_Object]]) :- %% list of word, idea object triples believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), Type > 0, Arity = 2, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object], [B_Idea, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % if a person believes about objects then: % they must have the correct relation among their ideas % and understand the relation between the ideas and objects. % % This amounts to the correct ssss relations holding. % There might not even be corresponding words. believes_not_object_L(Subject, Time, Type, Arity, Object_List) :- %% list of idea, idea object pairs believes_not_in_ideas(Subject, Time, Type, Arity, Idea_List), match_O_list_L(Subject, Time, Type, Arity, Idea_List, [], Object_List). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% believes_not_object_A(Subject, Time, Type, Arity, [[Relation], [A_Object]]) :- believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea]), Type > 0, Arity = 1, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object]]). believes_not_object_A(Subject, Time, Type, Arity, [[Relation], [A_Object], [B_Object]]) :- %% list of word, idea object triples believes_not_in_ideas(Subject, Time, Type, Arity, [Relation_Idea, A_Idea, B_Idea]), Type > 0, Arity = 2, understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object], [B_Idea, B_Object]]). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Now Contradicting beliefs!! contradicts_word_idea_object_L(Subject, Time, Type, Arity, Triple_List) :- believes_word_idea_object_L(Subject, Time, Type, Arity, Triple_List), believes_not_word_idea_object_L(Subject, Time, Type, Arity, Triple_List). contradicts_word_object_L(Subject, Time, Type, Arity, Pair_List) :- believes_word_object_L(Subject, Time, Type, Arity, Pair_List), believes_not_word_object_L(Subject, Time, Type, Arity, Pair_List). contradicts_word_idea_L(Subject, Time, Type, Arity, Pair_List) :- believes_word_idea_L(Subject, Time, Type, Arity, Pair_List), believes_not_word_idea_L(Subject, Time, Type, Arity, Pair_List). contradicts_idea_object_L(Subject, Time, Type, Arity, Pair_List) :- believes_idea_object_L(Subject, Time, Type, Arity, Pair_List), believes_not_idea_object_L(Subject, Time, Type, Arity, Pair_List). contradicts_object_L(Subject, Time, Type, Arity, Object_List) :- believes_object_L(Subject, Time, Type, Arity, Object_List), believes_not_object_L(Subject, Time, Type, Arity, Object_List).