0

Say I had a fact such as:

bigger(cat,mouse).

If I wanted to describe this to someone, would I be correct in saying "cat is the first term within this fact and mouse is the second term" or would I refer to the cat and mouse as atoms and say "the cat is the first atom within the fact and the mouse is the second".

false
  • 10,264
  • 13
  • 101
  • 209
JimmyK
  • 4,801
  • 8
  • 35
  • 47

3 Answers3

1

Your first description is fair, being 'term' a recursive data structure: i.e. a term is either an atom, a number, or a struct, where a struct is 'name(arg1,arg2,...)', and each argument is a term.

So your second description it's more accurate (restricted).

As other answers noted, 'argument' it's the usual naming of positionally identified attributes in structured terms.

CapelliC
  • 59,646
  • 5
  • 47
  • 90
0

argument would be the perfect word I think. But usually to describe a predicate you'd use the following form :

predicate/arity : predicate(arguments...)
description of arguments

Here it'd go something like :

bigger/2 : bigger(Bigger, Lesser)
Holds if Bigger is bigger than Lesser.

Additionally you could precise the mode of the arguments : + for input, - for output, ? for both (and @ for a pure input), refer to @false's answer on this question to get more infos about modes if needed.

Here the complete version could be :

bigger/2 : bigger(?Bigger, ?Lesser)
Holds if Bigger is bigger than Lesser.
Community
  • 1
  • 1
m09
  • 7,490
  • 3
  • 31
  • 58
0

To mix things up a bit, I might say bigger is a binary relationship that holds between cat and mouse.

Daniel Lyons
  • 22,421
  • 2
  • 50
  • 77