help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no empty (zero) string predicate in Elisp


From: Emanuel Berg
Subject: Re: no empty (zero) string predicate in Elisp
Date: Mon, 27 Apr 2015 03:00:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Marcin Borkowski <address@hidden> writes:

>>>> "Predicate" is a word from the grammars of human
>>>> languages, but I don't know its exact meaning,
>>>> neither there or in programming languages (until
>>>> now as for programming).
>>> AFAIK, "predicate" is a word from /logic/, and it
>>> means (more or less) a function which consumes one
>>> or more arguments of any type and gives back
>>> a truth-value.
>> Doesn't all functions in logic do that?
>
> First of all: IANAL (here L = logician;-)). But...
>
> For starters, in propositional calculus (AFAIK, also
> in first-order logic) there are no "functions" per
> se, since there are no /sets/. Furthermore, in the
> logic systems usually used by us mathematicians
> there are no /types/. AFAIK, the analogue of "type
> mismatch" in these systems is just a plain old
> "syntax error".
>
> What you probably refer to is the fact that in these
> simple logic systems both predicates and logical
> connectives "generate" truth-values. However, there
> are other possibilities; analogues of "functions" in
> these systems are called "terms".

I just looked it up in one of my favorite books,
namely

    @book{oxford-dictionary-of-computing,
      title      = {Oxford Dictionary of Computing},
      author     = {John Daintith and Edmund Wright (editors)},
      publisher  = {Oxford University Press},
      year       = 2010,
      ISBN       = 0199234000
    }

and your are absolutely right! A predicate is
a boolean function of n-arity: if n = 0
(i.e., no arguments) the function is called
a "statement" as the function value cannot change.

I also looked up "unary" but it wasn't included in the
"unary operator" sense, i.e. a function that accepts
a single input argument, e.g. f(x) or the suggested
zero-string predicate.

However, "unary operation" was included: a function

    f: D -> R

where the input domain equals the output range:

    f: S -> S

- which is *not* what we have here as here the input
set is all strings, while the output ditto is the mere

    { t, nil }

So all is clear, but it is error-prone and can be
confusion as well. So next time I'll just say "a
function with a single argument". Maybe.

By the way, "UNIX" (the name) is (?) a pun/joke on
this. It's predecessor was Multics, which was planned
to be a multiuser system, hence the name. But that
never materialized. UNIX, on the other hand, would
conquer the world a multiprogram, multiuser, and
time-sharing system...

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]