Re: Counting propositions

From: x <x-false_at_yahoo.com>
Date: Tue, 22 Jun 2004 09:47:51 +0300
Message-ID: <40d7d517_at_post.usenet.com>


  • Post for FREE via your newsreader at post.usenet.com ****

"Paul" <paul_at_test.com> wrote in message news:_SJBc.18359$NK4.3212222_at_stones.force9.net...
> x wrote:
> >> If columns a & b combined are a candidate key, we want to say
> >> something like: "select count(a,b) from R" but I don't think this
> >> is legal syntax in SQL. Maybe it should be? Are there reasons why
> >> not?
> >
> > So we really want to count just the candidate keys, not the
> > propositions ?
>
> Counting the candidate keys is equivalent to counting the propositions.
> I just think that extending the count syntax to multiple columns feels a
> neater way of generalising it. count(*) seems a bit of an anomaly
> because it kind of operates on a relation instead of the data within
> the relation.

If there is something like count(distinct *) , it count "propositions" No matter how you modify the relation, it count "propositions" If you use count(distinct a,b,c) you count distinct (a,b,c) tuples no matter how you modify the relation (if a,b,c remains unaltered).

> > Have you guessed right what is the meaning of "s(X)" in the Prolog
> > code I posted ?
>
> No, I'm having a look at it though and having to learn the syntax. I
> think I understand that square brackets indicate lists and the
> underscore is like an unbound variable. I'm guessing that R and L might
> mean right and left in this case?

[H|T] is a list with head H and tail T. H is the first element in the list and T is the rest of the list.
R stands for "result", L stands for "list" "_" is a "don't care" unnamed variable.
[] is the empty list.
member(X,L) is true iff X is an element of list L.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  • Usenet.com - The #1 Usenet Newsgroup Service on The Planet! *** http://www.usenet.com Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Received on Tue Jun 22 2004 - 08:47:51 CEST

Original text of this message