Debian Codegraph @

tests/ObjectOriented/account.expected

raw
1 Considering object completion on:
2 rl [credit] : credit(A, M) < A : Account | bal : N > => < A : Account | bal :
3 (N + M) > .
4 Transformed rule:
5 rl [credit] : credit(A, M) < A : V:Account | bal : N, Atts:AttributeSet > =>
6 < A : V:Account | bal : (N + M), Atts:AttributeSet > .
7
8 Considering object completion on:
9 crl [debit] : debit(A, M) < A : Account | bal : N > => < A : Account | bal :
10 (N - M) > if N >= M = true .
11 Transformed rule:
12 crl [debit] : debit(A, M) < A : V:Account | bal : N, Atts:AttributeSet > => <
13 A : V:Account | bal : (N - M), Atts:AttributeSet > if N >= M = true .
14
15 Considering object completion on:
16 crl [transfer] : (from A to B transfer M) < A : Account | bal : N > < B :
17 Account | bal : N' > => < A : Account | bal : (N - M) > < B : Account | bal
18 : (N' + M) > if N >= M = true .
19 Transformed rule:
20 crl [transfer] : (from A to B transfer M) < A : V:Account | bal : N,
21 Atts:AttributeSet > < B : V2:Account | bal : N', Atts2:AttributeSet > => <
22 A : V:Account | bal : (N - M), Atts:AttributeSet > < B : V2:Account | bal :
23 (N' + M), Atts2:AttributeSet > if N >= M = true .
24
25 op _`,_ left-identity collapse from AttributeSet to Attribute is unequal.
26 op __ left-identity collapse from Configuration to Object is unequal.
27 ==========================================
28 rewrite in SAVING-ACCOUNT : debit('A-06238, 1000) < 'A-06238 : Account | bal :
29 2000 > .
30 rewrites: 3
31 result Object: < 'A-06238 : Account | bal : 1000 >
32 ==========================================
33 rewrite in SAVING-ACCOUNT : ((((credit('A-28381, 200) credit('A-73728, 1300))
34 debit('A-06238, 1000)) < 'A-28381 : SavingAccount | bal : 9000, rate : 3.0
35 >) < 'A-06238 : Account | bal : 2000 >) < 'A-73728 : SavingAccount | bal :
36 5000, rate : 3.0 > .
37 rewrites: 7
38 result Configuration: < 'A-06238 : Account | bal : 1000 > < 'A-28381 :
39 SavingAccount | bal : 9200, rate : 3.0 > < 'A-73728 : SavingAccount | bal :
40 6300, rate : 3.0 >
41 ==========================================
42 search in SAVING-ACCOUNT : ((((credit('A-28381, 200) credit('A-73728, 1300))
43 debit('A-06238, 1000)) < 'A-28381 : SavingAccount | bal : 9000, rate : 3.0
44 >) < 'A-06238 : Account | bal : 2000 >) < 'A-73728 : SavingAccount | bal :
45 5000, rate : 3.0 > =>! C:Configuration < O:Oid : Account | bal : N:Nat >
46 such that N:Nat < 8000 = true .
47
48 Solution 1 (state 7)
49 states: 8 rewrites: 29
50 C:Configuration --> < 'A-28381 : SavingAccount | bal : 9200, rate : 3.0 > <
51 'A-73728 : SavingAccount | bal : 6300, rate : 3.0 >
52 O:Oid --> 'A-06238
53 N:Nat --> 1000
54
55 No more solutions.
56 states: 8 rewrites: 29
57 Bye.