1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
set show timing off .
set show advisories off .
***
*** Check that the meta-interpreter doesn't use the meta-module cache.
***
fmod FOO is
sort Foo .
ops a b : -> Foo .
eq a = b .
endfm
load metaInterpreter
mod TEST is
pr META-INTERPRETER .
op me : -> Oid .
op User : -> Cid .
op state:_ : Nat -> Attribute .
vars X Y Z : Oid .
rl < X : User | state: 0 > createdInterpreter(X, Y, Z) =>
< X : User | state: 1 > insertModule(Z, X, foo) .
rl < X : User | state: 1 > insertedModule(X, Y) =>
< X : User | state: 2 > insertModule(Y, X, bar) .
rl < X : User | state: 2 > insertedModule(X, Y) =>
< X : User | state: 3 > reduceTerm(Y, X, 'BAR, 'a.Foo) .
op foo : -> Module .
eq foo = (
fmod 'FOO is
nil
sorts 'Foo .
none
op 'a : nil -> 'Foo [none] .
op 'c : nil -> 'Foo [none] .
none
eq 'a.Foo = 'c.Foo [none] .
endfm ) .
op bar : -> Module .
eq bar = (
fmod 'BAR is
protecting 'FOO .
sorts none .
none
none
none
none
endfm ) .
endm
*** correct result
erew <> < me : User | state: 0 > createInterpreter(interpreterManager, me, none) .
*** put a fmod BAR with same meta-syntax but different semantics in cache
red metaReduce(bar, 'a.Foo) .
*** wrong result
erew <> < me : User | state: 0 > createInterpreter(interpreterManager, me, none) .
|