File: metaModule.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 (26 lines) | stat: -rw-r--r-- 839 bytes parent folder | download | duplicates (7)
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
set show timing off .
set show advisories off .

select META-MODULE .
red (subsort 'Foo < 'Bar .) .
red (op 'f : 'Foo -> 'Bar [none] .) .
red (ceq 'f['X:Foo] = 'a.Bar if 'g['a.Foo,'Y:Foo] := 'X:Foo [none] .) .
red 'g['a.Foo,'Y:Foo] := 'X:Foo .

red
(fmod 'FOO is
  including 'MACHINE-INT .
  sorts 'Foo ; 'Bar .
  subsort 'Foo < 'Bar .
  op 'f : 'Foo -> 'Bar [none] .
  op 'g : '`[Bar`] -> '`[Bar`] [none] .
  cmb 'X:Bar : 'Foo if 'f['Y:Bar] := 'f['X:Bar] /\
		       'g['Y:Bar, 'a.Foo] = 'a.Foo [none] .
  eq 'f['X:Foo] = 'g['a.Foo,'X:Foo] [none] .
  ceq 'f['X:Foo] = 'a.Bar if 'g['a.Foo,'Y:Foo] := 'X:Foo [none] .
endfm)
.

red (fmod 'FOO is including 'MACHINE-INT . sorts 'Foo ; 'Bar .
    subsort 'Foo < 'Bar . op 'f : 'Foo -> 'Bar[none]. op 'g : '`[Bar`] ->
    '`[Bar`][none]. none eq 'f['X:Foo] = 'g['a.Foo,'X:Foo] [none] . endfm).