%% Copyright (C) 2017, 2019 Dennis J. Darland %% 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. %% %% This file is identical (actually linked with the Linux ln command). %% as common_2017_0001.pl for prolog and common_2017_0001.lf for Life %% %% %% I have made the propositional attitude relatons support an arity up to 26. %% %% Arity & Type are not much used yet, but they may be handy in the future. %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Define sense (close to Frege's Sinn) (useless) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sense_of_relation(Idea) :- Type > 0, ssss(Subject, Time, Type, Arity, Idea, Relation). sense_of_object(Idea) :- Type = 0, ssss(Subject, Time, Type, Idea, A_Object). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% rrrr is relation between relation word & relation idea. %% ssss is relation between relation idea & relation itself. %% rrrr is relation between word and idea. %% ssss is relation between idea and object. %% rrss is relative product of rrrr and ssss. %% rrss is relative product of rrrr and ssss. %%%% Ignoring common arguments %% Thus %% rrss is relation between relation word and relation itself. %% rrss is relation between word and object %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% rrss(Subject, Time, Type, Word, Object) :- rrrr(Subject, Time, Type, Word, Idea), ssss(Subject, Time, Type, Idea, Object). %% Next arity 1 understands_words_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object]]) :- rrss(Subject, Time, Type, Relation_Word, Relation), Type > 0, Arity = 1, arity_word(Relation_Word, Arity), rrss(Subject, Time, Type - 1, A_Word, A_Object). understands_words_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation], [A_Word, A_Object], [B_Word, B_Object]]) :- rrss(Subject, Time, Type, Relation_Word, Relation), Type > 0, Arity = 2, arity_word(Relation_Word, Arity), rrss(Subject, Time, Type - 1, A_Word, A_Object), rrss(Subject, Time, Type - 1, B_Word, B_Object). understands_words_objects_L(Subject, Time, Type, Arity, PairList) :- % List of Word Object Pairs. match_pair_word_relation_L(Subject, Time, Type, Arity, [], PairList). match_pair_word_relation_L(Subject, Time, Type, Arity, PairList_In, PairList) :- % List of Word Object Pairs. rrss(Subject, Time, Type, Word, Object), Type > 0, arity_word(Word, Arity), app2(PairList_In, [[Word, Object]]) = PairList_In_2, cond(Arity > 0, match_pair_word_object_pairs_L(Subject, Time, Type - 1, Arity - 1, PairList_In_2, PairList), PairList = PairList_In_2). match_pair_word_object_pairs_L(Subject, Time, Type, Arity, PairList_In, PairList) :- % List of Word Object Pairs. rrss(Subject, Time, Type, Word, Object), app2(PairList_In, [[Word, Object]]) = PairList_In_2, cond(Arity > 0, match_pair_word_object_pairs_L(Subject, Time, Type, Arity - 1, PairList_In_2, PairList), PairList = PairList_In_2). understands_words_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea, Relation], [A_Word, A_Idea, A_Object]]) :- rrrr(Subject, Time, Type, Relation_Word, Relation_Idea), Type > 0, Arity = 1, arity_word(Relation_Word, Arity), ssss(Subject, Time, Type, Relation_Idea, Relation), rrrr(Subject, Time, Type - 1, A_Word, A_Idea), ssss(Subject, Time, Type - 1, A_Idea, A_Object). 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]]) :- rrrr(Subject, Time, Type, Relation_Word, Relation_Idea), Type > 0, Arity = 2, arity_word(Relation_Word, Arity), ssss(Subject, Time, Type, Relation_Idea, Relation), rrrr(Subject, Time, Type - 1, A_Word, A_Idea), ssss(Subject, Time, Type - 1, A_Idea, A_Object), rrrr(Subject, Time, Type - 1, B_Word, B_Idea), ssss(Subject, Time, Type - 1, B_Idea, B_Object). understands_words_ideas_objects_L(Subject, Time, Type, Arity, TripleList) :- % List of Word Idea_Object Triples. match_triple_word_idea_relation_L(Subject, Time, Type, Arity, [], TripleList). match_triple_word_idea_relation_L(Subject, Time, Type, Arity, TripleList_In, TripleList) :- % List of Word Idea Object Triple. rrrr(Subject, Time, Type, Word, Idea), ssss(Subject, Time, Type, Idea, Object), Type > 0, arity_word(Word, Arity), app2(TripleList_In, [[Word, Idea, Object]]) = TripleList_In_2, cond(Arity > 0, match_triple_word_idea_object_L(Subject, Time, Type - 1, Arity - 1, TripleList_In_2, TripleList), TripleList = TripleList_In_2). match_triple_word_idea_object_L(Subject, Time, Type, Arity, TripleList_In, TripleList) :- % List of Word Object Triples. rrrr(Subject, Time, Type, Word, Idea), ssss(Subject, Time, Type, Idea, Object), app2(TripleList_In, [[Word, Idea, Object]]) = TripleList_In_2, cond(Arity > 0, match_triple_word_idea_object_L(Subject, Time, Type, Arity - 1, TripleList_In_2, TripleList), TripleList = TripleList_In_2). understands_words_ideas_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea]]) :- rrrr(Subject, Time, Type, Relation_Word, Relation_Idea), Type > 0, Arity = 1, arity_word(Relation_Word, 1), rrrr(Subject, Time, Type - 1, A_Word, A_Idea). understands_words_ideas_A(Subject, Time, Type, Arity, [[Relation_Word, Relation_Idea], [A_Word, A_Idea], [B_Word, B_Idea]]) :- rrrr(Subject, Time, Type, Relation_Word, Relation_Idea), Type > 0, Arity = 2, arity_word(Relation_Word, Arity), rrrr(Subject, Time, Type - 1, A_Word, A_Idea), rrrr(Subject, Time, Type - 1, B_Word, B_Idea). understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object]]) :- ssss(Subject, Time, Type, Relation_Idea, Relation), Type > 0, Arity = 1, arity_idea(Relation_Idea, Arity), ssss(Subject, Time, Type - 1, A_Idea, A_Object). understands_ideas_objects_A(Subject, Time, Type, Arity, [[Relation_Idea, Relation], [A_Idea, A_Object], [B_Idea, B_Object]]) :- ssss(Subject, Time, Type, Relation_Idea, Relation), Type > 0, Arity = 2, arity_idea(Relation_Idea, Arity), ssss(Subject, Time, Type - 1, A_Idea, A_Object), ssss(Subject, Time, Type - 1, B_Idea, B_Object). understands_ideas_objects_L(Subject, Time, Type, Arity, PairList) :- % List of Word Object Pairs. match_pair_idea_relation_L(Subject, Time, Type, Arity, [], PairList). match_pair_idea_relation_L(Subject, Time, Type, Arity, PairList_In, PairList) :- % List of Word Object Pairs. ssss(Subject, Time, Type, Idea, Object), Type > 0, arity_word(Idea, Arity), app2(PairList_In, [[Idea, Object]]) = PairList_In_2, cond(Arity > 0, match_pair_idea_object_L(Subject, Time, Type - 1, Arity - 1, PairList_In_2, PairList), PairList = PairList_In_2). match_pair_idea_object_L(Subject, Time, Type, Arity, PairList_In, PairList) :- % List of Idea Object Pairs. ssss(Subject, Time, Type, Idea, Object), app2(PairList_In, [[Idea, Object]]) = PairList_In_2, cond(Arity > 0, match_pair_idea_object_L(Subject, Time, Type, Arity - 1, PairList_In_2, PairList), PairList = PairList_In_2). subjects_understand_same_objects_by_ideas_A(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, [[Relation_Idea_1, Relation_Idea_2, Relation], [A_Idea_1, A_Idea_2, A_Object]]) :- ssss(Subject_1, Time_1, Type, Relation_Idea_1, Relation), Type > 0, ssss(Subject_2, Time_2, Type, Relation_Idea_2, Relation), Arity = 1, arity_idea(Relation_Idea_1, Arity), arity_idea(Relation_Idea_2, Arity), ssss(Subject_1, Time_1, Type - 1, A_Idea_1, A_Object), ssss(Subject_2, Time_2, Type - 1, A_Idea_2, A_Object). subjects_understand_same_objects_by_ideas_A(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, [[Relation_Idea_1, Relation_Idea_2, Relation], [A_Idea_1, A_Idea_2, A_Object], [B_Idea_1, B_Idea_2, B_Object]]) :- ssss(Subject_1, Time_1, Type, Relation_Idea_1, Relation), Type > 0, ssss(Subject_2, Time_2, Type, Relation_Idea_2, Relation), Arity = 2, arity_idea(Relation_Idea_1, Arity), arity_idea(Relation_Idea_2, Arity), ssss(Subject_1, Time_1, Type - 1, A_Idea_1, A_Object), ssss(Subject_1, Time_1, Type - 1, B_Idea_1, B_Object), ssss(Subject_2, Time_2, Type - 1, A_Idea_2, A_Object), ssss(Subject_2, Time_2, Type - 1, B_Idea_2, B_Object). subjects_understand_same_objects_by_ideas_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, Pair_List) :- % List of Word Object Pairs. match_same_pair_idea_relation_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, [], Pair_List). match_same_pair_idea_relation_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, PairList_In, Pair_List) :- % List of Word Object Pairs. arity_idea(Idea, Arity), Type > 0, ssss(Subject_1, Time_1, Type, Idea, Object), ssss(Subject_2, Time_2, Type, Idea, Object), app2(PairList_In, [[Idea, Object]]) = PairList_In_2, cond(Arity > 0, match_same_pair_idea_object_L(Subject_1, Time_1, Subject_2, Time_2, Type - 1, Arity - 1, PairList_In_2, Pair_List), Pair_List = PairList_In_2). match_same_pair_idea_object_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, PairList_In, Pair_List) :- % List of Idea Object Pairs. ssss(Subject_1, Time_1, Type, Idea, Object), ssss(Subject_2, Time_2, Type, Idea, Object), app2(PairList_In, [[Idea, Object]]) = PairList_In_2, cond(Arity > 0, match_same_pair_idea_object_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity - 1, PairList_In_2, Pair_List), Pair_List = PairList_In_2). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% subjects_understand_same_objects_by_words_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, Pair_List) :- % List of Word Object Pairs. match_same_pair_word_relation_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, [], Pair_List). match_same_pair_word_relation_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, PairList_In, Pair_List) :- % List of Word Object Pairs. arity_word(Word, Arity), Type > 0, rrss(Subject_1, Time_1, Type, Word, Object), rrss(Subject_2, Time_2, Type, Word, Object), app2(PairList_In, [[Word, Object]]) = PairList_In_2, cond(Arity > 0, match_same_pair_word_object_L(Subject_1, Time_1, Subject_2, Time_2, Type - 1, Arity - 1, PairList_In_2, Pair_List), Pair_List = PairList_In_2). match_same_pair_word_object_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity, PairList_In, Pair_List) :- % List of Word Object Pairs. rrss(Subject_1, Time_1, Type, Word, Object), rrss(Subject_2, Time_2, Type, Word, Object), app2(PairList_In, [[Word, Object]]) = PairList_In_2, cond(Arity > 0, match_same_pair_word_object_L(Subject_1, Time_1, Subject_2, Time_2, Type, Arity - 1, PairList_In_2, Pair_List), Pair_List = PairList_In_2). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Rules on Philosophical Terminology %% DEBUG VERSION %% pl_external_synonym_simple_expanded(Number, Philosopher_1, Philosopher_2, External_Term_1, External_Term_2, Quote_1, Author_1, Author_Article_1, Author_Book_1, Article_Title_1, Book_Title_1, Pages_1, Quotation_1, Article_Year_1, Book_Year_1, Note1, Notes_Article_1, Notes_Book_1, Quote_2, Author_2, Author_Article_2, Author_Book_2, Article_Title_2, Book_Title_2, Pages_2, Quotation_2, Article_Year_2, Book_Year_2, Note2, Notes_Article_2, Notes_Book_2, Quote_3, Author_3, Author_Article_3, Author_Book_3, Article_Title_3, Book_Title_3, Pages_3, Quotation_3, Article_Year_3, Book_Year_3, Note3, Notes_Article_3, Notes_Book_3, Quote_4, Author_4, Author_Article_4, Author_Book_4, Article_Title_4, Book_Title_4, Pages_4, Quotation_4, Article_Year_4, Book_Year_4, Note4, Notes_Article_4, Notes_Book_4) :- write(['A0001']), nl, term(External_Term_1), write(['A0002']), nl, term(External_Term_2), write(['A0003', Number, External_Term_1, External_Term_2]), nl, pl_external_synonym(Number, Philosopher_1, Philosopher_2, External_Term_1, External_Term_2, Quote_1, Quote_2, Quote_3, Quote_4), quote_note(Quote_1, Author_1, Author_Article_1, Author_Book_1, Article_Title_1, Book_Title_1, Pages_1, Quotation_1, Article_Year_1, Book_Year_1, Note1, Notes_Article_1, Notes_Book_1), write(['A0004', Number, Philosopher_1, Philosopher_2, External_Term_1, External_Term_2, Quote_1, Quote_2, Quote_3, Quote_4 ]), nl, quote_note(Quote_2, Author_2, Author_Article_2, Author_Book_2, Article_Title_2, Book_Title_2, Pages_2, Quotation_2, Article_Year_2, Book_Year_2, Note2, Notes_Article_2, Notes_Book_2), write(['A0005', Quote_2, Author_2, Author_Article_2, Author_Book_2, Article_Title_2, Book_Title_2, Pages_2, Quotation_2, Article_Year_2, Book_Year_2, Note2, Notes_Article_2, Notes_Book_2] ), nl, quote_note(Quote_3, Author_3, Author_Article_3, Author_Book_3, Article_Title_3, Book_Title_3, Pages_3, Quotation_3, Article_Year_3, Book_Year_3, Note3, Notes_Article_3, Notes_Book_3), write(['A0006', Quote_3, Author_3, Author_Article_3, Author_Book_3, Article_Title_3, Book_Title_3, Pages_3, Quotation_3, Article_Year_3, Book_Year_3, Note3, Notes_Article_3, Notes_Book_3]), nl, quote_note(Quote_4, Author_4, Author_Article_4, Author_Book_4, Article_Title_4, Book_Title_4, Pages_4, Quotation_4, Article_Year_4, Book_Year_4, Note4, Notes_Article_4, Notes_Book_4), write(['A0007', Quote_4, Author_4, Author_Article_4, Author_Book_4, Article_Title_4, Book_Title_4, Pages_4, Quotation_4, Article_Year_4, Book_Year_4, Note4, Notes_Article_4, Notes_Book_4] ), nl. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% pl_external_synonym expanded with full names and supporting quotations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pl_external_synonym_simple_expanded(Number, Philosopher_1, Philosopher_2, External_Term_1, External_Term_2, Quote_1, Author_1, Author_Article_1, Author_Book_1, Article_Title_1, Book_Title_1, Pages_1, Quotation_1, Article_Year_1, Book_Year_1, Note1, Notes_Article_1, Notes_Book_1, Quote_2, Author_2, Author_Article_2, Author_Book_2, Article_Title_2, Book_Title_2, Pages_2, Quotation_2, Article_Year_2, Book_Year_2, Note2, Notes_Article_2, Notes_Book_2, Quote_3, Author_3, Author_Article_3, Author_Book_3, Article_Title_3, Book_Title_3, Pages_3, Quotation_3, Article_Year_3, Book_Year_3, Note3, Notes_Article_3, Notes_Book_3, Quote_4, Author_4, Author_Article_4, Author_Book_4, Article_Title_4, Book_Title_4, Pages_4, Quotation_4, Article_Year_4, Book_Year_4, Note4, Notes_Article_4, Notes_Book_4) :- term(External_Term_1), term(External_Term_2), pl_external_synonym(Number, Philosopher_1, Philosopher_2, External_Term_1, External_Term_2, Quote_1, Quote_2, Quote_3, Quote_4), quote_note(Quote_1, Author_1, Author_Article_1, Author_Book_1, Article_Title_1, Book_Title_1, Pages_1, Quotation_1, Article_Year_1, Book_Year_1, Note1, Notes_Article_1, Notes_Book_1), quote_note(Quote_2, Author_2, Author_Article_2, Author_Book_2, Article_Title_2, Book_Title_2, Pages_2, Quotation_2, Article_Year_2, Book_Year_2, Note2, Notes_Article_2, Notes_Book_2), quote_note(Quote_3, Author_3, Author_Article_3, Author_Book_3, Article_Title_3, Book_Title_3, Pages_3, Quotation_3, Article_Year_3, Book_Year_3, Note3, Notes_Article_3, Notes_Book_3), quote_note(Quote_4, Author_4, Author_Article_4, Author_Book_4, Article_Title_4, Book_Title_4, Pages_4, Quotation_4, Article_Year_4, Book_Year_4, Note4, Notes_Article_4, Notes_Book_4). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% pl_external_synonym componded - two philosophers using term same as another %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pl_external_synonym_compound_expanded(Number1A, Number1B, Philosopher_1, Philosopher_2A, Philosopher_2B, External_Term_1, External_Term_2A, External_Term_2B, Quote_1A, Author_1A, Author_Article_1A, Author_Book_1A, Article_Title_1A, Book_Title_1A, Pages_1A, Quotation_1A, Article_Year_1A, Book_Year_1A, Note1A, Notes_Article_1A, Notes_Book_1A, Quote_2A, Author_2A, Author_Article_2A, Author_Book_2A, Article_Title_2A, Book_Title_2A, Pages_2A, Quotation_2A, Article_Year_2A, Book_Year_2A, Note2A, Notes_Article_2A, Notes_Book_2A, Quote_3A, Author_3A, Author_Article_3A, Author_Book_3A, Article_Title_3A, Book_Title_3A, Pages_3A, Quotation_3A, Article_Year_3A, Book_Year_3A, Note3A, Notes_Article_3A, Notes_Book_3A, Quote_4A, Author_4A, Author_Article_4A, Author_Book_4A, Article_Title_4A, Book_Title_4A, Pages_4A, Quotation_4A, Article_Year_4A, Book_Year_4A, Note4A, Notes_Article_4A, Notes_Book_4A, Quote_1B, Author_1B, Author_Article_1B, Author_Book_1B, Article_Title_1B, Book_Title_1B, Pages_1B, Quotation_1B, Article_Year_1B, Book_Year_1B, Note1B, Notes_Article_1B, Notes_Book_1B, Quote_2B, Author_2B, Author_Article_2B, Author_Book_2B, Article_Title_2B, Book_Title_2B, Pages_2B, Quotation_2B, Article_Year_2B, Book_Year_2B, Note2B, Notes_Article_2B, Notes_Book_2B, Quote_3B, Author_3B, Author_Article_3B, Author_Book_3B, Article_Title_3B, Book_Title_3B, Pages_3B, Quotation_3B, Article_Year_3B, Book_Year_3B, Note3B, Notes_Article_3B, Notes_Book_3B, Quote_4B, Author_4B, Author_Article_4B, Author_Book_4B, Article_Title_4B, Book_Title_4B, Pages_4B, Quotation_4B, Article_Year_4B, Book_Year_4B, Note4B, Notes_Article_4B, Notes_Book_4B) :- term(External_Term_1), term(External_Term_2), pl_external_synonym(NumberA, Philosopher_1, Philosopher_2A, External_Term_1, External_Term_2A, Quote_1A, Quote_2A, Quote_3A, Quote_4A), pl_external_synonym(NumberB, Philosopher_1, Philosopher_2B, External_Term_1, External_Term_2B, Quote_1B, Quote_2B, Quote_3B, Quote_4B), quote_note(Quote_1A, Author_1A, Author_Article_1A, Author_Book_1A, Article_Title_1A, Book_Title_1A, Pages_1A, Quotation_1A, Article_Year_1A, Book_Year_1A, Note1A, Notes_Article_1A, Notes_Book_1A), quote_note(Quote_2A, Author_2A, Author_Article_2A, Author_Book_2A, Article_Title_2A, Book_Title_2A, Pages_2A, Quotation_2A, Article_Year_2A, Book_Year_2A, Note2A, Notes_Article_2A, Notes_Book_2A), quote_note(Quote_3A, Author_3A, Author_Article_3A, Author_Book_3A, Article_Title_3A, Book_Title_3A, Pages_3A, Quotation_3A, Article_Year_3A, Book_Year_3A, Note3A, Notes_Article_3A, Notes_Book_3A), quote_note(Quote_4A, Author_4A, Author_Article_4A, Author_Book_4A, Article_Title_4A, Book_Title_4A, Pages_4A, Quotation_4A, Article_Year_4A, Book_Year_4A, Note4A, Notes_Article_4A, Notes_Book_4A), quote_note(Quote_1B, Author_1B, Author_Article_1B, Author_Book_1B, Article_Title_1B, Book_Title_1B, Pages_1B, Quotation_1B, Article_Year_1B, Book_Year_1B, Note1B, Notes_Article_1B, Notes_Book_1B), quote_note(Quote_2B, Author_2B, Author_Article_2B, Author_Book_2B, Article_Title_2B, Book_Title_2B, Pages_2B, Quotation_2B, Article_Year_2B, Book_Year_2B, Note2B, Notes_Article_2B, Notes_Book_2B), quote_note(Quote_3B, Author_3B, Author_Article_3B, Author_Book_3B, Article_Title_3B, Book_Title_3B, Pages_3B, Quotation_3B, Article_Year_3B, Book_Year_3B, Note3B, Notes_Article_3B, Notes_Book_3B), quote_note(Quote_4B, Author_4B, Author_Article_4B, Author_Book_4B, Article_Title_4B, Book_Title_4B, Pages_4B, Quotation_4B, Article_Year_4B, Book_Year_4B, Note4B, Notes_Article_4B, Notes_Book_4B), different(Philosopher_2A, Philosopher_2B). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Philosopher 2 using 2 different terms as philosopher 1 uses 1 term %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pl_ambiguity_1(Number_1, Number_2, Philosopher_1, Philosopher_2, External_Term_1, External_Term_2A, External_Term_2B) :- pl_external_synonym(Number_1, Philosopher_Abbreviation_1, Philosopher_Abbreviation_2, External_Term_1, External_Term_2A, Quote_1A, Quote_2A, Quote_3A, Quote_4A), pl_external_synonym(Number_2, Philosopher_Abbreviation_1, Philosopher_Abbreviation_2, External_Term_1, External_Term_2B, Quote_1B, Quote_2B, Quote_3B, Quote_4B), different(External_Term_2A, External_Term_2B), philosopher(Philosopher_Abbreviation_1, Philosopher_1), philosopher(Philosopher_Abbreviation_2, Philosopher_2). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Philosopher 1 using 2 different terms as philosopher 2 uses 1 term %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% pl_ambiguity_2(Number_1, Number_2, Philosopher_1, Philosopher_2, External_Term_1A, External_Term_1B, External_Term_2) :- pl_external_synonym(Number_1, Philosopher_Abbreviation_1, Philosopher_Abbreviation_2, External_Term_1A, External_Term_2, Quote_1A, Quote_2A, Quote_3A, Quote_4A), pl_external_synonym(Number_2, Philosopher_Abbreviation_1, Philosopher_Abbreviation_2, External_Term_1B, External_Term_2, Quote_1B, Quote_2B, Quote_3B, Quote_4B), different(External_Term_1A, External_Term_1B), philosopher(Philosopher_Abbreviation_1, Philosopher_1), philosopher(Philosopher_Abbreviation_2, Philosopher_2). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Expand quotation info when there is both book and article info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% quote_note(Id_Number, Author, Author_Article, Author_Book, Article_Title, Book_Title, Pages, Quotation, Article_Year, Book_Year, Note1, Notes_Article, Notes_Book) :- philosophical_quotation(Id_Number, Author_Abbreviation, Article_Abbreviation, Book_Abbreviation, Pages, Quotation, Note1), article(Article_Abbreviation, Book_Abbreviation, Author_Article_Abbreviation, Article_Title, Article_Year, Notes_Article), book(Book_Abbreviation, Author_Book_Abbreviation, Book_Title, Book_Year, Notes_Book), philosopher(Author_Article_Abbreviation, Author_Article), philosopher(Author_Book_Abbreviation, Author_Book), actual_author(Author_Abbreviation, Author_Article_Abbreviation, Author_Book_Abbreviation), philosopher(Author_Abbreviation, Author). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Expand quotation info when there is only book info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% quote_note(Id_Number, Author, none, Author_Book, none, Book_Title, Pages, Quotation, none, Book_Year, Note1, none, Notes_Book) :- philosophical_quotation(Id_Number, Author_Abbreviation, none, Book_Abbreviation, Pages, Quotation, Note1), book(Book_Abbreviation, Author_Book_Abbreviation, Book_Title, Book_Year, Notes_Book), philosopher(Author_Book_Abbreviation, Author_Book), actual_author(Author_Abbreviation, none, Author_Book_Abbreviation), philosopher(Author_Abbreviation, Author). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Expand quotation info when there is only article info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% quote_note(Id_Number, Author, Author_Article, none, Article_Title, none, Pages, Quotation, Article_Year, none, Note1, Notes_Article, none) :- philosophical_quotation(Id_Number, Author_Abbreviation, Article_Abbreviation, none, Pages, Quotation, Note1), article(Article_Abbreviation, none, Author_Article_Abbreviation, Article_Title, Article_Year, Notes_Article), philosopher(Author_Article_Abbreviation, Author_Article), actual_author(Author_Abbreviation, Author_Article_Abbreviation, none), philosopher(Author_Abbreviation, Author). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Expand quotation info when there is no info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% quote_note(none, none, none, none, none, none, none, none, none, none, none, none, none). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% If there is article author info use it - otherwise use book info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% actual_author(Author_Abbreviation, Author_Article_Abbreviation, Author_Book_Abbreviation) :- different(Author_Article_Abbreviation, none), Author_Abbreviation = Author_Article_Abbreviation, !. actual_author(Author_Abbreviation, Author_Article_Abbreviation, Author_Book_Abbreviation) :- Author_Abbreviation = Author_Book_Abbreviation.