| 1 |
op _`,_ left-identity collapse from AttributeSet to Attribute is unequal. |
| 2 |
op __ left-identity collapse from Configuration to Object is unequal. |
| 3 |
th CONTAINER is |
| 4 |
including CONFIGURATION . |
| 5 |
including TRIV . |
| 6 |
sort Container . |
| 7 |
subsort Container < Cid . |
| 8 |
op insert : Oid Oid Elt -> Msg [ctor msg] . |
| 9 |
op Container : -> Container [ctor pconst] . |
| 10 |
op guts :_ : Elt -> Attribute [ctor prec 15 gather (&)] . |
| 11 |
endth |
| 12 |
th CONTAINER is |
| 13 |
sorts Attribute AttributeSet Oid Cid Object Msg Portal Configuration Elt |
| 14 |
Container . |
| 15 |
subsort Attribute < AttributeSet . |
| 16 |
subsort Container < Cid . |
| 17 |
subsorts Object Msg Portal < Configuration . |
| 18 |
op none : -> AttributeSet [ctor] . |
| 19 |
op _,_ : AttributeSet AttributeSet -> AttributeSet [ctor assoc comm id: none |
| 20 |
prec 41 gather (e E)] . |
| 21 |
op <_:_|_> : Oid Cid AttributeSet -> Object [ctor obj prec 0 gather (& & &) |
| 22 |
special ( |
| 23 |
id-hook ObjectConstructorSymbol |
| 24 |
op-hook attributeSetSymbol (_,_ : AttributeSet AttributeSet ~> |
| 25 |
AttributeSet))] . |
| 26 |
op none : -> Configuration [ctor] . |
| 27 |
op __ : Configuration Configuration -> Configuration [ctor assoc comm id: |
| 28 |
none config prec 41 gather (e E)] . |
| 29 |
op <> : -> Portal [ctor portal] . |
| 30 |
op getClass : Object -> Cid . |
| 31 |
op insert : Oid Oid Elt -> Msg [ctor msg] . |
| 32 |
op Container : -> Container [ctor pconst] . |
| 33 |
op guts :_ : Elt -> Attribute [ctor prec 15 gather (&)] . |
| 34 |
eq getClass(< O:Oid : C:Cid | A:AttributeSet >) = C:Cid . |
| 35 |
endth |
| 36 |
Considering object completion on: |
| 37 |
rl insert(R:Oid, S:Oid, D:Z$Elt) < R:Oid : Z$Container | none > => < R:Oid : |
| 38 |
Z$Container | guts : D:Z$Elt > . |
| 39 |
Transformed rule: |
| 40 |
rl insert(R:Oid, S:Oid, D:Z$Elt) < R:Oid : V:Z$Container | guts : A:[Z$Elt], |
| 41 |
Atts:AttributeSet > => < R:Oid : V:Z$Container | guts : D:Z$Elt, |
| 42 |
Atts:AttributeSet > . |
| 43 |
|
| 44 |
op _`,_ left-identity collapse from AttributeSet to Attribute is unequal. |
| 45 |
op __ left-identity collapse from Configuration to Object is unequal. |
| 46 |
mod DO-SOMETHING{Z :: CONTAINER} is |
| 47 |
including BOOL . |
| 48 |
including CONFIGURATION . |
| 49 |
including QID . |
| 50 |
subsort Qid < Oid . |
| 51 |
op init : Z$Elt -> Configuration . |
| 52 |
eq init(X:Z$Elt) = < 'a : Z$Container | guts : X:Z$Elt > . |
| 53 |
rl < R:Oid : V:Z$Container | Atts:AttributeSet, guts : A:[Z$Elt] > insert( |
| 54 |
R:Oid, S:Oid, D:Z$Elt) => < R:Oid : V:Z$Container | Atts:AttributeSet, guts |
| 55 |
: D:Z$Elt > . |
| 56 |
endm |
| 57 |
========================================== |
| 58 |
reduce in DO-SOMETHING : init(E:Z$Elt) . |
| 59 |
rewrites: 1 |
| 60 |
result Object: < 'a : Z$Container | guts : E:Z$Elt > |
| 61 |
========================================== |
| 62 |
rewrite in DO-SOMETHING : init(E:Z$Elt) insert('a, 'b, F:Z$Elt) . |
| 63 |
rewrites: 2 |
| 64 |
result Object: < 'a : Z$Container | guts : F:Z$Elt > |
| 65 |
op _`,_ left-identity collapse from AttributeSet to Attribute is unequal. |
| 66 |
op __ left-identity collapse from Configuration to Object is unequal. |
| 67 |
mod BAG{X :: TRIV} is |
| 68 |
including BOOL . |
| 69 |
including CONFIGURATION . |
| 70 |
sort Bag{X} . |
| 71 |
subsort Bag{X} < Cid . |
| 72 |
op replace : Oid X$Elt -> Msg [ctor msg] . |
| 73 |
op Bag{X} : -> Bag{X} [ctor] . |
| 74 |
op contents :_ : X$Elt -> Attribute [ctor prec 15 gather (&)] . |
| 75 |
endm |
| 76 |
mod BAG{X :: TRIV} is |
| 77 |
sorts X$Elt Bool Attribute AttributeSet Oid Cid Object Msg Portal |
| 78 |
Configuration Bag{X} . |
| 79 |
subsort Attribute < AttributeSet . |
| 80 |
subsort Bag{X} < Cid . |
| 81 |
subsorts Object Msg Portal < Configuration . |
| 82 |
op if_then_else_fi : Bool Universal Universal -> Universal [poly (2 3 0) prec |
| 83 |
0 gather (& & &) special ( |
| 84 |
id-hook BranchSymbol |
| 85 |
term-hook 1 (true) |
| 86 |
term-hook 2 (false))] . |
| 87 |
op _==_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E) |
| 88 |
special ( |
| 89 |
id-hook EqualitySymbol |
| 90 |
term-hook equalTerm (true) |
| 91 |
term-hook notEqualTerm (false))] . |
| 92 |
op _=/=_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E) |
| 93 |
special ( |
| 94 |
id-hook EqualitySymbol |
| 95 |
term-hook equalTerm (false) |
| 96 |
term-hook notEqualTerm (true))] . |
| 97 |
op true : -> Bool [ctor special ( |
| 98 |
id-hook SystemTrue)] . |
| 99 |
op false : -> Bool [ctor special ( |
| 100 |
id-hook SystemFalse)] . |
| 101 |
op _and_ : Bool Bool -> Bool [assoc comm prec 55 gather (e E)] . |
| 102 |
op _or_ : Bool Bool -> Bool [assoc comm prec 59 gather (e E)] . |
| 103 |
op _xor_ : Bool Bool -> Bool [assoc comm prec 57 gather (e E)] . |
| 104 |
op not_ : Bool -> Bool [prec 53 gather (E)] . |
| 105 |
op _implies_ : Bool Bool -> Bool [prec 61 gather (e E)] . |
| 106 |
op none : -> AttributeSet [ctor] . |
| 107 |
op _,_ : AttributeSet AttributeSet -> AttributeSet [ctor assoc comm id: none |
| 108 |
prec 41 gather (e E)] . |
| 109 |
op <_:_|_> : Oid Cid AttributeSet -> Object [ctor obj prec 0 gather (& & &) |
| 110 |
special ( |
| 111 |
id-hook ObjectConstructorSymbol |
| 112 |
op-hook attributeSetSymbol (_,_ : AttributeSet AttributeSet ~> |
| 113 |
AttributeSet))] . |
| 114 |
op none : -> Configuration [ctor] . |
| 115 |
op __ : Configuration Configuration -> Configuration [ctor assoc comm id: |
| 116 |
none config prec 41 gather (e E)] . |
| 117 |
op <> : -> Portal [ctor portal] . |
| 118 |
op getClass : Object -> Cid . |
| 119 |
op replace : Oid X$Elt -> Msg [ctor msg] . |
| 120 |
op Bag{X} : -> Bag{X} [ctor] . |
| 121 |
op contents :_ : X$Elt -> Attribute [ctor prec 15 gather (&)] . |
| 122 |
eq true and A:Bool = A:Bool . |
| 123 |
eq false and A:Bool = false . |
| 124 |
eq A:Bool and A:Bool = A:Bool . |
| 125 |
eq false xor A:Bool = A:Bool . |
| 126 |
eq A:Bool xor A:Bool = false . |
| 127 |
eq A:Bool and (B:Bool xor C:Bool) = A:Bool and B:Bool xor A:Bool and C:Bool . |
| 128 |
eq not A:Bool = true xor A:Bool . |
| 129 |
eq A:Bool or B:Bool = A:Bool and B:Bool xor A:Bool xor B:Bool . |
| 130 |
eq A:Bool implies B:Bool = not (A:Bool xor A:Bool and B:Bool) . |
| 131 |
eq getClass(< O:Oid : C:Cid | A:AttributeSet >) = C:Cid . |
| 132 |
endm |
| 133 |
view Bag{Y :: TRIV} from CONTAINER to BAG{Y} is |
| 134 |
class Container to Bag{Y} . |
| 135 |
attr guts to contents . |
| 136 |
sort Elt to Y$Elt . |
| 137 |
vars R S : Oid . |
| 138 |
var D : Elt . |
| 139 |
msg insert (R, S, D) to term replace (R, D) . |
| 140 |
endv |
| 141 |
view Bag{Y :: TRIV} from CONTAINER to BAG{Y} is |
| 142 |
sort Elt to Y$Elt . |
| 143 |
sort Container to Bag{Y} . |
| 144 |
op Container : -> [Cid,Container] to Bag{Y} . |
| 145 |
op guts :_ : [Elt] -> [Attribute,AttributeSet] to contents :_ . |
| 146 |
var R : Oid . |
| 147 |
var S : Oid . |
| 148 |
var D : Elt . |
| 149 |
op insert(R, S, D) to term replace(R, D) . |
| 150 |
endv |
| 151 |
op _`,_ left-identity collapse from AttributeSet to Attribute is unequal. |
| 152 |
op __ left-identity collapse from Configuration to Object is unequal. |
| 153 |
mod TEST{Y :: TRIV} is |
| 154 |
sorts Y$Elt Bool Attribute AttributeSet Oid Cid Object Msg Portal |
| 155 |
Configuration Bag{Y} Zero NzNat Nat String Char FindResult Qid . |
| 156 |
subsort Attribute < AttributeSet . |
| 157 |
subsort Qid < Oid . |
| 158 |
subsort Bag{Y} < Cid . |
| 159 |
subsorts Object Msg Portal < Configuration . |
| 160 |
subsorts Zero NzNat < Nat . |
| 161 |
subsort Char < String . |
| 162 |
subsort Nat < FindResult . |
| 163 |
op if_then_else_fi : Bool Universal Universal -> Universal [poly (2 3 0) prec |
| 164 |
0 gather (& & &) special ( |
| 165 |
id-hook BranchSymbol |
| 166 |
term-hook 1 (true) |
| 167 |
term-hook 2 (false))] . |
| 168 |
op _==_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E) |
| 169 |
special ( |
| 170 |
id-hook EqualitySymbol |
| 171 |
term-hook equalTerm (true) |
| 172 |
term-hook notEqualTerm (false))] . |
| 173 |
op _=/=_ : Universal Universal -> Bool [poly (1 2) prec 51 gather (E E) |
| 174 |
special ( |
| 175 |
id-hook EqualitySymbol |
| 176 |
term-hook equalTerm (false) |
| 177 |
term-hook notEqualTerm (true))] . |
| 178 |
op true : -> Bool [ctor special ( |
| 179 |
id-hook SystemTrue)] . |
| 180 |
op false : -> Bool [ctor special ( |
| 181 |
id-hook SystemFalse)] . |
| 182 |
op _and_ : Bool Bool -> Bool [assoc comm prec 55 gather (e E)] . |
| 183 |
op _or_ : Bool Bool -> Bool [assoc comm prec 59 gather (e E)] . |
| 184 |
op _xor_ : Bool Bool -> Bool [assoc comm prec 57 gather (e E)] . |
| 185 |
op not_ : Bool -> Bool [prec 53 gather (E)] . |
| 186 |
op _implies_ : Bool Bool -> Bool [prec 61 gather (e E)] . |
| 187 |
op none : -> AttributeSet [ctor] . |
| 188 |
op _,_ : AttributeSet AttributeSet -> AttributeSet [ctor assoc comm id: none |
| 189 |
prec 41 gather (e E)] . |
| 190 |
op <_:_|_> : Oid Cid AttributeSet -> Object [ctor obj prec 0 gather (& & &) |
| 191 |
special ( |
| 192 |
id-hook ObjectConstructorSymbol |
| 193 |
op-hook attributeSetSymbol (_,_ : AttributeSet AttributeSet ~> |
| 194 |
AttributeSet))] . |
| 195 |
op none : -> Configuration [ctor] . |
| 196 |
op __ : Configuration Configuration -> Configuration [ctor assoc comm id: |
| 197 |
none config prec 41 gather (e E)] . |
| 198 |
op <> : -> Portal [ctor portal] . |
| 199 |
op getClass : Object -> Cid . |
| 200 |
op replace : Oid Y$Elt -> Msg [ctor msg] . |
| 201 |
op Bag{Y} : -> Bag{Y} [ctor] . |
| 202 |
op contents :_ : Y$Elt -> Attribute [ctor prec 15 gather (&)] . |
| 203 |
op 0 : -> Zero [ctor] . |
| 204 |
op s_ : Nat -> NzNat [ctor iter prec 15 gather (E) special ( |
| 205 |
id-hook SuccSymbol |
| 206 |
term-hook zeroTerm (0))] . |
| 207 |
op _+_ : NzNat Nat -> NzNat [assoc comm prec 33 gather (e E) special ( |
| 208 |
id-hook ACU_NumberOpSymbol (+) |
| 209 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 210 |
op _+_ : Nat Nat -> Nat [assoc comm prec 33 gather (e E) special ( |
| 211 |
id-hook ACU_NumberOpSymbol (+) |
| 212 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 213 |
op sd : Nat Nat -> Nat [comm special ( |
| 214 |
id-hook CUI_NumberOpSymbol (sd) |
| 215 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 216 |
op _*_ : NzNat NzNat -> NzNat [assoc comm prec 31 gather (e E) special ( |
| 217 |
id-hook ACU_NumberOpSymbol (*) |
| 218 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 219 |
op _*_ : Nat Nat -> Nat [assoc comm prec 31 gather (e E) special ( |
| 220 |
id-hook ACU_NumberOpSymbol (*) |
| 221 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 222 |
op _quo_ : Nat NzNat -> Nat [prec 31 gather (E e) special ( |
| 223 |
id-hook NumberOpSymbol (quo) |
| 224 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 225 |
op _rem_ : Nat NzNat -> Nat [prec 31 gather (E e) special ( |
| 226 |
id-hook NumberOpSymbol (rem) |
| 227 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 228 |
op _^_ : Nat Nat -> Nat [prec 29 gather (E e) special ( |
| 229 |
id-hook NumberOpSymbol (^) |
| 230 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 231 |
op _^_ : NzNat Nat -> NzNat [prec 29 gather (E e) special ( |
| 232 |
id-hook NumberOpSymbol (^) |
| 233 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 234 |
op modExp : [FindResult] [FindResult] [FindResult] -> [FindResult] [special ( |
| 235 |
id-hook NumberOpSymbol (modExp) |
| 236 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 237 |
op gcd : NzNat Nat -> NzNat [assoc comm special ( |
| 238 |
id-hook ACU_NumberOpSymbol (gcd) |
| 239 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 240 |
op gcd : Nat Nat -> Nat [assoc comm special ( |
| 241 |
id-hook ACU_NumberOpSymbol (gcd) |
| 242 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 243 |
op lcm : NzNat NzNat -> NzNat [assoc comm special ( |
| 244 |
id-hook ACU_NumberOpSymbol (lcm) |
| 245 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 246 |
op lcm : Nat Nat -> Nat [assoc comm special ( |
| 247 |
id-hook ACU_NumberOpSymbol (lcm) |
| 248 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 249 |
op min : NzNat NzNat -> NzNat [assoc comm special ( |
| 250 |
id-hook ACU_NumberOpSymbol (min) |
| 251 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 252 |
op min : Nat Nat -> Nat [assoc comm special ( |
| 253 |
id-hook ACU_NumberOpSymbol (min) |
| 254 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 255 |
op max : NzNat Nat -> NzNat [assoc comm special ( |
| 256 |
id-hook ACU_NumberOpSymbol (max) |
| 257 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 258 |
op max : Nat Nat -> Nat [assoc comm special ( |
| 259 |
id-hook ACU_NumberOpSymbol (max) |
| 260 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 261 |
op _xor_ : Nat Nat -> Nat [assoc comm prec 55 gather (e E) special ( |
| 262 |
id-hook ACU_NumberOpSymbol (xor) |
| 263 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 264 |
op _&_ : Nat Nat -> Nat [assoc comm prec 53 gather (e E) special ( |
| 265 |
id-hook ACU_NumberOpSymbol (&) |
| 266 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 267 |
op _|_ : NzNat Nat -> NzNat [assoc comm prec 57 gather (e E) special ( |
| 268 |
id-hook ACU_NumberOpSymbol (|) |
| 269 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 270 |
op _|_ : Nat Nat -> Nat [assoc comm prec 57 gather (e E) special ( |
| 271 |
id-hook ACU_NumberOpSymbol (|) |
| 272 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 273 |
op _>>_ : Nat Nat -> Nat [prec 35 gather (E e) special ( |
| 274 |
id-hook NumberOpSymbol (>>) |
| 275 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 276 |
op _<<_ : Nat Nat -> Nat [prec 35 gather (E e) special ( |
| 277 |
id-hook NumberOpSymbol (<<) |
| 278 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 279 |
op _<_ : Nat Nat -> Bool [prec 37 gather (E E) special ( |
| 280 |
id-hook NumberOpSymbol (<) |
| 281 |
op-hook succSymbol (s_ : Nat ~> NzNat) |
| 282 |
term-hook trueTerm (true) |
| 283 |
term-hook falseTerm (false))] . |
| 284 |
op _<=_ : Nat Nat -> Bool [prec 37 gather (E E) special ( |
| 285 |
id-hook NumberOpSymbol (<=) |
| 286 |
op-hook succSymbol (s_ : Nat ~> NzNat) |
| 287 |
term-hook trueTerm (true) |
| 288 |
term-hook falseTerm (false))] . |
| 289 |
op _>_ : Nat Nat -> Bool [prec 37 gather (E E) special ( |
| 290 |
id-hook NumberOpSymbol (>) |
| 291 |
op-hook succSymbol (s_ : Nat ~> NzNat) |
| 292 |
term-hook trueTerm (true) |
| 293 |
term-hook falseTerm (false))] . |
| 294 |
op _>=_ : Nat Nat -> Bool [prec 37 gather (E E) special ( |
| 295 |
id-hook NumberOpSymbol (>=) |
| 296 |
op-hook succSymbol (s_ : Nat ~> NzNat) |
| 297 |
term-hook trueTerm (true) |
| 298 |
term-hook falseTerm (false))] . |
| 299 |
op _divides_ : NzNat Nat -> Bool [prec 51 gather (E E) special ( |
| 300 |
id-hook NumberOpSymbol (divides) |
| 301 |
op-hook succSymbol (s_ : Nat ~> NzNat) |
| 302 |
term-hook trueTerm (true) |
| 303 |
term-hook falseTerm (false))] . |
| 304 |
op <Strings> : -> Char [special ( |
| 305 |
id-hook StringSymbol)] . |
| 306 |
op <Strings> : -> String [special ( |
| 307 |
id-hook StringSymbol)] . |
| 308 |
op notFound : -> FindResult [ctor] . |
| 309 |
op ascii : Char -> Nat [special ( |
| 310 |
id-hook StringOpSymbol (ascii) |
| 311 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 312 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 313 |
op char : [FindResult] -> [String] [special ( |
| 314 |
id-hook StringOpSymbol (char) |
| 315 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 316 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 317 |
op _+_ : String String -> String [prec 33 gather (E e) special ( |
| 318 |
id-hook StringOpSymbol (+) |
| 319 |
op-hook stringSymbol (<Strings> : ~> Char))] . |
| 320 |
op length : String -> Nat [special ( |
| 321 |
id-hook StringOpSymbol (length) |
| 322 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 323 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 324 |
op substr : String Nat Nat -> String [special ( |
| 325 |
id-hook StringOpSymbol (substr) |
| 326 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 327 |
op-hook succSymbol (s_ : Nat ~> NzNat))] . |
| 328 |
op find : String String Nat -> FindResult [special ( |
| 329 |
id-hook StringOpSymbol (find) |
| 330 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 331 |
op-hook succSymbol (s_ : Nat ~> NzNat) |
| 332 |
term-hook notFoundTerm (notFound))] . |
| 333 |
op rfind : String String Nat -> FindResult [special ( |
| 334 |
id-hook StringOpSymbol (rfind) |
| 335 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 336 |
op-hook succSymbol (s_ : Nat ~> NzNat) |
| 337 |
term-hook notFoundTerm (notFound))] . |
| 338 |
op _<_ : String String -> Bool [prec 37 gather (E E) special ( |
| 339 |
id-hook StringOpSymbol (<) |
| 340 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 341 |
term-hook trueTerm (true) |
| 342 |
term-hook falseTerm (false))] . |
| 343 |
op _<=_ : String String -> Bool [prec 37 gather (E E) special ( |
| 344 |
id-hook StringOpSymbol (<=) |
| 345 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 346 |
term-hook trueTerm (true) |
| 347 |
term-hook falseTerm (false))] . |
| 348 |
op _>_ : String String -> Bool [prec 37 gather (E E) special ( |
| 349 |
id-hook StringOpSymbol (>) |
| 350 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 351 |
term-hook trueTerm (true) |
| 352 |
term-hook falseTerm (false))] . |
| 353 |
op _>=_ : String String -> Bool [prec 37 gather (E E) special ( |
| 354 |
id-hook StringOpSymbol (>=) |
| 355 |
op-hook stringSymbol (<Strings> : ~> Char) |
| 356 |
term-hook trueTerm (true) |
| 357 |
term-hook falseTerm (false))] . |
| 358 |
op upperCase : String -> String [special ( |
| 359 |
id-hook StringOpSymbol (upperCase) |
| 360 |
op-hook stringSymbol (<Strings> : ~> Char))] . |
| 361 |
op lowerCase : String -> String [special ( |
| 362 |
id-hook StringOpSymbol (lowerCase) |
| 363 |
op-hook stringSymbol (<Strings> : ~> Char))] . |
| 364 |
op <Qids> : -> Qid [special ( |
| 365 |
id-hook QuotedIdentifierSymbol)] . |
| 366 |
op string : Qid -> String [special ( |
| 367 |
id-hook QuotedIdentifierOpSymbol (string) |
| 368 |
op-hook quotedIdentifierSymbol (<Qids> : ~> Qid) |
| 369 |
op-hook stringSymbol (<Strings> : ~> Char))] . |
| 370 |
op qid : [String] -> [Oid] [special ( |
| 371 |
id-hook QuotedIdentifierOpSymbol (qid) |
| 372 |
op-hook quotedIdentifierSymbol (<Qids> : ~> Qid) |
| 373 |
op-hook stringSymbol (<Strings> : ~> Char))] . |
| 374 |
op init : Y$Elt -> Configuration . |
| 375 |
eq true and A:Bool = A:Bool . |
| 376 |
eq false and A:Bool = false . |
| 377 |
eq A:Bool and A:Bool = A:Bool . |
| 378 |
eq false xor A:Bool = A:Bool . |
| 379 |
eq A:Bool xor A:Bool = false . |
| 380 |
eq A:Bool and (B:Bool xor C:Bool) = A:Bool and B:Bool xor A:Bool and C:Bool . |
| 381 |
eq not A:Bool = true xor A:Bool . |
| 382 |
eq A:Bool or B:Bool = A:Bool and B:Bool xor A:Bool xor B:Bool . |
| 383 |
eq A:Bool implies B:Bool = not (A:Bool xor A:Bool and B:Bool) . |
| 384 |
eq getClass(< O:Oid : C:Cid | A:AttributeSet >) = C:Cid . |
| 385 |
eq init(X:Y$Elt) = < 'a : Bag{Y} | contents : X:Y$Elt > . |
| 386 |
rl replace(R:Oid, D:Y$Elt) < R:Oid : V:Bag{Y} | Atts:AttributeSet, contents : |
| 387 |
A:[Y$Elt] > => < R:Oid : V:Bag{Y} | Atts:AttributeSet, contents : D:Y$Elt > |
| 388 |
. |
| 389 |
endm |
| 390 |
op _`,_ left-identity collapse from AttributeSet to Attribute is unequal. |
| 391 |
op __ left-identity collapse from Configuration to Object is unequal. |
| 392 |
========================================== |
| 393 |
reduce in TEST : init(42) . |
| 394 |
rewrites: 1 |
| 395 |
result Object: < 'a : Bag{Nat} | contents : 42 > |
| 396 |
========================================== |
| 397 |
rewrite in TEST : init(42) replace('a, 13) . |
| 398 |
rewrites: 2 |
| 399 |
result Object: < 'a : Bag{Nat} | contents : 13 > |
| 400 |
Bye. |