File: metaReduce.maude

package info (click to toggle)
maude 2.6-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,776 kB
  • ctags: 8,613
  • sloc: cpp: 87,637; sh: 3,468; ansic: 3,011; yacc: 1,414; makefile: 1,252; lex: 563
file content (107 lines) | stat: -rw-r--r-- 1,522 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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
set show timing off .
set show advisories off .

***
***	Test the metaReduce() descent function.
***

red in META-LEVEL :
metaReduce(
fmod 'FOO is
  nil
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo [none] .
  none
  none
endfm, 'a.Foo) .

red in META-LEVEL :
metaReduce(
fmod 'FOO is
  nil
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo [none] .
  op 'b : nil -> 'Foo [none] .
  op 'f : 'Foo -> 'Foo [strat(0)] .
  none
  eq 'a.Foo = 'b.Foo [none] .
endfm, 'f['a.Foo]) .

red in META-LEVEL :
metaReduce(
fmod 'FOO is
  nil
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo [none] .
  op 'b : nil -> 'Foo [none] .
  op 'f : 'Foo -> 'Foo [strat(1 0)] .
  none
  eq 'a.Foo = 'b.Foo [none] .
endfm, 'f['a.Foo]) .

select META-LEVEL .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"a".String) .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"this is a string".String) .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"this is\na string".String) .

red metaReduce(
fmod 'FOO is
  protecting 'STRING .
  sorts none .
  none
  none
  none
  none
endfm, '"\n".String) .

red metaReduce(
fmod 'FOO is
  protecting 'FLOAT .
  sorts none .
  none
  none
  none
  none
endfm, 'pi.Float) .

select META-LEVEL .

red metaReduce(
fmod 'FOO is
  protecting 'INT .
  sorts 'Foo .
  none
  op 'a : nil -> 'Foo  [none] .
  none
  none
endfm, '_+_['s_['0.Int], 's_^12['0.Int]]) .