Yes, it looks like the original cache is just re-installed when re-enabled.

Perhaps there should be an operation provided by Redex to clear away the
cache.

David


On Wed, Mar 14, 2018 at 2:17 PM, 'Leandro Facchinetti' via Racket Users <
[email protected]> wrote:

>
> First, thanks for the reply. It’s valuable to have the author of the paper
> from where I draw my example chime in πŸ˜€
>
> 1) Instead of turning the cache off completely, you could just
>
> invalidate the cache when the parameter changes, i.e. write a `set-k!'
>
> function that updates the parameter and toggles the cache off and back
> on (I assume this will clear it out).
>
>
> I believe the following program proves your assumption wrong:
>
> * * *
>
> #lang racket/base
>
> (require redex/reduction-semantics racket/list)
>
> (define k (make-parameter 0))
>
> (define-language L
>  [e ::= any]
>  [t ::= [e ...]])
>
> (define-metafunction L
>  tick : e _ _ _ t -> t
>  [(tick e _ _ _ t) ,(take (cons (term e) (term t)) (k))])
>
> (term (tick a _ _ _ [])) ;; => '()
> (parameterize* ([k 1]
>                [caching-enabled? #f]
>                [caching-enabled? #t])
>  (term (tick b _ _ _ []))) ;; => '(b)
> (parameterize ([k 1]
>               [caching-enabled? #f]
>               [caching-enabled? #t])
>  (term (tick a _ _ _ []))) ;; => '()
>
> * * *
>
> If the cache was flushed, then we’d see β€˜'(a)’ instead of β€˜'()’ in the
> last term.
>
> As I pointed out in my original message: cache invalidation continues to
> be one of the *hard problems* in computer science.
>
> 3) Move the escaping ellipses to the outermost `begin' form.  This
>
> allows you to write the escape once instead of for each Redex ellipse.
>
> It also means the code within the macro definition looks more like the
> original.
>
>
> That is one step in the right direction. Thanks for the suggestion. But I
> still think macro-defined models are not the right abstraction here.
>
> --
> Leandro Facchinetti <[email protected]>
> https://www.leafac.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to