Is there any way to do this:
genre(blues). gere(hiphop). genre(rock).
In something like this:
genre(blues;hiphop;rock).
* I know that this does not work, but something like this exists.
You cannot consolidate facts, but you can turn them into a simple rule, for example:
genre(X) :- member(X, [blues, hiphop, rock]).
member/2 is a built-in list predicate in the SWI for verifying list membership.
member/2
This allows you to apply the predicate to all elements of the list and will be successful only if all applications succeed.
test_list( _, [] ). test_list( F, [H|T] ) :- P =.. [F,H], P, test_list( F, T ).
You can use this syntax
genre(X) :- X=blues ; X=hiphop ; X=rock.
but personally I advise the member / 2 ways ...
Source: https://habr.com/ru/post/1441688/More articles:Setting a static final variable in the constructor - javaHow can I create my own data type in python so that I can overwrite arithmetic operators? - pythonmysql one-to-many query with negation and / or multiple criteria - databaseHow to list current active system sensors - linuxjQuery Mobile: full width s fieldgroup - jqueryHow can I stop IE 7 from ignoring my width value and treating the element as a block when I install the add-on? - cssautomatic text replacement in wpf richtextbox - c #jQuery carousel animation jumping - jqueryhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1441692/redirect-stdout-of-two-processes-to-another-processs-stdin-in-linux-c&usg=ALkJrhjXLg2Y2ana0lMzgvLIbHJBbegLEwAndroid title / action id? - androidAll Articles