Prolog behavior?

Good morning, I am stuck on the rule of the Prolog program found in OsmAnd. This is a simplified version:

dest(D) -- ['dest.ogg'|Ds] :- name(D, Ds).

I cannot understand what it means --, since this is the first time I have seen such a design in Prolog programs. It looks like the substitution reads like this: " dest(D)is the list obtained by replacing Dsin ['dest.ogg'|Ds], if name(D, Ds)." In addition, I tried to find a “-” in several Prolog manuals (for example, SWI-Prolog), but I could not find anything related to this design.

Any suggestion? Is this a custom design?

+4
source share
1 answer

, -- SWI. . , - :

:- op(900, xfx,--).

( - )

, (--)/2 . (--)/3 ( ) . :

dest(D) -- ['dest.ogg'|Ds] :- name(D, Ds).

:

--(dest(D),['dest.ogg'|Ds]) :- name(D, Ds).

(, ) . , 900 ( , ) xfx, .

Prolog is, +, -, * .. . X is 2+2, is(X,+(2,2)). , + , is . , is/2: , , , .

Operators SWI Prolog .

+7

Source: https://habr.com/ru/post/1679046/


All Articles