🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.specification.z
2 messages
2 total messages Started by Todd Fine Sat, 29 Aug 1992 21:42
Boolean Valued Functions?
#70
Author: Todd Fine
Date: Sat, 29 Aug 1992 21:42
53 lines
2168 bytes
In the following, I'll use the following notation:

   P = \power, < ... > = \langle ... \rangle, Z = \num

On page 125 of Spivey's "The Z Notation, A Reference Manual" (1st edition),
disjoint is declared as:

   disjoint _ : P (I \pfun P X)

Laws given for disjoint include:

   disjoint <A,B> \iff A \cap B = \empty

On page 62 of the manual, the type rules for function application are
given as:

   In the expression E_1 E_2, the sub-expression E_1 must have type
   P (t_1 \cross t_2), and E_2 must have type t_1, for some types
   t_1 and t_2.  The type of the whole expression is then t_2.

Suppose A and B are of type P t.  Then, <A,B> is of type P (Z \cross P t).
For disjoint <A,B> to be well typed:

   t_1 = P (Z \cross P t)

   P (t_1 \cross t_2)  = P ( (P (Z \cross P t)) \cross t_2) =
      P (I \pfun P X) = P (P (I \cross P X)) for some I and X

Letting I = Z and X = t almost works, but what about the "\cross t_2"?
Since disjoint <A,B> appears to return either true or false, it seems
that t_2 must be {true,false}.

By equating a set and its characteristic function, I can see how "disjoint Y"
could be viewed as being equivalent to "Y \in disjoint".

The type rules given for \in are that if E_1 has type t in "E_1 \in E_2",
then E_2 must have type P t.  So, the requirement for "<A,B> \in disjoint"
to be well typed is:

   P P (Z \cross P t) = P (P (I \cross P X)) for some I and X

So, choosing I = Z and X = t makes it work out alright.

Is there some place I'm missing in the reference manual where it says that:

   E_1 E_2 == E_2 \in E_1 when E_2 has type t and E_1 has type P t, and
   E_1 E_2 == "apply E1 to E2" when E_2 has type t and E_1 has type
               P (t \cross t_2)

Can someone clear this up?

Todd Fine
fine@sctc.com
Re: Boolean Valued Functions?
#71
Author: Steve King
Date: Sun, 30 Aug 1992 15:48
31 lines
1444 bytes
In article <1992Aug29.214201.28617@sctc.com> fine@sctc.com (Todd Fine) writes:
>
>On page 125 of Spivey's "The Z Notation, A Reference Manual" (1st edition),
>disjoint is declared as:
>
>   disjoint _ : P (I \pfun P X)
>
>On page 62 of the manual, the type rules for function application are
                                              ^^^^^^^^^^^^^^^^^^^^
>given as:
>            (rest deleted)
>Todd Fine
>fine@sctc.com

Here's the problem: in the *predicate* disjoint <A,B>, you're not dealing
with function application, but with an object (`disjoint') from the
syntactic category Pre-Rel, together with its expression.

All is clear on p73 of ZRM (1st edition).

On p48, you can see that disjoint is given as the only example of the
syntactic category Pre-Rel.

I haven't checked it, but I'd hope that all the types will work properly now.

Steve King

Programming Research Group
Oxford University Computing Laboratory
11 Keble Rd
Oxford OX1 3QD
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads