The prolog operator "_: _" means?

I do not understand the following Prolog fragment? What does ":_:" mean? What is the difference between ":=" and "=" ?

 game_to_problematic_points(Game,Pid,Hid) :- Point := Game/point, Pid := Point@id , Point = point:_:Hits. append(_, [Hit1,_|_], Hits), hit_out(Hit1), Hid := Hit1@id. hit_out(Hit) :- X := Hit@x , Y := Hit@y , ( X > 23.77 / 2 ; X < -23.77 / 2 ; Y > 10.97 / 2 ; Y < -10.97 / 2). 

Thanks:)

+5
source share
1 answer

This seems to be XPCE code. XPCE is the native SWI-Prolog object-oriented GUI library. His guide can be found in PDF format:

http://www.swi-prolog.org/download/xpce/doc/userguide/userguide.pdf

The operator :=/2 used for assignment (see the manual for details), while =/2 is the standard Prolog concatenation operator.

The purpose of Point = point:_:Hits is simply to combine the Point variable with the compound term point:_:Hits . It may be clear if you write this term in canonical form:

 ?- write_canonical(point:_:Hits). :(point,:(_,_)) true. 

Note that this term uses the standard module operator twice :/2 .

+5
source

All Articles