Re: Observational purity

2011-08-31 Thread Don
, observational purity, such methods are meant to be used inside contracts. It is quite different from the usual definition of purity and less strict. When specifications contain expressions that change the state of the program, then the meaning of the program may differ depending on whether

Re: Observational purity

2011-08-31 Thread bearophile
Don: If caching is the _only_ case which is required, They have developed this observational purity plus a way to enforce it, to allow static analyzability of contracts (so they are allowed to call only observationally pure methods), while keeping them flexible enough. Bye, bearophile

Re: Observational purity

2011-08-31 Thread Marco Leise
, but you could. Observational purity only works because we restrict ourselves to operations that are in the spirit of things like 'private members' or 'log files'. Admittedly it is possible for a language/compiler to disallow unsafe pointer operations, but not keep you from reading your log

Re: Observational purity

2011-08-31 Thread Don
On 31.08.2011 09:35, bearophile wrote: Don: If caching is the _only_ case which is required, They have developed this observational purity plus a way to enforce it, to allow static analyzability of contracts (so they are allowed to call only observationally pure methods), while keeping

Re: Observational purity

2011-08-31 Thread Walter Bright
On 8/31/2011 7:55 AM, Marco Leise wrote: Admittedly it is possible for a language/compiler to disallow unsafe pointer operations, but not keep you from reading your log files back in. But that's purity by convention, not by static checking.

Observational purity

2011-08-30 Thread bearophile
I've found a nice paper, 99.44% pure: Useful Abstractions in Specifications, By Mike Barnett, David A. Naumann, Wolfram Schulte, Qi Sun (Microsoft Research, 2004): http://www.cs.ru.nl/ftfjp/2004/Purity.pdf It presents yet another kind of purity, observational purity, such methods are meant

Re: Observational purity

2011-08-30 Thread Alex Rønne Petersen
, observational purity, such methods are meant to be used inside contracts. It is quite different from the usual definition of purity and less strict. When specifications contain expressions that change the state of the program, then the meaning of the program may differ depending on whether

Re: Observational purity

2011-08-30 Thread Timon Gehr
/Purity.pdf It presents yet another kind of purity, observational purity, such methods are meant to be used inside contracts. It is quite different from the usual definition of purity and less strict. When specifications contain expressions that change the state of the program, then the meaning

Re: Observational purity

2011-08-30 Thread Walter Bright
On 8/30/2011 8:31 AM, bearophile wrote: Time ago I have suggested a trusted purity to allow the implementation of pure function with memoization, but this observational purity seems better. observational purity seems like another word for logical const. This has been debated here many times.

Re: Observational purity

2011-08-30 Thread bearophile
Walter Bright: observational purity seems like another word for logical const. This has been debated here many times. They show how to enforce observational purity. I don't remember people discussing this here. They use observational purity just for methods called by contracts, to find