File: showModuleJune2018.maude

package info (click to toggle)
maude 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,480 kB
  • sloc: cpp: 133,192; makefile: 2,180; yacc: 1,984; sh: 1,373; lex: 886
file content (60 lines) | stat: -rw-r--r-- 1,211 bytes parent folder | download | duplicates (4)
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
set show timing off .
set show advisories off .

***
***	Check that showModule message returns imports of non-flattened modules.
***

load metaInterpreter

mod TEST is
  pr META-INTERPRETER .

  op FOO : -> Module .
  eq FOO = (
    fmod 'FOO is
      nil
      sorts 'Foo .
      none
      op 'a : nil -> 'Foo [none] .
      op 'b : nil -> 'Foo [none] .
      none
      eq 'a.Foo = 'b.Foo [none] .
    endfm ).

  op BAR : -> Module .
  eq BAR = (
    fmod 'BAR is
      including 'FOO .
      sorts none .
      none
      none
      none
      none
    endfm ).

  op me : -> Oid .
  op User : -> Cid .

  var X Y Z : Oid .
  var N : Nat .
  var T : Term .
  var S : Sort .

  sort State .
  ops 1 2 3 4 : -> State [ctor] .
  op state:_ : State -> Attribute [ctor] .

  rl < X : User | state: 1 > createdInterpreter(X, Y, Z) => < X : User | state: 2 >
       insertModule(Z, X, FOO) .

  rl < X : User | state: 2 > insertedModule(X, Y) => < X : User | state: 3 >
       insertModule(Y, X, BAR) .

  rl < X : User | state: 3 > insertedModule(X, Y) => < X : User | state: 4 > 
       showModule(Y, X, 'BAR, false) .
endm

erew  <> 
< me : User | state: 1 > 
createInterpreter(interpreterManager, me, none) .