OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

xacml-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [xacml-comment] Public Comment


On Fri, 12 Nov 2004 Anne.Anderson@sun.com wrote:

> Haruyuki-san,
>
> The first case you describe is a mal-formed expression.  It is like
> a syntax error, and is thus correctly "Indeterminate".

Uggh, I hate using "English" for these specifiations!!!

So, it's not quite a syntax error, or my compiler would get it. :)

The problem is that the expression containing the integer must be
evaluated first. So, it remains a valid expression. However, the "English"
specification leads Haruyuki to believe he is correct.  However,
Haruyuki-san, the point that is missing is that the number of arguments
*is known* at the time of the evaluation.

> The second case is a result of correctly evaluating a logical condition
> and reaching a result of "false".  The fact that we specify an early
> "stop" to the evaluation is, I would say, an optimization that we have
> built in.

Correct. Haruyuki-san, I think you may be confusing two different
functions.

Using the "*" notation for arbitrary number of arguments, the type of N-OF
is the following:

N-OF:: (Integer -> Boolean* -> Boolean)

I think you believe it works more like the following function "lnof" that
takes a list of booleans as an argument:

lnof:: (Integer -> [Boolean] -> Boolean)
lnof 0     xs             = True
lnof x     []     | x > 0 = False
lnof (x+1) (x:xs) | x > 0 = if x then lnof x xs else lnof (x+1) xs

(i.e. takes a list of booleans, instead of an arbitrary number of boolean
arguments).

If that were indeed the case, then you could be correct, as you would have
to evaluate at least the list structure completely to determine the list's
length first, and then see if it were less than N.

However, you would still be able to come up with a *proper* functional
specification for that behavior without evaluating each element of the
list, regardless.

n_of:: (Int -> [Bool] -> Bool)
n_of n xs = if n < 0 || (length xs) < n
            then error
            else lnof n xs

    where
       length []     = 0
       length (x:xs) = 1 + length xs


Cheers,
-Polar


> Anne
>
> >Comment from: Haruyuki.Kawabe@unisys.co.jp
> >
> >When evaluating the expression (n-of N A B),
> >
> >If the value of N is 3, the result is indeterminate and none of the other
> >arguments
> >
> >are evaluated as specified in A.3.5.
> >
> >But if the value if N is 2 and the result of
> >
> >evaluating A is False, then the evaluation
> >
> >process SHALL be stoped (and the result is False), since the requirement of
> >N(=2) True
> >
> >values never be satisfied whatever the
> >
> >result of evaluating B.
> >
> >The former case (i.e. only the first
> >
> >arguemnt is evaluated and determined that
> >
> >the rquirement is not satisfied) is a special
> >
> >case of the later case, so the former case
> >
> >should result to "False".
>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]