See: SWI-Prolog Glossary
Prolog has Structure or Compound, e.g. a(1,2,3)
Some will call this a tuple, (1,2,3)
What would this be called 1-2-3
, or A-B-C
?
This came about in writing some test cases for bagof/3 and order_by/2.
EDIT
After reading this StackOverflow answer by Paulo Moura it is a compound with functor -
and arity 2. The arity 2 seems wrong.
?- functor(A-B-C,Functor,Arity).
Functor = (-),
Arity = 2.
?- functor(1-2-3,Functor,Arity).
Functor = (-),
Arity = 2.
?- functor((1,2,3),Functor,Arity).
Functor = (','),
Arity = 2.
?- functor([1,2,3],Functor,Arity).
Functor = '[|]',
Arity = 2.
?- functor(group(1,2,3),Functor,Arity).
Functor = group,
Arity = 3.
?- functor(group(1|2|3),Functor,Arity).
Functor = group,
Arity = 1.
?- functor(group(1-2-3),Functor,Arity).
Functor = group,
Arity = 1.
?- write_canonical((1,2,3)).
','(1,','(2,3))
true.
?- write_canonical((1-2-3)).
-(-(1,2),3)
true.
?- write_canonical([1,2,3]).
[1,2,3]
true.
?- write_canonical((1|2|3)).
'|'(1,'|'(2,3))
true.
?- write_canonical(group(1,2,3)).
group(1,2,3)
true.
?- write_canonical(group(1-2-3)).
group(-(-(1,2),3))
true.
?- write_canonical(group(1|2,3)).
group('|'(1,2),3)
true.
?- current_op(Priority,Type,'|').
Priority = 1105,
Type = xfy.
?- current_op(Priority,Type,,).
Priority = 1000,
Type = xfy.
?- current_op(Priority,Type,-).
Priority = 200,
Type = fy ;
Priority = 500,
Type = yfx.
EDIT
Jan B. had the answer to The arity 2 seems wrong.
, but then erased it.
?- functor(a-b-c-d-e,Functor,Arity).
Functor = (-),
Arity = 2.
?- write_canonical(a-b-c-d-e).
-(-(-(-(a,b),c),d),e)
true.