diff --git a/README.md b/README.md index 30ed8c10..73bbf161 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ game main() { // Host hides the car (compiler generates commitment); // if Host does not play, Guest gets the entire pot - yield Host(car: hidden door) || { Guest -> 40 }; + commit Host(car: door) || { Guest -> 40 }; // Guest makes a public choice yield Guest(d: door) || { Host -> 40 }; diff --git a/Vegas.g4 b/Vegas.g4 index 6056c8ab..29a74dad 100644 --- a/Vegas.g4 +++ b/Vegas.g4 @@ -26,8 +26,8 @@ typeExp | name=typeId # IdTypeExp ; -ext : kind=('join' | 'yield' | 'reveal' | 'random') query+ ';' ext # ReceiveExt - | 'withdraw' outcome # WithdrawExt +ext : kind=('join' | 'yield' | 'reveal' | 'commit' | 'random') query+ ';' ext # ReceiveExt + | 'withdraw' outcome # WithdrawExt ; query : role=roleId ('(' (decls+=varDec (',' decls+=varDec)*)? ')')? ('$' deposit=INT)? ('where' cond=exp)? ('||' handler=outcome)? ; @@ -60,7 +60,7 @@ exp | 'let!' dec=varDec '=' init=exp 'in' body=exp # LetExp ; -varDec : name=varId ':' hidden='hidden'? type=typeExp; +varDec : name=varId ':' type=typeExp; typeId: LOWER_ID ; varId : LOWER_ID; diff --git a/examples/AtomicSwap.vg b/examples/AtomicSwap.vg index ca1ac188..1d433d14 100644 --- a/examples/AtomicSwap.vg +++ b/examples/AtomicSwap.vg @@ -7,7 +7,7 @@ game main() { join Alice() $ 10 Bob() $ 10; // Alice commits to the pre-image (the secret key) - yield Alice(secret: hidden int) || { Bob -> 20 }; + commit Alice(secret: int) || { Bob -> 20 }; // Bob inspects the commitment (abstractly) and funds the contract yield Bob(fund: bool) || { Alice -> 20 }; diff --git a/examples/GasPriceAuction.vg b/examples/GasPriceAuction.vg index e34f7917..e6c66751 100644 --- a/examples/GasPriceAuction.vg +++ b/examples/GasPriceAuction.vg @@ -7,7 +7,7 @@ type bid = {0 .. 8} game main() { join Miner() $ 100 Client() $ 100; - yield Miner(t: hidden thr) || { Client -> 200 }; + commit Miner(t: thr) || { Client -> 200 }; yield Client(b: bid) || { Miner -> 200 }; yield Miner(accept: bool) || { Client -> 200 }; reveal Miner(t: thr); diff --git a/examples/HiddenReserve.vg b/examples/HiddenReserve.vg index 113f4d1a..59a33ecf 100644 --- a/examples/HiddenReserve.vg +++ b/examples/HiddenReserve.vg @@ -7,7 +7,7 @@ type reserve = {3 .. 7} game main() { join Seller() $ 100 Buyer() $ 100; - yield Seller(r: hidden reserve) || { Buyer -> 200 }; + commit Seller(r: reserve) || { Buyer -> 200 }; yield Buyer(b: price) || { Seller -> 200 }; yield Seller(accept: bool) || { Buyer -> 200 }; reveal Seller(r: reserve); diff --git a/examples/MontyHall.vg b/examples/MontyHall.vg index 9d73e58e..917b0cfe 100644 --- a/examples/MontyHall.vg +++ b/examples/MontyHall.vg @@ -16,7 +16,7 @@ type door = {0, 1, 2} game main() { join Host() $ 20; join Guest() $ 20; - yield Host(car: hidden door) || { Guest -> 40 }; + commit Host(car: door) || { Guest -> 40 }; yield Guest(d: door) || { Host -> 40 }; yield Host(goat: door) where Host.goat != Guest.d || { Guest -> 40 }; yield Guest(switch: bool) || { Host -> 40 }; diff --git a/examples/MontyHallChance.vg b/examples/MontyHallChance.vg index 24e4fe2f..0060fa2f 100644 --- a/examples/MontyHallChance.vg +++ b/examples/MontyHallChance.vg @@ -6,7 +6,7 @@ type door = {0, 1, 2} game main() { random Host() $ 100; join Guest() $ 100; - yield Host(car: hidden door); + commit Host(car: door); yield Guest(d: door) || { Host -> 200 }; yield Host(goat: door) where Host.goat != Guest.d && Host.goat != Host.car; yield Guest(switch: bool) || { Host -> 200 }; diff --git a/examples/RPSLS.vg b/examples/RPSLS.vg index e046c06d..44a810fd 100644 --- a/examples/RPSLS.vg +++ b/examples/RPSLS.vg @@ -11,8 +11,8 @@ macro p1Wins(h1: hand, h2: hand): bool = (mod5(h1 - h2 + 5) == 1 || mod5(h1 - h2 game main() { join P1() $ 100 P2() $ 100; - yield P1(h: hidden hand) || { P2 -> 200 }; - yield P2(h: hidden hand) || { P1 -> 200 }; + commit P1(h: hand) || { P2 -> 200 }; + commit P2(h: hand) || { P1 -> 200 }; reveal P1(h: hand) || { P2 -> 200 }; reveal P2(h: hand) || { P1 -> 200 }; diff --git a/examples/RandomLeader.vg b/examples/RandomLeader.vg index 83a270eb..14a741dc 100644 --- a/examples/RandomLeader.vg +++ b/examples/RandomLeader.vg @@ -4,9 +4,8 @@ game main() { join V1() $ 100 V2() $ 100 V3() $ 100; - yield V1(b: hidden bool) V2(b: hidden bool) V3(b: hidden bool); - - reveal V1(b: bool) V2(b: bool) V3(b: bool); + // Simultaneous yield auto-expands to commit+reveal with front-running protection + yield V1(b: bool) V2(b: bool) V3(b: bool); withdraw (V1.b != null && V2.b != null && V3.b != null) ? { diff --git a/examples/Simple.vg b/examples/Simple.vg index 25f9cecb..135be3c1 100644 --- a/examples/Simple.vg +++ b/examples/Simple.vg @@ -11,7 +11,7 @@ game main() { join A() $ 6; join B() $ 6; - yield A(c: hidden bool) || { B -> 12 }; + commit A(c: bool) || { B -> 12 }; yield B(c: bool) || { A -> 12 }; reveal A(c: bool); withdraw { A -> (A.c != B.c) ? 9 : 3 ; // Fair play: winner gets 9, loser gets 3 diff --git a/examples/StakeAndVote.vg b/examples/StakeAndVote.vg index 7be761ce..c981e800 100644 --- a/examples/StakeAndVote.vg +++ b/examples/StakeAndVote.vg @@ -4,7 +4,7 @@ game main() { join V1() $ 100 V2() $ 100 Protocol() $ 100; - yield Protocol(correct: hidden bool); + commit Protocol(correct: bool); yield V1(v: bool) V2(v: bool); diff --git a/examples/VickreyAuction.vg b/examples/VickreyAuction.vg index 48e1007f..18f9cf3f 100644 --- a/examples/VickreyAuction.vg +++ b/examples/VickreyAuction.vg @@ -17,9 +17,9 @@ game main() { // Bids are hidden to prevent price matching/adjusting // Sequential yields with handlers - if a bidder quits, they forfeit their deposit to Seller - yield B1(b: hidden bid) || { Seller -> 200; B2 -> 100; B3 -> 100 }; - yield B2(b: hidden bid) || { Seller -> 200; B1 -> 100; B3 -> 100 }; - yield B3(b: hidden bid) || { Seller -> 200; B1 -> 100; B2 -> 100 }; + commit B1(b: bid) || { Seller -> 200; B2 -> 100; B3 -> 100 }; + commit B2(b: bid) || { Seller -> 200; B1 -> 100; B3 -> 100 }; + commit B3(b: bid) || { Seller -> 200; B1 -> 100; B2 -> 100 }; reveal B1(b: bid); reveal B2(b: bid); diff --git a/src/main/java/vegas/generated/VegasLexer.java b/src/main/java/vegas/generated/VegasLexer.java index 284bf571..4fe66d7b 100644 --- a/src/main/java/vegas/generated/VegasLexer.java +++ b/src/main/java/vegas/generated/VegasLexer.java @@ -49,11 +49,11 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { null, "'game'", "'('", "')'", "'{'", "'}'", "'type'", "'='", "'macro'", - "','", "':'", "';'", "'..'", "'join'", "'yield'", "'reveal'", "'random'", - "'withdraw'", "'$'", "'where'", "'||'", "'?'", "'let'", "'in'", "'->'", - "'.'", "'-'", "'!'", "'*'", "'/'", "'%'", "'+'", "'!='", "'=='", "'null'", - "'<'", "'<='", "'>='", "'>'", "'<->'", "'<-!->'", "'&&'", "'true'", "'false'", - "'let!'", "'hidden'" + "','", "':'", "';'", "'..'", "'join'", "'yield'", "'reveal'", "'commit'", + "'random'", "'withdraw'", "'$'", "'where'", "'||'", "'?'", "'let'", "'in'", + "'->'", "'.'", "'-'", "'!'", "'*'", "'/'", "'%'", "'+'", "'!='", "'=='", + "'null'", "'<'", "'<='", "'>='", "'>'", "'<->'", "'<-!->'", "'&&'", "'true'", + "'false'", "'let!'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); @@ -151,193 +151,194 @@ public VegasLexer(CharStream input) { "\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0001"+ "\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001\u000f\u0001"+ "\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001\u0010\u0001"+ - "\u0010\u0001\u0010\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0012\u0001"+ - "\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0013\u0001"+ - "\u0013\u0001\u0013\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0001"+ - "\u0015\u0001\u0015\u0001\u0016\u0001\u0016\u0001\u0016\u0001\u0017\u0001"+ - "\u0017\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001"+ - "\u001a\u0001\u001a\u0001\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0001"+ - "\u001d\u0001\u001d\u0001\u001e\u0001\u001e\u0001\u001f\u0001\u001f\u0001"+ - "\u001f\u0001 \u0001 \u0001 \u0001!\u0001!\u0001!\u0001!\u0001!\u0001\""+ - "\u0001\"\u0001#\u0001#\u0001#\u0001$\u0001$\u0001$\u0001%\u0001%\u0001"+ - "&\u0001&\u0001&\u0001&\u0001\'\u0001\'\u0001\'\u0001\'\u0001\'\u0001\'"+ - "\u0001(\u0001(\u0001(\u0001)\u0001)\u0001)\u0001)\u0001)\u0001*\u0001"+ - "*\u0001*\u0001*\u0001*\u0001*\u0001+\u0001+\u0001+\u0001+\u0001+\u0001"+ - ",\u0001,\u0001,\u0001,\u0001,\u0001,\u0001,\u0001-\u0001-\u0005-\u0111"+ - "\b-\n-\f-\u0114\t-\u0001.\u0001.\u0005.\u0118\b.\n.\f.\u011b\t.\u0001"+ - "/\u0001/\u0005/\u011f\b/\n/\f/\u0122\t/\u0001/\u0003/\u0125\b/\u00010"+ - "\u00010\u00010\u00010\u00010\u00050\u012c\b0\n0\f0\u012f\t0\u00010\u0003"+ - "0\u0132\b0\u00011\u00011\u00051\u0136\b1\n1\f1\u0139\t1\u00011\u00011"+ - "\u00012\u00012\u00012\u00012\u00052\u0141\b2\n2\f2\u0144\t2\u00012\u0001"+ - "2\u00012\u00012\u00012\u00013\u00013\u00013\u00013\u00053\u014f\b3\n3"+ - "\f3\u0152\t3\u00013\u00013\u00014\u00044\u0157\b4\u000b4\f4\u0158\u0001"+ - "4\u00014\u0001\u0142\u00005\u0001\u0001\u0003\u0002\u0005\u0003\u0007"+ - "\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015\u000b"+ - "\u0017\f\u0019\r\u001b\u000e\u001d\u000f\u001f\u0010!\u0011#\u0012%\u0013"+ - "\'\u0014)\u0015+\u0016-\u0017/\u00181\u00193\u001a5\u001b7\u001c9\u001d"+ - ";\u001e=\u001f? A!C\"E#G$I%K&M\'O(Q)S*U+W,Y-[.]/_0a1c2e3g4i5\u0001\u0000"+ - "\u000b\u0001\u0000AZ\u0004\u000009AZ__az\u0001\u0000az\u0001\u000019\u0001"+ - "\u000009\u0001\u000000\u0003\u000019AFaf\u0003\u000009AFaf\u0002\u0000"+ - "\"\"\\\\\u0001\u0000\n\n\u0003\u0000\t\n\r\r \u0165\u0000\u0001\u0001"+ - "\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001"+ - "\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000"+ - "\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000"+ - "\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000"+ - "\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000"+ - "\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000"+ - "\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000\u0000"+ - "\u0000\u0000\u001f\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000\u0000"+ - "\u0000#\u0001\u0000\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000\'"+ - "\u0001\u0000\u0000\u0000\u0000)\u0001\u0000\u0000\u0000\u0000+\u0001\u0000"+ - "\u0000\u0000\u0000-\u0001\u0000\u0000\u0000\u0000/\u0001\u0000\u0000\u0000"+ - "\u00001\u0001\u0000\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u00005"+ - "\u0001\u0000\u0000\u0000\u00007\u0001\u0000\u0000\u0000\u00009\u0001\u0000"+ - "\u0000\u0000\u0000;\u0001\u0000\u0000\u0000\u0000=\u0001\u0000\u0000\u0000"+ - "\u0000?\u0001\u0000\u0000\u0000\u0000A\u0001\u0000\u0000\u0000\u0000C"+ - "\u0001\u0000\u0000\u0000\u0000E\u0001\u0000\u0000\u0000\u0000G\u0001\u0000"+ - "\u0000\u0000\u0000I\u0001\u0000\u0000\u0000\u0000K\u0001\u0000\u0000\u0000"+ - "\u0000M\u0001\u0000\u0000\u0000\u0000O\u0001\u0000\u0000\u0000\u0000Q"+ - "\u0001\u0000\u0000\u0000\u0000S\u0001\u0000\u0000\u0000\u0000U\u0001\u0000"+ - "\u0000\u0000\u0000W\u0001\u0000\u0000\u0000\u0000Y\u0001\u0000\u0000\u0000"+ - "\u0000[\u0001\u0000\u0000\u0000\u0000]\u0001\u0000\u0000\u0000\u0000_"+ - "\u0001\u0000\u0000\u0000\u0000a\u0001\u0000\u0000\u0000\u0000c\u0001\u0000"+ - "\u0000\u0000\u0000e\u0001\u0000\u0000\u0000\u0000g\u0001\u0000\u0000\u0000"+ - "\u0000i\u0001\u0000\u0000\u0000\u0001k\u0001\u0000\u0000\u0000\u0003p"+ - "\u0001\u0000\u0000\u0000\u0005r\u0001\u0000\u0000\u0000\u0007t\u0001\u0000"+ - "\u0000\u0000\tv\u0001\u0000\u0000\u0000\u000bx\u0001\u0000\u0000\u0000"+ - "\r}\u0001\u0000\u0000\u0000\u000f\u007f\u0001\u0000\u0000\u0000\u0011"+ - "\u0085\u0001\u0000\u0000\u0000\u0013\u0087\u0001\u0000\u0000\u0000\u0015"+ - "\u0089\u0001\u0000\u0000\u0000\u0017\u008b\u0001\u0000\u0000\u0000\u0019"+ - "\u008e\u0001\u0000\u0000\u0000\u001b\u0093\u0001\u0000\u0000\u0000\u001d"+ - "\u0099\u0001\u0000\u0000\u0000\u001f\u00a0\u0001\u0000\u0000\u0000!\u00a7"+ - "\u0001\u0000\u0000\u0000#\u00b0\u0001\u0000\u0000\u0000%\u00b2\u0001\u0000"+ - "\u0000\u0000\'\u00b8\u0001\u0000\u0000\u0000)\u00bb\u0001\u0000\u0000"+ - "\u0000+\u00bd\u0001\u0000\u0000\u0000-\u00c1\u0001\u0000\u0000\u0000/"+ - "\u00c4\u0001\u0000\u0000\u00001\u00c7\u0001\u0000\u0000\u00003\u00c9\u0001"+ - "\u0000\u0000\u00005\u00cb\u0001\u0000\u0000\u00007\u00cd\u0001\u0000\u0000"+ - "\u00009\u00cf\u0001\u0000\u0000\u0000;\u00d1\u0001\u0000\u0000\u0000="+ - "\u00d3\u0001\u0000\u0000\u0000?\u00d5\u0001\u0000\u0000\u0000A\u00d8\u0001"+ - "\u0000\u0000\u0000C\u00db\u0001\u0000\u0000\u0000E\u00e0\u0001\u0000\u0000"+ - "\u0000G\u00e2\u0001\u0000\u0000\u0000I\u00e5\u0001\u0000\u0000\u0000K"+ - "\u00e8\u0001\u0000\u0000\u0000M\u00ea\u0001\u0000\u0000\u0000O\u00ee\u0001"+ - "\u0000\u0000\u0000Q\u00f4\u0001\u0000\u0000\u0000S\u00f7\u0001\u0000\u0000"+ - "\u0000U\u00fc\u0001\u0000\u0000\u0000W\u0102\u0001\u0000\u0000\u0000Y"+ - "\u0107\u0001\u0000\u0000\u0000[\u010e\u0001\u0000\u0000\u0000]\u0115\u0001"+ - "\u0000\u0000\u0000_\u0124\u0001\u0000\u0000\u0000a\u0126\u0001\u0000\u0000"+ - "\u0000c\u0133\u0001\u0000\u0000\u0000e\u013c\u0001\u0000\u0000\u0000g"+ - "\u014a\u0001\u0000\u0000\u0000i\u0156\u0001\u0000\u0000\u0000kl\u0005"+ - "g\u0000\u0000lm\u0005a\u0000\u0000mn\u0005m\u0000\u0000no\u0005e\u0000"+ - "\u0000o\u0002\u0001\u0000\u0000\u0000pq\u0005(\u0000\u0000q\u0004\u0001"+ - "\u0000\u0000\u0000rs\u0005)\u0000\u0000s\u0006\u0001\u0000\u0000\u0000"+ - "tu\u0005{\u0000\u0000u\b\u0001\u0000\u0000\u0000vw\u0005}\u0000\u0000"+ - "w\n\u0001\u0000\u0000\u0000xy\u0005t\u0000\u0000yz\u0005y\u0000\u0000"+ - "z{\u0005p\u0000\u0000{|\u0005e\u0000\u0000|\f\u0001\u0000\u0000\u0000"+ - "}~\u0005=\u0000\u0000~\u000e\u0001\u0000\u0000\u0000\u007f\u0080\u0005"+ - "m\u0000\u0000\u0080\u0081\u0005a\u0000\u0000\u0081\u0082\u0005c\u0000"+ - "\u0000\u0082\u0083\u0005r\u0000\u0000\u0083\u0084\u0005o\u0000\u0000\u0084"+ - "\u0010\u0001\u0000\u0000\u0000\u0085\u0086\u0005,\u0000\u0000\u0086\u0012"+ - "\u0001\u0000\u0000\u0000\u0087\u0088\u0005:\u0000\u0000\u0088\u0014\u0001"+ - "\u0000\u0000\u0000\u0089\u008a\u0005;\u0000\u0000\u008a\u0016\u0001\u0000"+ - "\u0000\u0000\u008b\u008c\u0005.\u0000\u0000\u008c\u008d\u0005.\u0000\u0000"+ - "\u008d\u0018\u0001\u0000\u0000\u0000\u008e\u008f\u0005j\u0000\u0000\u008f"+ - "\u0090\u0005o\u0000\u0000\u0090\u0091\u0005i\u0000\u0000\u0091\u0092\u0005"+ - "n\u0000\u0000\u0092\u001a\u0001\u0000\u0000\u0000\u0093\u0094\u0005y\u0000"+ - "\u0000\u0094\u0095\u0005i\u0000\u0000\u0095\u0096\u0005e\u0000\u0000\u0096"+ - "\u0097\u0005l\u0000\u0000\u0097\u0098\u0005d\u0000\u0000\u0098\u001c\u0001"+ - "\u0000\u0000\u0000\u0099\u009a\u0005r\u0000\u0000\u009a\u009b\u0005e\u0000"+ - "\u0000\u009b\u009c\u0005v\u0000\u0000\u009c\u009d\u0005e\u0000\u0000\u009d"+ - "\u009e\u0005a\u0000\u0000\u009e\u009f\u0005l\u0000\u0000\u009f\u001e\u0001"+ - "\u0000\u0000\u0000\u00a0\u00a1\u0005r\u0000\u0000\u00a1\u00a2\u0005a\u0000"+ - "\u0000\u00a2\u00a3\u0005n\u0000\u0000\u00a3\u00a4\u0005d\u0000\u0000\u00a4"+ - "\u00a5\u0005o\u0000\u0000\u00a5\u00a6\u0005m\u0000\u0000\u00a6 \u0001"+ - "\u0000\u0000\u0000\u00a7\u00a8\u0005w\u0000\u0000\u00a8\u00a9\u0005i\u0000"+ - "\u0000\u00a9\u00aa\u0005t\u0000\u0000\u00aa\u00ab\u0005h\u0000\u0000\u00ab"+ - "\u00ac\u0005d\u0000\u0000\u00ac\u00ad\u0005r\u0000\u0000\u00ad\u00ae\u0005"+ - "a\u0000\u0000\u00ae\u00af\u0005w\u0000\u0000\u00af\"\u0001\u0000\u0000"+ - "\u0000\u00b0\u00b1\u0005$\u0000\u0000\u00b1$\u0001\u0000\u0000\u0000\u00b2"+ - "\u00b3\u0005w\u0000\u0000\u00b3\u00b4\u0005h\u0000\u0000\u00b4\u00b5\u0005"+ - "e\u0000\u0000\u00b5\u00b6\u0005r\u0000\u0000\u00b6\u00b7\u0005e\u0000"+ - "\u0000\u00b7&\u0001\u0000\u0000\u0000\u00b8\u00b9\u0005|\u0000\u0000\u00b9"+ - "\u00ba\u0005|\u0000\u0000\u00ba(\u0001\u0000\u0000\u0000\u00bb\u00bc\u0005"+ - "?\u0000\u0000\u00bc*\u0001\u0000\u0000\u0000\u00bd\u00be\u0005l\u0000"+ - "\u0000\u00be\u00bf\u0005e\u0000\u0000\u00bf\u00c0\u0005t\u0000\u0000\u00c0"+ - ",\u0001\u0000\u0000\u0000\u00c1\u00c2\u0005i\u0000\u0000\u00c2\u00c3\u0005"+ - "n\u0000\u0000\u00c3.\u0001\u0000\u0000\u0000\u00c4\u00c5\u0005-\u0000"+ - "\u0000\u00c5\u00c6\u0005>\u0000\u0000\u00c60\u0001\u0000\u0000\u0000\u00c7"+ - "\u00c8\u0005.\u0000\u0000\u00c82\u0001\u0000\u0000\u0000\u00c9\u00ca\u0005"+ - "-\u0000\u0000\u00ca4\u0001\u0000\u0000\u0000\u00cb\u00cc\u0005!\u0000"+ - "\u0000\u00cc6\u0001\u0000\u0000\u0000\u00cd\u00ce\u0005*\u0000\u0000\u00ce"+ - "8\u0001\u0000\u0000\u0000\u00cf\u00d0\u0005/\u0000\u0000\u00d0:\u0001"+ - "\u0000\u0000\u0000\u00d1\u00d2\u0005%\u0000\u0000\u00d2<\u0001\u0000\u0000"+ - "\u0000\u00d3\u00d4\u0005+\u0000\u0000\u00d4>\u0001\u0000\u0000\u0000\u00d5"+ - "\u00d6\u0005!\u0000\u0000\u00d6\u00d7\u0005=\u0000\u0000\u00d7@\u0001"+ - "\u0000\u0000\u0000\u00d8\u00d9\u0005=\u0000\u0000\u00d9\u00da\u0005=\u0000"+ - "\u0000\u00daB\u0001\u0000\u0000\u0000\u00db\u00dc\u0005n\u0000\u0000\u00dc"+ - "\u00dd\u0005u\u0000\u0000\u00dd\u00de\u0005l\u0000\u0000\u00de\u00df\u0005"+ - "l\u0000\u0000\u00dfD\u0001\u0000\u0000\u0000\u00e0\u00e1\u0005<\u0000"+ - "\u0000\u00e1F\u0001\u0000\u0000\u0000\u00e2\u00e3\u0005<\u0000\u0000\u00e3"+ - "\u00e4\u0005=\u0000\u0000\u00e4H\u0001\u0000\u0000\u0000\u00e5\u00e6\u0005"+ - ">\u0000\u0000\u00e6\u00e7\u0005=\u0000\u0000\u00e7J\u0001\u0000\u0000"+ - "\u0000\u00e8\u00e9\u0005>\u0000\u0000\u00e9L\u0001\u0000\u0000\u0000\u00ea"+ - "\u00eb\u0005<\u0000\u0000\u00eb\u00ec\u0005-\u0000\u0000\u00ec\u00ed\u0005"+ - ">\u0000\u0000\u00edN\u0001\u0000\u0000\u0000\u00ee\u00ef\u0005<\u0000"+ - "\u0000\u00ef\u00f0\u0005-\u0000\u0000\u00f0\u00f1\u0005!\u0000\u0000\u00f1"+ - "\u00f2\u0005-\u0000\u0000\u00f2\u00f3\u0005>\u0000\u0000\u00f3P\u0001"+ - "\u0000\u0000\u0000\u00f4\u00f5\u0005&\u0000\u0000\u00f5\u00f6\u0005&\u0000"+ - "\u0000\u00f6R\u0001\u0000\u0000\u0000\u00f7\u00f8\u0005t\u0000\u0000\u00f8"+ - "\u00f9\u0005r\u0000\u0000\u00f9\u00fa\u0005u\u0000\u0000\u00fa\u00fb\u0005"+ - "e\u0000\u0000\u00fbT\u0001\u0000\u0000\u0000\u00fc\u00fd\u0005f\u0000"+ - "\u0000\u00fd\u00fe\u0005a\u0000\u0000\u00fe\u00ff\u0005l\u0000\u0000\u00ff"+ - "\u0100\u0005s\u0000\u0000\u0100\u0101\u0005e\u0000\u0000\u0101V\u0001"+ - "\u0000\u0000\u0000\u0102\u0103\u0005l\u0000\u0000\u0103\u0104\u0005e\u0000"+ - "\u0000\u0104\u0105\u0005t\u0000\u0000\u0105\u0106\u0005!\u0000\u0000\u0106"+ - "X\u0001\u0000\u0000\u0000\u0107\u0108\u0005h\u0000\u0000\u0108\u0109\u0005"+ - "i\u0000\u0000\u0109\u010a\u0005d\u0000\u0000\u010a\u010b\u0005d\u0000"+ - "\u0000\u010b\u010c\u0005e\u0000\u0000\u010c\u010d\u0005n\u0000\u0000\u010d"+ - "Z\u0001\u0000\u0000\u0000\u010e\u0112\u0007\u0000\u0000\u0000\u010f\u0111"+ - "\u0007\u0001\u0000\u0000\u0110\u010f\u0001\u0000\u0000\u0000\u0111\u0114"+ - "\u0001\u0000\u0000\u0000\u0112\u0110\u0001\u0000\u0000\u0000\u0112\u0113"+ - "\u0001\u0000\u0000\u0000\u0113\\\u0001\u0000\u0000\u0000\u0114\u0112\u0001"+ - "\u0000\u0000\u0000\u0115\u0119\u0007\u0002\u0000\u0000\u0116\u0118\u0007"+ - "\u0001\u0000\u0000\u0117\u0116\u0001\u0000\u0000\u0000\u0118\u011b\u0001"+ - "\u0000\u0000\u0000\u0119\u0117\u0001\u0000\u0000\u0000\u0119\u011a\u0001"+ - "\u0000\u0000\u0000\u011a^\u0001\u0000\u0000\u0000\u011b\u0119\u0001\u0000"+ - "\u0000\u0000\u011c\u0120\u0007\u0003\u0000\u0000\u011d\u011f\u0007\u0004"+ - "\u0000\u0000\u011e\u011d\u0001\u0000\u0000\u0000\u011f\u0122\u0001\u0000"+ - "\u0000\u0000\u0120\u011e\u0001\u0000\u0000\u0000\u0120\u0121\u0001\u0000"+ - "\u0000\u0000\u0121\u0125\u0001\u0000\u0000\u0000\u0122\u0120\u0001\u0000"+ - "\u0000\u0000\u0123\u0125\u0007\u0005\u0000\u0000\u0124\u011c\u0001\u0000"+ - "\u0000\u0000\u0124\u0123\u0001\u0000\u0000\u0000\u0125`\u0001\u0000\u0000"+ - "\u0000\u0126\u0127\u00050\u0000\u0000\u0127\u0128\u0005x\u0000\u0000\u0128"+ - "\u0131\u0001\u0000\u0000\u0000\u0129\u012d\u0007\u0006\u0000\u0000\u012a"+ - "\u012c\u0007\u0007\u0000\u0000\u012b\u012a\u0001\u0000\u0000\u0000\u012c"+ - "\u012f\u0001\u0000\u0000\u0000\u012d\u012b\u0001\u0000\u0000\u0000\u012d"+ - "\u012e\u0001\u0000\u0000\u0000\u012e\u0132\u0001\u0000\u0000\u0000\u012f"+ - "\u012d\u0001\u0000\u0000\u0000\u0130\u0132\u0007\u0005\u0000\u0000\u0131"+ - "\u0129\u0001\u0000\u0000\u0000\u0131\u0130\u0001\u0000\u0000\u0000\u0132"+ - "b\u0001\u0000\u0000\u0000\u0133\u0137\u0005\"\u0000\u0000\u0134\u0136"+ - "\b\b\u0000\u0000\u0135\u0134\u0001\u0000\u0000\u0000\u0136\u0139\u0001"+ - "\u0000\u0000\u0000\u0137\u0135\u0001\u0000\u0000\u0000\u0137\u0138\u0001"+ - "\u0000\u0000\u0000\u0138\u013a\u0001\u0000\u0000\u0000\u0139\u0137\u0001"+ - "\u0000\u0000\u0000\u013a\u013b\u0005\"\u0000\u0000\u013bd\u0001\u0000"+ - "\u0000\u0000\u013c\u013d\u0005/\u0000\u0000\u013d\u013e\u0005*\u0000\u0000"+ - "\u013e\u0142\u0001\u0000\u0000\u0000\u013f\u0141\t\u0000\u0000\u0000\u0140"+ - "\u013f\u0001\u0000\u0000\u0000\u0141\u0144\u0001\u0000\u0000\u0000\u0142"+ - "\u0143\u0001\u0000\u0000\u0000\u0142\u0140\u0001\u0000\u0000\u0000\u0143"+ - "\u0145\u0001\u0000\u0000\u0000\u0144\u0142\u0001\u0000\u0000\u0000\u0145"+ - "\u0146\u0005*\u0000\u0000\u0146\u0147\u0005/\u0000\u0000\u0147\u0148\u0001"+ - "\u0000\u0000\u0000\u0148\u0149\u00062\u0000\u0000\u0149f\u0001\u0000\u0000"+ - "\u0000\u014a\u014b\u0005/\u0000\u0000\u014b\u014c\u0005/\u0000\u0000\u014c"+ - "\u0150\u0001\u0000\u0000\u0000\u014d\u014f\b\t\u0000\u0000\u014e\u014d"+ - "\u0001\u0000\u0000\u0000\u014f\u0152\u0001\u0000\u0000\u0000\u0150\u014e"+ - "\u0001\u0000\u0000\u0000\u0150\u0151\u0001\u0000\u0000\u0000\u0151\u0153"+ - "\u0001\u0000\u0000\u0000\u0152\u0150\u0001\u0000\u0000\u0000\u0153\u0154"+ - "\u00063\u0000\u0000\u0154h\u0001\u0000\u0000\u0000\u0155\u0157\u0007\n"+ - "\u0000\u0000\u0156\u0155\u0001\u0000\u0000\u0000\u0157\u0158\u0001\u0000"+ - "\u0000\u0000\u0158\u0156\u0001\u0000\u0000\u0000\u0158\u0159\u0001\u0000"+ - "\u0000\u0000\u0159\u015a\u0001\u0000\u0000\u0000\u015a\u015b\u00064\u0000"+ - "\u0000\u015bj\u0001\u0000\u0000\u0000\u000b\u0000\u0112\u0119\u0120\u0124"+ - "\u012d\u0131\u0137\u0142\u0150\u0158\u0001\u0006\u0000\u0000"; + "\u0010\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001"+ + "\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0012\u0001\u0012\u0001"+ + "\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001\u0013\u0001"+ + "\u0014\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0001\u0016\u0001"+ + "\u0016\u0001\u0016\u0001\u0016\u0001\u0017\u0001\u0017\u0001\u0017\u0001"+ + "\u0018\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001\u001a\u0001"+ + "\u001a\u0001\u001b\u0001\u001b\u0001\u001c\u0001\u001c\u0001\u001d\u0001"+ + "\u001d\u0001\u001e\u0001\u001e\u0001\u001f\u0001\u001f\u0001 \u0001 \u0001"+ + " \u0001!\u0001!\u0001!\u0001\"\u0001\"\u0001\"\u0001\"\u0001\"\u0001#"+ + "\u0001#\u0001$\u0001$\u0001$\u0001%\u0001%\u0001%\u0001&\u0001&\u0001"+ + "\'\u0001\'\u0001\'\u0001\'\u0001(\u0001(\u0001(\u0001(\u0001(\u0001(\u0001"+ + ")\u0001)\u0001)\u0001*\u0001*\u0001*\u0001*\u0001*\u0001+\u0001+\u0001"+ + "+\u0001+\u0001+\u0001+\u0001,\u0001,\u0001,\u0001,\u0001,\u0001-\u0001"+ + "-\u0005-\u0111\b-\n-\f-\u0114\t-\u0001.\u0001.\u0005.\u0118\b.\n.\f.\u011b"+ + "\t.\u0001/\u0001/\u0005/\u011f\b/\n/\f/\u0122\t/\u0001/\u0003/\u0125\b"+ + "/\u00010\u00010\u00010\u00010\u00010\u00050\u012c\b0\n0\f0\u012f\t0\u0001"+ + "0\u00030\u0132\b0\u00011\u00011\u00051\u0136\b1\n1\f1\u0139\t1\u00011"+ + "\u00011\u00012\u00012\u00012\u00012\u00052\u0141\b2\n2\f2\u0144\t2\u0001"+ + "2\u00012\u00012\u00012\u00012\u00013\u00013\u00013\u00013\u00053\u014f"+ + "\b3\n3\f3\u0152\t3\u00013\u00013\u00014\u00044\u0157\b4\u000b4\f4\u0158"+ + "\u00014\u00014\u0001\u0142\u00005\u0001\u0001\u0003\u0002\u0005\u0003"+ + "\u0007\u0004\t\u0005\u000b\u0006\r\u0007\u000f\b\u0011\t\u0013\n\u0015"+ + "\u000b\u0017\f\u0019\r\u001b\u000e\u001d\u000f\u001f\u0010!\u0011#\u0012"+ + "%\u0013\'\u0014)\u0015+\u0016-\u0017/\u00181\u00193\u001a5\u001b7\u001c"+ + "9\u001d;\u001e=\u001f? A!C\"E#G$I%K&M\'O(Q)S*U+W,Y-[.]/_0a1c2e3g4i5\u0001"+ + "\u0000\u000b\u0001\u0000AZ\u0004\u000009AZ__az\u0001\u0000az\u0001\u0000"+ + "19\u0001\u000009\u0001\u000000\u0003\u000019AFaf\u0003\u000009AFaf\u0002"+ + "\u0000\"\"\\\\\u0001\u0000\n\n\u0003\u0000\t\n\r\r \u0165\u0000\u0001"+ + "\u0001\u0000\u0000\u0000\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005"+ + "\u0001\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001"+ + "\u0000\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000"+ + "\u0000\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000"+ + "\u0000\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000"+ + "\u0000\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000"+ + "\u0000\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000"+ + "\u0000\u0000\u0000\u001f\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000"+ + "\u0000\u0000#\u0001\u0000\u0000\u0000\u0000%\u0001\u0000\u0000\u0000\u0000"+ + "\'\u0001\u0000\u0000\u0000\u0000)\u0001\u0000\u0000\u0000\u0000+\u0001"+ + "\u0000\u0000\u0000\u0000-\u0001\u0000\u0000\u0000\u0000/\u0001\u0000\u0000"+ + "\u0000\u00001\u0001\u0000\u0000\u0000\u00003\u0001\u0000\u0000\u0000\u0000"+ + "5\u0001\u0000\u0000\u0000\u00007\u0001\u0000\u0000\u0000\u00009\u0001"+ + "\u0000\u0000\u0000\u0000;\u0001\u0000\u0000\u0000\u0000=\u0001\u0000\u0000"+ + "\u0000\u0000?\u0001\u0000\u0000\u0000\u0000A\u0001\u0000\u0000\u0000\u0000"+ + "C\u0001\u0000\u0000\u0000\u0000E\u0001\u0000\u0000\u0000\u0000G\u0001"+ + "\u0000\u0000\u0000\u0000I\u0001\u0000\u0000\u0000\u0000K\u0001\u0000\u0000"+ + "\u0000\u0000M\u0001\u0000\u0000\u0000\u0000O\u0001\u0000\u0000\u0000\u0000"+ + "Q\u0001\u0000\u0000\u0000\u0000S\u0001\u0000\u0000\u0000\u0000U\u0001"+ + "\u0000\u0000\u0000\u0000W\u0001\u0000\u0000\u0000\u0000Y\u0001\u0000\u0000"+ + "\u0000\u0000[\u0001\u0000\u0000\u0000\u0000]\u0001\u0000\u0000\u0000\u0000"+ + "_\u0001\u0000\u0000\u0000\u0000a\u0001\u0000\u0000\u0000\u0000c\u0001"+ + "\u0000\u0000\u0000\u0000e\u0001\u0000\u0000\u0000\u0000g\u0001\u0000\u0000"+ + "\u0000\u0000i\u0001\u0000\u0000\u0000\u0001k\u0001\u0000\u0000\u0000\u0003"+ + "p\u0001\u0000\u0000\u0000\u0005r\u0001\u0000\u0000\u0000\u0007t\u0001"+ + "\u0000\u0000\u0000\tv\u0001\u0000\u0000\u0000\u000bx\u0001\u0000\u0000"+ + "\u0000\r}\u0001\u0000\u0000\u0000\u000f\u007f\u0001\u0000\u0000\u0000"+ + "\u0011\u0085\u0001\u0000\u0000\u0000\u0013\u0087\u0001\u0000\u0000\u0000"+ + "\u0015\u0089\u0001\u0000\u0000\u0000\u0017\u008b\u0001\u0000\u0000\u0000"+ + "\u0019\u008e\u0001\u0000\u0000\u0000\u001b\u0093\u0001\u0000\u0000\u0000"+ + "\u001d\u0099\u0001\u0000\u0000\u0000\u001f\u00a0\u0001\u0000\u0000\u0000"+ + "!\u00a7\u0001\u0000\u0000\u0000#\u00ae\u0001\u0000\u0000\u0000%\u00b7"+ + "\u0001\u0000\u0000\u0000\'\u00b9\u0001\u0000\u0000\u0000)\u00bf\u0001"+ + "\u0000\u0000\u0000+\u00c2\u0001\u0000\u0000\u0000-\u00c4\u0001\u0000\u0000"+ + "\u0000/\u00c8\u0001\u0000\u0000\u00001\u00cb\u0001\u0000\u0000\u00003"+ + "\u00ce\u0001\u0000\u0000\u00005\u00d0\u0001\u0000\u0000\u00007\u00d2\u0001"+ + "\u0000\u0000\u00009\u00d4\u0001\u0000\u0000\u0000;\u00d6\u0001\u0000\u0000"+ + "\u0000=\u00d8\u0001\u0000\u0000\u0000?\u00da\u0001\u0000\u0000\u0000A"+ + "\u00dc\u0001\u0000\u0000\u0000C\u00df\u0001\u0000\u0000\u0000E\u00e2\u0001"+ + "\u0000\u0000\u0000G\u00e7\u0001\u0000\u0000\u0000I\u00e9\u0001\u0000\u0000"+ + "\u0000K\u00ec\u0001\u0000\u0000\u0000M\u00ef\u0001\u0000\u0000\u0000O"+ + "\u00f1\u0001\u0000\u0000\u0000Q\u00f5\u0001\u0000\u0000\u0000S\u00fb\u0001"+ + "\u0000\u0000\u0000U\u00fe\u0001\u0000\u0000\u0000W\u0103\u0001\u0000\u0000"+ + "\u0000Y\u0109\u0001\u0000\u0000\u0000[\u010e\u0001\u0000\u0000\u0000]"+ + "\u0115\u0001\u0000\u0000\u0000_\u0124\u0001\u0000\u0000\u0000a\u0126\u0001"+ + "\u0000\u0000\u0000c\u0133\u0001\u0000\u0000\u0000e\u013c\u0001\u0000\u0000"+ + "\u0000g\u014a\u0001\u0000\u0000\u0000i\u0156\u0001\u0000\u0000\u0000k"+ + "l\u0005g\u0000\u0000lm\u0005a\u0000\u0000mn\u0005m\u0000\u0000no\u0005"+ + "e\u0000\u0000o\u0002\u0001\u0000\u0000\u0000pq\u0005(\u0000\u0000q\u0004"+ + "\u0001\u0000\u0000\u0000rs\u0005)\u0000\u0000s\u0006\u0001\u0000\u0000"+ + "\u0000tu\u0005{\u0000\u0000u\b\u0001\u0000\u0000\u0000vw\u0005}\u0000"+ + "\u0000w\n\u0001\u0000\u0000\u0000xy\u0005t\u0000\u0000yz\u0005y\u0000"+ + "\u0000z{\u0005p\u0000\u0000{|\u0005e\u0000\u0000|\f\u0001\u0000\u0000"+ + "\u0000}~\u0005=\u0000\u0000~\u000e\u0001\u0000\u0000\u0000\u007f\u0080"+ + "\u0005m\u0000\u0000\u0080\u0081\u0005a\u0000\u0000\u0081\u0082\u0005c"+ + "\u0000\u0000\u0082\u0083\u0005r\u0000\u0000\u0083\u0084\u0005o\u0000\u0000"+ + "\u0084\u0010\u0001\u0000\u0000\u0000\u0085\u0086\u0005,\u0000\u0000\u0086"+ + "\u0012\u0001\u0000\u0000\u0000\u0087\u0088\u0005:\u0000\u0000\u0088\u0014"+ + "\u0001\u0000\u0000\u0000\u0089\u008a\u0005;\u0000\u0000\u008a\u0016\u0001"+ + "\u0000\u0000\u0000\u008b\u008c\u0005.\u0000\u0000\u008c\u008d\u0005.\u0000"+ + "\u0000\u008d\u0018\u0001\u0000\u0000\u0000\u008e\u008f\u0005j\u0000\u0000"+ + "\u008f\u0090\u0005o\u0000\u0000\u0090\u0091\u0005i\u0000\u0000\u0091\u0092"+ + "\u0005n\u0000\u0000\u0092\u001a\u0001\u0000\u0000\u0000\u0093\u0094\u0005"+ + "y\u0000\u0000\u0094\u0095\u0005i\u0000\u0000\u0095\u0096\u0005e\u0000"+ + "\u0000\u0096\u0097\u0005l\u0000\u0000\u0097\u0098\u0005d\u0000\u0000\u0098"+ + "\u001c\u0001\u0000\u0000\u0000\u0099\u009a\u0005r\u0000\u0000\u009a\u009b"+ + "\u0005e\u0000\u0000\u009b\u009c\u0005v\u0000\u0000\u009c\u009d\u0005e"+ + "\u0000\u0000\u009d\u009e\u0005a\u0000\u0000\u009e\u009f\u0005l\u0000\u0000"+ + "\u009f\u001e\u0001\u0000\u0000\u0000\u00a0\u00a1\u0005c\u0000\u0000\u00a1"+ + "\u00a2\u0005o\u0000\u0000\u00a2\u00a3\u0005m\u0000\u0000\u00a3\u00a4\u0005"+ + "m\u0000\u0000\u00a4\u00a5\u0005i\u0000\u0000\u00a5\u00a6\u0005t\u0000"+ + "\u0000\u00a6 \u0001\u0000\u0000\u0000\u00a7\u00a8\u0005r\u0000\u0000\u00a8"+ + "\u00a9\u0005a\u0000\u0000\u00a9\u00aa\u0005n\u0000\u0000\u00aa\u00ab\u0005"+ + "d\u0000\u0000\u00ab\u00ac\u0005o\u0000\u0000\u00ac\u00ad\u0005m\u0000"+ + "\u0000\u00ad\"\u0001\u0000\u0000\u0000\u00ae\u00af\u0005w\u0000\u0000"+ + "\u00af\u00b0\u0005i\u0000\u0000\u00b0\u00b1\u0005t\u0000\u0000\u00b1\u00b2"+ + "\u0005h\u0000\u0000\u00b2\u00b3\u0005d\u0000\u0000\u00b3\u00b4\u0005r"+ + "\u0000\u0000\u00b4\u00b5\u0005a\u0000\u0000\u00b5\u00b6\u0005w\u0000\u0000"+ + "\u00b6$\u0001\u0000\u0000\u0000\u00b7\u00b8\u0005$\u0000\u0000\u00b8&"+ + "\u0001\u0000\u0000\u0000\u00b9\u00ba\u0005w\u0000\u0000\u00ba\u00bb\u0005"+ + "h\u0000\u0000\u00bb\u00bc\u0005e\u0000\u0000\u00bc\u00bd\u0005r\u0000"+ + "\u0000\u00bd\u00be\u0005e\u0000\u0000\u00be(\u0001\u0000\u0000\u0000\u00bf"+ + "\u00c0\u0005|\u0000\u0000\u00c0\u00c1\u0005|\u0000\u0000\u00c1*\u0001"+ + "\u0000\u0000\u0000\u00c2\u00c3\u0005?\u0000\u0000\u00c3,\u0001\u0000\u0000"+ + "\u0000\u00c4\u00c5\u0005l\u0000\u0000\u00c5\u00c6\u0005e\u0000\u0000\u00c6"+ + "\u00c7\u0005t\u0000\u0000\u00c7.\u0001\u0000\u0000\u0000\u00c8\u00c9\u0005"+ + "i\u0000\u0000\u00c9\u00ca\u0005n\u0000\u0000\u00ca0\u0001\u0000\u0000"+ + "\u0000\u00cb\u00cc\u0005-\u0000\u0000\u00cc\u00cd\u0005>\u0000\u0000\u00cd"+ + "2\u0001\u0000\u0000\u0000\u00ce\u00cf\u0005.\u0000\u0000\u00cf4\u0001"+ + "\u0000\u0000\u0000\u00d0\u00d1\u0005-\u0000\u0000\u00d16\u0001\u0000\u0000"+ + "\u0000\u00d2\u00d3\u0005!\u0000\u0000\u00d38\u0001\u0000\u0000\u0000\u00d4"+ + "\u00d5\u0005*\u0000\u0000\u00d5:\u0001\u0000\u0000\u0000\u00d6\u00d7\u0005"+ + "/\u0000\u0000\u00d7<\u0001\u0000\u0000\u0000\u00d8\u00d9\u0005%\u0000"+ + "\u0000\u00d9>\u0001\u0000\u0000\u0000\u00da\u00db\u0005+\u0000\u0000\u00db"+ + "@\u0001\u0000\u0000\u0000\u00dc\u00dd\u0005!\u0000\u0000\u00dd\u00de\u0005"+ + "=\u0000\u0000\u00deB\u0001\u0000\u0000\u0000\u00df\u00e0\u0005=\u0000"+ + "\u0000\u00e0\u00e1\u0005=\u0000\u0000\u00e1D\u0001\u0000\u0000\u0000\u00e2"+ + "\u00e3\u0005n\u0000\u0000\u00e3\u00e4\u0005u\u0000\u0000\u00e4\u00e5\u0005"+ + "l\u0000\u0000\u00e5\u00e6\u0005l\u0000\u0000\u00e6F\u0001\u0000\u0000"+ + "\u0000\u00e7\u00e8\u0005<\u0000\u0000\u00e8H\u0001\u0000\u0000\u0000\u00e9"+ + "\u00ea\u0005<\u0000\u0000\u00ea\u00eb\u0005=\u0000\u0000\u00ebJ\u0001"+ + "\u0000\u0000\u0000\u00ec\u00ed\u0005>\u0000\u0000\u00ed\u00ee\u0005=\u0000"+ + "\u0000\u00eeL\u0001\u0000\u0000\u0000\u00ef\u00f0\u0005>\u0000\u0000\u00f0"+ + "N\u0001\u0000\u0000\u0000\u00f1\u00f2\u0005<\u0000\u0000\u00f2\u00f3\u0005"+ + "-\u0000\u0000\u00f3\u00f4\u0005>\u0000\u0000\u00f4P\u0001\u0000\u0000"+ + "\u0000\u00f5\u00f6\u0005<\u0000\u0000\u00f6\u00f7\u0005-\u0000\u0000\u00f7"+ + "\u00f8\u0005!\u0000\u0000\u00f8\u00f9\u0005-\u0000\u0000\u00f9\u00fa\u0005"+ + ">\u0000\u0000\u00faR\u0001\u0000\u0000\u0000\u00fb\u00fc\u0005&\u0000"+ + "\u0000\u00fc\u00fd\u0005&\u0000\u0000\u00fdT\u0001\u0000\u0000\u0000\u00fe"+ + "\u00ff\u0005t\u0000\u0000\u00ff\u0100\u0005r\u0000\u0000\u0100\u0101\u0005"+ + "u\u0000\u0000\u0101\u0102\u0005e\u0000\u0000\u0102V\u0001\u0000\u0000"+ + "\u0000\u0103\u0104\u0005f\u0000\u0000\u0104\u0105\u0005a\u0000\u0000\u0105"+ + "\u0106\u0005l\u0000\u0000\u0106\u0107\u0005s\u0000\u0000\u0107\u0108\u0005"+ + "e\u0000\u0000\u0108X\u0001\u0000\u0000\u0000\u0109\u010a\u0005l\u0000"+ + "\u0000\u010a\u010b\u0005e\u0000\u0000\u010b\u010c\u0005t\u0000\u0000\u010c"+ + "\u010d\u0005!\u0000\u0000\u010dZ\u0001\u0000\u0000\u0000\u010e\u0112\u0007"+ + "\u0000\u0000\u0000\u010f\u0111\u0007\u0001\u0000\u0000\u0110\u010f\u0001"+ + "\u0000\u0000\u0000\u0111\u0114\u0001\u0000\u0000\u0000\u0112\u0110\u0001"+ + "\u0000\u0000\u0000\u0112\u0113\u0001\u0000\u0000\u0000\u0113\\\u0001\u0000"+ + "\u0000\u0000\u0114\u0112\u0001\u0000\u0000\u0000\u0115\u0119\u0007\u0002"+ + "\u0000\u0000\u0116\u0118\u0007\u0001\u0000\u0000\u0117\u0116\u0001\u0000"+ + "\u0000\u0000\u0118\u011b\u0001\u0000\u0000\u0000\u0119\u0117\u0001\u0000"+ + "\u0000\u0000\u0119\u011a\u0001\u0000\u0000\u0000\u011a^\u0001\u0000\u0000"+ + "\u0000\u011b\u0119\u0001\u0000\u0000\u0000\u011c\u0120\u0007\u0003\u0000"+ + "\u0000\u011d\u011f\u0007\u0004\u0000\u0000\u011e\u011d\u0001\u0000\u0000"+ + "\u0000\u011f\u0122\u0001\u0000\u0000\u0000\u0120\u011e\u0001\u0000\u0000"+ + "\u0000\u0120\u0121\u0001\u0000\u0000\u0000\u0121\u0125\u0001\u0000\u0000"+ + "\u0000\u0122\u0120\u0001\u0000\u0000\u0000\u0123\u0125\u0007\u0005\u0000"+ + "\u0000\u0124\u011c\u0001\u0000\u0000\u0000\u0124\u0123\u0001\u0000\u0000"+ + "\u0000\u0125`\u0001\u0000\u0000\u0000\u0126\u0127\u00050\u0000\u0000\u0127"+ + "\u0128\u0005x\u0000\u0000\u0128\u0131\u0001\u0000\u0000\u0000\u0129\u012d"+ + "\u0007\u0006\u0000\u0000\u012a\u012c\u0007\u0007\u0000\u0000\u012b\u012a"+ + "\u0001\u0000\u0000\u0000\u012c\u012f\u0001\u0000\u0000\u0000\u012d\u012b"+ + "\u0001\u0000\u0000\u0000\u012d\u012e\u0001\u0000\u0000\u0000\u012e\u0132"+ + "\u0001\u0000\u0000\u0000\u012f\u012d\u0001\u0000\u0000\u0000\u0130\u0132"+ + "\u0007\u0005\u0000\u0000\u0131\u0129\u0001\u0000\u0000\u0000\u0131\u0130"+ + "\u0001\u0000\u0000\u0000\u0132b\u0001\u0000\u0000\u0000\u0133\u0137\u0005"+ + "\"\u0000\u0000\u0134\u0136\b\b\u0000\u0000\u0135\u0134\u0001\u0000\u0000"+ + "\u0000\u0136\u0139\u0001\u0000\u0000\u0000\u0137\u0135\u0001\u0000\u0000"+ + "\u0000\u0137\u0138\u0001\u0000\u0000\u0000\u0138\u013a\u0001\u0000\u0000"+ + "\u0000\u0139\u0137\u0001\u0000\u0000\u0000\u013a\u013b\u0005\"\u0000\u0000"+ + "\u013bd\u0001\u0000\u0000\u0000\u013c\u013d\u0005/\u0000\u0000\u013d\u013e"+ + "\u0005*\u0000\u0000\u013e\u0142\u0001\u0000\u0000\u0000\u013f\u0141\t"+ + "\u0000\u0000\u0000\u0140\u013f\u0001\u0000\u0000\u0000\u0141\u0144\u0001"+ + "\u0000\u0000\u0000\u0142\u0143\u0001\u0000\u0000\u0000\u0142\u0140\u0001"+ + "\u0000\u0000\u0000\u0143\u0145\u0001\u0000\u0000\u0000\u0144\u0142\u0001"+ + "\u0000\u0000\u0000\u0145\u0146\u0005*\u0000\u0000\u0146\u0147\u0005/\u0000"+ + "\u0000\u0147\u0148\u0001\u0000\u0000\u0000\u0148\u0149\u00062\u0000\u0000"+ + "\u0149f\u0001\u0000\u0000\u0000\u014a\u014b\u0005/\u0000\u0000\u014b\u014c"+ + "\u0005/\u0000\u0000\u014c\u0150\u0001\u0000\u0000\u0000\u014d\u014f\b"+ + "\t\u0000\u0000\u014e\u014d\u0001\u0000\u0000\u0000\u014f\u0152\u0001\u0000"+ + "\u0000\u0000\u0150\u014e\u0001\u0000\u0000\u0000\u0150\u0151\u0001\u0000"+ + "\u0000\u0000\u0151\u0153\u0001\u0000\u0000\u0000\u0152\u0150\u0001\u0000"+ + "\u0000\u0000\u0153\u0154\u00063\u0000\u0000\u0154h\u0001\u0000\u0000\u0000"+ + "\u0155\u0157\u0007\n\u0000\u0000\u0156\u0155\u0001\u0000\u0000\u0000\u0157"+ + "\u0158\u0001\u0000\u0000\u0000\u0158\u0156\u0001\u0000\u0000\u0000\u0158"+ + "\u0159\u0001\u0000\u0000\u0000\u0159\u015a\u0001\u0000\u0000\u0000\u015a"+ + "\u015b\u00064\u0000\u0000\u015bj\u0001\u0000\u0000\u0000\u000b\u0000\u0112"+ + "\u0119\u0120\u0124\u012d\u0131\u0137\u0142\u0150\u0158\u0001\u0006\u0000"+ + "\u0000"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/main/java/vegas/generated/VegasParser.java b/src/main/java/vegas/generated/VegasParser.java index 26ad7dde..63100e55 100644 --- a/src/main/java/vegas/generated/VegasParser.java +++ b/src/main/java/vegas/generated/VegasParser.java @@ -42,11 +42,11 @@ private static String[] makeRuleNames() { private static String[] makeLiteralNames() { return new String[] { null, "'game'", "'('", "')'", "'{'", "'}'", "'type'", "'='", "'macro'", - "','", "':'", "';'", "'..'", "'join'", "'yield'", "'reveal'", "'random'", - "'withdraw'", "'$'", "'where'", "'||'", "'?'", "'let'", "'in'", "'->'", - "'.'", "'-'", "'!'", "'*'", "'/'", "'%'", "'+'", "'!='", "'=='", "'null'", - "'<'", "'<='", "'>='", "'>'", "'<->'", "'<-!->'", "'&&'", "'true'", "'false'", - "'let!'", "'hidden'" + "','", "':'", "';'", "'..'", "'join'", "'yield'", "'reveal'", "'commit'", + "'random'", "'withdraw'", "'$'", "'where'", "'||'", "'?'", "'let'", "'in'", + "'->'", "'.'", "'-'", "'!'", "'*'", "'/'", "'%'", "'+'", "'!='", "'=='", + "'null'", "'<'", "'<='", "'>='", "'>'", "'<->'", "'<-!->'", "'&&'", "'true'", + "'false'", "'let!'" }; } private static final String[] _LITERAL_NAMES = makeLiteralNames(); @@ -669,13 +669,14 @@ public final ExtContext ext() throws RecognitionException { case T__13: case T__14: case T__15: + case T__16: _localctx = new ReceiveExtContext(_localctx); enterOuterAlt(_localctx, 1); { setState(100); ((ReceiveExtContext)_localctx).kind = _input.LT(1); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 122880L) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 253952L) != 0)) ) { ((ReceiveExtContext)_localctx).kind = (Token)_errHandler.recoverInline(this); } else { @@ -703,12 +704,12 @@ public final ExtContext ext() throws RecognitionException { ext(); } break; - case T__16: + case T__17: _localctx = new WithdrawExtContext(_localctx); enterOuterAlt(_localctx, 2); { setState(109); - match(T__16); + match(T__17); setState(110); outcome(); } @@ -815,10 +816,10 @@ public final QueryContext query() throws RecognitionException { setState(130); _errHandler.sync(this); _la = _input.LA(1); - if (_la==T__17) { + if (_la==T__18) { { setState(128); - match(T__17); + match(T__18); setState(129); ((QueryContext)_localctx).deposit = match(INT); } @@ -827,10 +828,10 @@ public final QueryContext query() throws RecognitionException { setState(134); _errHandler.sync(this); _la = _input.LA(1); - if (_la==T__18) { + if (_la==T__19) { { setState(132); - match(T__18); + match(T__19); setState(133); ((QueryContext)_localctx).cond = exp(0); } @@ -839,10 +840,10 @@ public final QueryContext query() throws RecognitionException { setState(138); _errHandler.sync(this); _la = _input.LA(1); - if (_la==T__19) { + if (_la==T__20) { { setState(136); - match(T__19); + match(T__20); setState(137); ((QueryContext)_localctx).handler = outcome(); } @@ -960,7 +961,7 @@ public final OutcomeContext outcome() throws RecognitionException { setState(140); ((IfOutcomeContext)_localctx).cond = exp(0); setState(141); - match(T__20); + match(T__21); setState(142); ((IfOutcomeContext)_localctx).ifTrue = outcome(); setState(143); @@ -974,7 +975,7 @@ public final OutcomeContext outcome() throws RecognitionException { enterOuterAlt(_localctx, 2); { setState(146); - match(T__21); + match(T__22); setState(147); ((LetOutcomeContext)_localctx).dec = varDec(); setState(148); @@ -982,7 +983,7 @@ public final OutcomeContext outcome() throws RecognitionException { setState(149); ((LetOutcomeContext)_localctx).init = exp(0); setState(150); - match(T__22); + match(T__23); setState(151); ((LetOutcomeContext)_localctx).body = outcome(); } @@ -1068,7 +1069,7 @@ public final ItemContext item() throws RecognitionException { setState(167); ((ItemContext)_localctx).role = roleId(); setState(168); - match(T__23); + match(T__24); setState(169); exp(0); setState(171); @@ -1396,7 +1397,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(178); ((MemberExpContext)_localctx).role = roleId(); setState(179); - match(T__24); + match(T__25); setState(180); ((MemberExpContext)_localctx).field = varId(); } @@ -1413,7 +1414,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(192); _errHandler.sync(this); _la = _input.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1086317689569284L) != 0)) { + if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 1117104216473604L) != 0)) { { setState(184); ((CallExpContext)_localctx).exp = exp(0); @@ -1450,7 +1451,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(196); ((UnOpExpContext)_localctx).op = _input.LT(1); _la = _input.LA(1); - if ( !(_la==T__25 || _la==T__26) ) { + if ( !(_la==T__26 || _la==T__27) ) { ((UnOpExpContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { @@ -1469,7 +1470,7 @@ private ExpContext exp(int _p) throws RecognitionException { _prevctx = _localctx; setState(198); _la = _input.LA(1); - if ( !(_la==T__41 || _la==T__42) ) { + if ( !(_la==T__42 || _la==T__43) ) { _errHandler.recoverInline(this); } else { @@ -1512,7 +1513,7 @@ private ExpContext exp(int _p) throws RecognitionException { _ctx = _localctx; _prevctx = _localctx; setState(202); - match(T__43); + match(T__44); setState(203); ((LetExpContext)_localctx).dec = varDec(); setState(204); @@ -1520,7 +1521,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(205); ((LetExpContext)_localctx).init = exp(0); setState(206); - match(T__22); + match(T__23); setState(207); ((LetExpContext)_localctx).body = exp(1); } @@ -1548,7 +1549,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(212); ((BinOpMultExpContext)_localctx).op = _input.LT(1); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1879048192L) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 3758096384L) != 0)) ) { ((BinOpMultExpContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { @@ -1570,7 +1571,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(215); ((BinOpAddExpContext)_localctx).op = _input.LT(1); _la = _input.LA(1); - if ( !(_la==T__25 || _la==T__30) ) { + if ( !(_la==T__26 || _la==T__31) ) { ((BinOpAddExpContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { @@ -1592,7 +1593,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(218); ((BinOpCompExpContext)_localctx).op = _input.LT(1); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 515396075520L) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1030792151040L) != 0)) ) { ((BinOpCompExpContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { @@ -1614,7 +1615,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(221); ((BinOpEqExpContext)_localctx).op = _input.LT(1); _la = _input.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1662152343552L) != 0)) ) { + if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 3324304687104L) != 0)) ) { ((BinOpEqExpContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { @@ -1636,7 +1637,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(224); ((BinOpBoolExpContext)_localctx).op = _input.LT(1); _la = _input.LA(1); - if ( !(_la==T__19 || _la==T__40) ) { + if ( !(_la==T__20 || _la==T__41) ) { ((BinOpBoolExpContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { @@ -1656,7 +1657,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(226); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); setState(227); - match(T__20); + match(T__21); setState(228); ((IfExpContext)_localctx).ifTrue = exp(0); setState(229); @@ -1674,7 +1675,7 @@ private ExpContext exp(int _p) throws RecognitionException { setState(233); ((UndefExpContext)_localctx).op = _input.LT(1); _la = _input.LA(1); - if ( !(_la==T__31 || _la==T__32) ) { + if ( !(_la==T__32 || _la==T__33) ) { ((UndefExpContext)_localctx).op = (Token)_errHandler.recoverInline(this); } else { @@ -1683,7 +1684,7 @@ private ExpContext exp(int _p) throws RecognitionException { consume(); } setState(234); - match(T__33); + match(T__34); } break; } @@ -1709,7 +1710,6 @@ private ExpContext exp(int _p) throws RecognitionException { @SuppressWarnings("CheckReturnValue") public static class VarDecContext extends ParserRuleContext { public VarIdContext name; - public Token hidden; public TypeExpContext type; public VarIdContext varId() { return getRuleContext(VarIdContext.class,0); @@ -1731,7 +1731,6 @@ public T accept(ParseTreeVisitor visitor) { public final VarDecContext varDec() throws RecognitionException { VarDecContext _localctx = new VarDecContext(_ctx, getState()); enterRule(_localctx, 24, RULE_varDec); - int _la; try { enterOuterAlt(_localctx, 1); { @@ -1739,17 +1738,7 @@ public final VarDecContext varDec() throws RecognitionException { ((VarDecContext)_localctx).name = varId(); setState(241); match(T__9); - setState(243); - _errHandler.sync(this); - _la = _input.LA(1); - if (_la==T__44) { - { - setState(242); - ((VarDecContext)_localctx).hidden = match(T__44); - } - } - - setState(245); + setState(242); ((VarDecContext)_localctx).type = typeExp(); } } @@ -1784,7 +1773,7 @@ public final TypeIdContext typeId() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(247); + setState(244); match(LOWER_ID); } } @@ -1819,7 +1808,7 @@ public final VarIdContext varId() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(249); + setState(246); match(LOWER_ID); } } @@ -1854,7 +1843,7 @@ public final RoleIdContext roleId() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(251); + setState(248); match(ROLE_ID); } } @@ -1897,7 +1886,7 @@ private boolean exp_sempred(ExpContext _localctx, int predIndex) { } public static final String _serializedATN = - "\u0004\u00015\u00fe\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ + "\u0004\u00015\u00fb\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002"+ "\u0002\u0007\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002"+ "\u0005\u0007\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002"+ "\b\u0007\b\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002"+ @@ -1932,134 +1921,132 @@ private boolean exp_sempred(ExpContext _localctx, int predIndex) { "\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+ "\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b"+ "\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0005\u000b"+ - "\u00ec\b\u000b\n\u000b\f\u000b\u00ef\t\u000b\u0001\f\u0001\f\u0001\f\u0003"+ - "\f\u00f4\b\f\u0001\f\u0001\f\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001"+ - "\u000f\u0001\u000f\u0001\u000f\u0000\u0001\u0016\u0010\u0000\u0002\u0004"+ - "\u0006\b\n\f\u000e\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u001e\u0000"+ - "\t\u0001\u0000\r\u0010\u0001\u0000\u001a\u001b\u0001\u0000*+\u0001\u0000"+ - "\u001c\u001e\u0002\u0000\u001a\u001a\u001f\u001f\u0001\u0000#&\u0002\u0000"+ - " !\'(\u0002\u0000\u0014\u0014))\u0001\u0000 !\u0114\u0000$\u0001\u0000"+ - "\u0000\u0000\u0002*\u0001\u0000\u0000\u0000\u00042\u0001\u0000\u0000\u0000"+ - "\u00064\u0001\u0000\u0000\u0000\b9\u0001\u0000\u0000\u0000\nN\u0001\u0000"+ - "\u0000\u0000\fb\u0001\u0000\u0000\u0000\u000eo\u0001\u0000\u0000\u0000"+ - "\u0010q\u0001\u0000\u0000\u0000\u0012\u00a5\u0001\u0000\u0000\u0000\u0014"+ - "\u00a7\u0001\u0000\u0000\u0000\u0016\u00d1\u0001\u0000\u0000\u0000\u0018"+ - "\u00f0\u0001\u0000\u0000\u0000\u001a\u00f7\u0001\u0000\u0000\u0000\u001c"+ - "\u00f9\u0001\u0000\u0000\u0000\u001e\u00fb\u0001\u0000\u0000\u0000 #\u0003"+ - "\u0006\u0003\u0000!#\u0003\b\u0004\u0000\" \u0001\u0000\u0000\u0000\""+ - "!\u0001\u0000\u0000\u0000#&\u0001\u0000\u0000\u0000$\"\u0001\u0000\u0000"+ - "\u0000$%\u0001\u0000\u0000\u0000%\'\u0001\u0000\u0000\u0000&$\u0001\u0000"+ - "\u0000\u0000\'(\u0003\u0002\u0001\u0000()\u0005\u0000\u0000\u0001)\u0001"+ - "\u0001\u0000\u0000\u0000*+\u0005\u0001\u0000\u0000+,\u0003\u0004\u0002"+ - "\u0000,-\u0005\u0002\u0000\u0000-.\u0005\u0003\u0000\u0000./\u0005\u0004"+ - "\u0000\u0000/0\u0003\u000e\u0007\u000001\u0005\u0005\u0000\u00001\u0003"+ - "\u0001\u0000\u0000\u000023\u0003\u001c\u000e\u00003\u0005\u0001\u0000"+ - "\u0000\u000045\u0005\u0006\u0000\u000056\u0003\u001a\r\u000067\u0005\u0007"+ - "\u0000\u000078\u0003\f\u0006\u00008\u0007\u0001\u0000\u0000\u00009:\u0005"+ - "\b\u0000\u0000:;\u0003\u001c\u000e\u0000;D\u0005\u0002\u0000\u0000\u0005\t\u0000\u0000>@\u0003\n\u0005\u0000?=\u0001\u0000"+ - "\u0000\u0000@C\u0001\u0000\u0000\u0000A?\u0001\u0000\u0000\u0000AB\u0001"+ - "\u0000\u0000\u0000BE\u0001\u0000\u0000\u0000CA\u0001\u0000\u0000\u0000"+ - "D<\u0001\u0000\u0000\u0000DE\u0001\u0000\u0000\u0000EF\u0001\u0000\u0000"+ - "\u0000FG\u0005\u0003\u0000\u0000GH\u0005\n\u0000\u0000HI\u0003\f\u0006"+ - "\u0000IJ\u0005\u0007\u0000\u0000JL\u0003\u0016\u000b\u0000KM\u0005\u000b"+ - "\u0000\u0000LK\u0001\u0000\u0000\u0000LM\u0001\u0000\u0000\u0000M\t\u0001"+ - "\u0000\u0000\u0000NO\u0003\u001c\u000e\u0000OP\u0005\n\u0000\u0000PQ\u0003"+ - "\f\u0006\u0000Q\u000b\u0001\u0000\u0000\u0000RS\u0005\u0004\u0000\u0000"+ - "SX\u00050\u0000\u0000TU\u0005\t\u0000\u0000UW\u00050\u0000\u0000VT\u0001"+ - "\u0000\u0000\u0000WZ\u0001\u0000\u0000\u0000XV\u0001\u0000\u0000\u0000"+ - "XY\u0001\u0000\u0000\u0000Y[\u0001\u0000\u0000\u0000ZX\u0001\u0000\u0000"+ - "\u0000[c\u0005\u0005\u0000\u0000\\]\u0005\u0004\u0000\u0000]^\u00050\u0000"+ - "\u0000^_\u0005\f\u0000\u0000_`\u00050\u0000\u0000`c\u0005\u0005\u0000"+ - "\u0000ac\u0003\u001a\r\u0000bR\u0001\u0000\u0000\u0000b\\\u0001\u0000"+ - "\u0000\u0000ba\u0001\u0000\u0000\u0000c\r\u0001\u0000\u0000\u0000df\u0007"+ - "\u0000\u0000\u0000eg\u0003\u0010\b\u0000fe\u0001\u0000\u0000\u0000gh\u0001"+ - "\u0000\u0000\u0000hf\u0001\u0000\u0000\u0000hi\u0001\u0000\u0000\u0000"+ - "ij\u0001\u0000\u0000\u0000jk\u0005\u000b\u0000\u0000kl\u0003\u000e\u0007"+ - "\u0000lp\u0001\u0000\u0000\u0000mn\u0005\u0011\u0000\u0000np\u0003\u0012"+ - "\t\u0000od\u0001\u0000\u0000\u0000om\u0001\u0000\u0000\u0000p\u000f\u0001"+ - "\u0000\u0000\u0000q~\u0003\u001e\u000f\u0000r{\u0005\u0002\u0000\u0000"+ - "sx\u0003\u0018\f\u0000tu\u0005\t\u0000\u0000uw\u0003\u0018\f\u0000vt\u0001"+ - "\u0000\u0000\u0000wz\u0001\u0000\u0000\u0000xv\u0001\u0000\u0000\u0000"+ - "xy\u0001\u0000\u0000\u0000y|\u0001\u0000\u0000\u0000zx\u0001\u0000\u0000"+ - "\u0000{s\u0001\u0000\u0000\u0000{|\u0001\u0000\u0000\u0000|}\u0001\u0000"+ - "\u0000\u0000}\u007f\u0005\u0003\u0000\u0000~r\u0001\u0000\u0000\u0000"+ - "~\u007f\u0001\u0000\u0000\u0000\u007f\u0082\u0001\u0000\u0000\u0000\u0080"+ - "\u0081\u0005\u0012\u0000\u0000\u0081\u0083\u00050\u0000\u0000\u0082\u0080"+ - "\u0001\u0000\u0000\u0000\u0082\u0083\u0001\u0000\u0000\u0000\u0083\u0086"+ - "\u0001\u0000\u0000\u0000\u0084\u0085\u0005\u0013\u0000\u0000\u0085\u0087"+ - "\u0003\u0016\u000b\u0000\u0086\u0084\u0001\u0000\u0000\u0000\u0086\u0087"+ - "\u0001\u0000\u0000\u0000\u0087\u008a\u0001\u0000\u0000\u0000\u0088\u0089"+ - "\u0005\u0014\u0000\u0000\u0089\u008b\u0003\u0012\t\u0000\u008a\u0088\u0001"+ - "\u0000\u0000\u0000\u008a\u008b\u0001\u0000\u0000\u0000\u008b\u0011\u0001"+ - "\u0000\u0000\u0000\u008c\u008d\u0003\u0016\u000b\u0000\u008d\u008e\u0005"+ - "\u0015\u0000\u0000\u008e\u008f\u0003\u0012\t\u0000\u008f\u0090\u0005\n"+ - "\u0000\u0000\u0090\u0091\u0003\u0012\t\u0000\u0091\u00a6\u0001\u0000\u0000"+ - "\u0000\u0092\u0093\u0005\u0016\u0000\u0000\u0093\u0094\u0003\u0018\f\u0000"+ - "\u0094\u0095\u0005\u0007\u0000\u0000\u0095\u0096\u0003\u0016\u000b\u0000"+ - "\u0096\u0097\u0005\u0017\u0000\u0000\u0097\u0098\u0003\u0012\t\u0000\u0098"+ - "\u00a6\u0001\u0000\u0000\u0000\u0099\u009a\u0005\u0002\u0000\u0000\u009a"+ - "\u009b\u0003\u0012\t\u0000\u009b\u009c\u0005\u0003\u0000\u0000\u009c\u00a6"+ - "\u0001\u0000\u0000\u0000\u009d\u009f\u0005\u0004\u0000\u0000\u009e\u00a0"+ - "\u0003\u0014\n\u0000\u009f\u009e\u0001\u0000\u0000\u0000\u00a0\u00a1\u0001"+ - "\u0000\u0000\u0000\u00a1\u009f\u0001\u0000\u0000\u0000\u00a1\u00a2\u0001"+ - "\u0000\u0000\u0000\u00a2\u00a3\u0001\u0000\u0000\u0000\u00a3\u00a4\u0005"+ - "\u0005\u0000\u0000\u00a4\u00a6\u0001\u0000\u0000\u0000\u00a5\u008c\u0001"+ - "\u0000\u0000\u0000\u00a5\u0092\u0001\u0000\u0000\u0000\u00a5\u0099\u0001"+ - "\u0000\u0000\u0000\u00a5\u009d\u0001\u0000\u0000\u0000\u00a6\u0013\u0001"+ - "\u0000\u0000\u0000\u00a7\u00a8\u0003\u001e\u000f\u0000\u00a8\u00a9\u0005"+ - "\u0018\u0000\u0000\u00a9\u00ab\u0003\u0016\u000b\u0000\u00aa\u00ac\u0005"+ - "\u000b\u0000\u0000\u00ab\u00aa\u0001\u0000\u0000\u0000\u00ab\u00ac\u0001"+ - "\u0000\u0000\u0000\u00ac\u0015\u0001\u0000\u0000\u0000\u00ad\u00ae\u0006"+ - "\u000b\uffff\uffff\u0000\u00ae\u00af\u0005\u0002\u0000\u0000\u00af\u00b0"+ - "\u0003\u0016\u000b\u0000\u00b0\u00b1\u0005\u0003\u0000\u0000\u00b1\u00d2"+ - "\u0001\u0000\u0000\u0000\u00b2\u00b3\u0003\u001e\u000f\u0000\u00b3\u00b4"+ - "\u0005\u0019\u0000\u0000\u00b4\u00b5\u0003\u001c\u000e\u0000\u00b5\u00d2"+ - "\u0001\u0000\u0000\u0000\u00b6\u00b7\u0003\u001c\u000e\u0000\u00b7\u00c0"+ - "\u0005\u0002\u0000\u0000\u00b8\u00bd\u0003\u0016\u000b\u0000\u00b9\u00ba"+ - "\u0005\t\u0000\u0000\u00ba\u00bc\u0003\u0016\u000b\u0000\u00bb\u00b9\u0001"+ - "\u0000\u0000\u0000\u00bc\u00bf\u0001\u0000\u0000\u0000\u00bd\u00bb\u0001"+ - "\u0000\u0000\u0000\u00bd\u00be\u0001\u0000\u0000\u0000\u00be\u00c1\u0001"+ - "\u0000\u0000\u0000\u00bf\u00bd\u0001\u0000\u0000\u0000\u00c0\u00b8\u0001"+ - "\u0000\u0000\u0000\u00c0\u00c1\u0001\u0000\u0000\u0000\u00c1\u00c2\u0001"+ - "\u0000\u0000\u0000\u00c2\u00c3\u0005\u0003\u0000\u0000\u00c3\u00d2\u0001"+ - "\u0000\u0000\u0000\u00c4\u00c5\u0007\u0001\u0000\u0000\u00c5\u00d2\u0003"+ - "\u0016\u000b\r\u00c6\u00d2\u0007\u0002\u0000\u0000\u00c7\u00d2\u0003\u001c"+ - "\u000e\u0000\u00c8\u00d2\u00050\u0000\u0000\u00c9\u00d2\u00051\u0000\u0000"+ - "\u00ca\u00cb\u0005,\u0000\u0000\u00cb\u00cc\u0003\u0018\f\u0000\u00cc"+ - "\u00cd\u0005\u0007\u0000\u0000\u00cd\u00ce\u0003\u0016\u000b\u0000\u00ce"+ - "\u00cf\u0005\u0017\u0000\u0000\u00cf\u00d0\u0003\u0016\u000b\u0001\u00d0"+ - "\u00d2\u0001\u0000\u0000\u0000\u00d1\u00ad\u0001\u0000\u0000\u0000\u00d1"+ - "\u00b2\u0001\u0000\u0000\u0000\u00d1\u00b6\u0001\u0000\u0000\u0000\u00d1"+ - "\u00c4\u0001\u0000\u0000\u0000\u00d1\u00c6\u0001\u0000\u0000\u0000\u00d1"+ - "\u00c7\u0001\u0000\u0000\u0000\u00d1\u00c8\u0001\u0000\u0000\u0000\u00d1"+ - "\u00c9\u0001\u0000\u0000\u0000\u00d1\u00ca\u0001\u0000\u0000\u0000\u00d2"+ - "\u00ed\u0001\u0000\u0000\u0000\u00d3\u00d4\n\f\u0000\u0000\u00d4\u00d5"+ - "\u0007\u0003\u0000\u0000\u00d5\u00ec\u0003\u0016\u000b\r\u00d6\u00d7\n"+ - "\u000b\u0000\u0000\u00d7\u00d8\u0007\u0004\u0000\u0000\u00d8\u00ec\u0003"+ - "\u0016\u000b\f\u00d9\u00da\n\t\u0000\u0000\u00da\u00db\u0007\u0005\u0000"+ - "\u0000\u00db\u00ec\u0003\u0016\u000b\n\u00dc\u00dd\n\b\u0000\u0000\u00dd"+ - "\u00de\u0007\u0006\u0000\u0000\u00de\u00ec\u0003\u0016\u000b\t\u00df\u00e0"+ - "\n\u0007\u0000\u0000\u00e0\u00e1\u0007\u0007\u0000\u0000\u00e1\u00ec\u0003"+ - "\u0016\u000b\b\u00e2\u00e3\n\u0006\u0000\u0000\u00e3\u00e4\u0005\u0015"+ - "\u0000\u0000\u00e4\u00e5\u0003\u0016\u000b\u0000\u00e5\u00e6\u0005\n\u0000"+ - "\u0000\u00e6\u00e7\u0003\u0016\u000b\u0006\u00e7\u00ec\u0001\u0000\u0000"+ - "\u0000\u00e8\u00e9\n\n\u0000\u0000\u00e9\u00ea\u0007\b\u0000\u0000\u00ea"+ - "\u00ec\u0005\"\u0000\u0000\u00eb\u00d3\u0001\u0000\u0000\u0000\u00eb\u00d6"+ - "\u0001\u0000\u0000\u0000\u00eb\u00d9\u0001\u0000\u0000\u0000\u00eb\u00dc"+ - "\u0001\u0000\u0000\u0000\u00eb\u00df\u0001\u0000\u0000\u0000\u00eb\u00e2"+ - "\u0001\u0000\u0000\u0000\u00eb\u00e8\u0001\u0000\u0000\u0000\u00ec\u00ef"+ - "\u0001\u0000\u0000\u0000\u00ed\u00eb\u0001\u0000\u0000\u0000\u00ed\u00ee"+ - "\u0001\u0000\u0000\u0000\u00ee\u0017\u0001\u0000\u0000\u0000\u00ef\u00ed"+ - "\u0001\u0000\u0000\u0000\u00f0\u00f1\u0003\u001c\u000e\u0000\u00f1\u00f3"+ - "\u0005\n\u0000\u0000\u00f2\u00f4\u0005-\u0000\u0000\u00f3\u00f2\u0001"+ - "\u0000\u0000\u0000\u00f3\u00f4\u0001\u0000\u0000\u0000\u00f4\u00f5\u0001"+ - "\u0000\u0000\u0000\u00f5\u00f6\u0003\f\u0006\u0000\u00f6\u0019\u0001\u0000"+ - "\u0000\u0000\u00f7\u00f8\u0005/\u0000\u0000\u00f8\u001b\u0001\u0000\u0000"+ - "\u0000\u00f9\u00fa\u0005/\u0000\u0000\u00fa\u001d\u0001\u0000\u0000\u0000"+ - "\u00fb\u00fc\u0005.\u0000\u0000\u00fc\u001f\u0001\u0000\u0000\u0000\u0018"+ + "\u00ec\b\u000b\n\u000b\f\u000b\u00ef\t\u000b\u0001\f\u0001\f\u0001\f\u0001"+ + "\f\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000f\u0001\u000f\u0001"+ + "\u000f\u0000\u0001\u0016\u0010\u0000\u0002\u0004\u0006\b\n\f\u000e\u0010"+ + "\u0012\u0014\u0016\u0018\u001a\u001c\u001e\u0000\t\u0001\u0000\r\u0011"+ + "\u0001\u0000\u001b\u001c\u0001\u0000+,\u0001\u0000\u001d\u001f\u0002\u0000"+ + "\u001b\u001b \u0001\u0000$\'\u0002\u0000!\"()\u0002\u0000\u0015\u0015"+ + "**\u0001\u0000!\"\u0110\u0000$\u0001\u0000\u0000\u0000\u0002*\u0001\u0000"+ + "\u0000\u0000\u00042\u0001\u0000\u0000\u0000\u00064\u0001\u0000\u0000\u0000"+ + "\b9\u0001\u0000\u0000\u0000\nN\u0001\u0000\u0000\u0000\fb\u0001\u0000"+ + "\u0000\u0000\u000eo\u0001\u0000\u0000\u0000\u0010q\u0001\u0000\u0000\u0000"+ + "\u0012\u00a5\u0001\u0000\u0000\u0000\u0014\u00a7\u0001\u0000\u0000\u0000"+ + "\u0016\u00d1\u0001\u0000\u0000\u0000\u0018\u00f0\u0001\u0000\u0000\u0000"+ + "\u001a\u00f4\u0001\u0000\u0000\u0000\u001c\u00f6\u0001\u0000\u0000\u0000"+ + "\u001e\u00f8\u0001\u0000\u0000\u0000 #\u0003\u0006\u0003\u0000!#\u0003"+ + "\b\u0004\u0000\" \u0001\u0000\u0000\u0000\"!\u0001\u0000\u0000\u0000#"+ + "&\u0001\u0000\u0000\u0000$\"\u0001\u0000\u0000\u0000$%\u0001\u0000\u0000"+ + "\u0000%\'\u0001\u0000\u0000\u0000&$\u0001\u0000\u0000\u0000\'(\u0003\u0002"+ + "\u0001\u0000()\u0005\u0000\u0000\u0001)\u0001\u0001\u0000\u0000\u0000"+ + "*+\u0005\u0001\u0000\u0000+,\u0003\u0004\u0002\u0000,-\u0005\u0002\u0000"+ + "\u0000-.\u0005\u0003\u0000\u0000./\u0005\u0004\u0000\u0000/0\u0003\u000e"+ + "\u0007\u000001\u0005\u0005\u0000\u00001\u0003\u0001\u0000\u0000\u0000"+ + "23\u0003\u001c\u000e\u00003\u0005\u0001\u0000\u0000\u000045\u0005\u0006"+ + "\u0000\u000056\u0003\u001a\r\u000067\u0005\u0007\u0000\u000078\u0003\f"+ + "\u0006\u00008\u0007\u0001\u0000\u0000\u00009:\u0005\b\u0000\u0000:;\u0003"+ + "\u001c\u000e\u0000;D\u0005\u0002\u0000\u0000\u0005"+ + "\t\u0000\u0000>@\u0003\n\u0005\u0000?=\u0001\u0000\u0000\u0000@C\u0001"+ + "\u0000\u0000\u0000A?\u0001\u0000\u0000\u0000AB\u0001\u0000\u0000\u0000"+ + "BE\u0001\u0000\u0000\u0000CA\u0001\u0000\u0000\u0000D<\u0001\u0000\u0000"+ + "\u0000DE\u0001\u0000\u0000\u0000EF\u0001\u0000\u0000\u0000FG\u0005\u0003"+ + "\u0000\u0000GH\u0005\n\u0000\u0000HI\u0003\f\u0006\u0000IJ\u0005\u0007"+ + "\u0000\u0000JL\u0003\u0016\u000b\u0000KM\u0005\u000b\u0000\u0000LK\u0001"+ + "\u0000\u0000\u0000LM\u0001\u0000\u0000\u0000M\t\u0001\u0000\u0000\u0000"+ + "NO\u0003\u001c\u000e\u0000OP\u0005\n\u0000\u0000PQ\u0003\f\u0006\u0000"+ + "Q\u000b\u0001\u0000\u0000\u0000RS\u0005\u0004\u0000\u0000SX\u00050\u0000"+ + "\u0000TU\u0005\t\u0000\u0000UW\u00050\u0000\u0000VT\u0001\u0000\u0000"+ + "\u0000WZ\u0001\u0000\u0000\u0000XV\u0001\u0000\u0000\u0000XY\u0001\u0000"+ + "\u0000\u0000Y[\u0001\u0000\u0000\u0000ZX\u0001\u0000\u0000\u0000[c\u0005"+ + "\u0005\u0000\u0000\\]\u0005\u0004\u0000\u0000]^\u00050\u0000\u0000^_\u0005"+ + "\f\u0000\u0000_`\u00050\u0000\u0000`c\u0005\u0005\u0000\u0000ac\u0003"+ + "\u001a\r\u0000bR\u0001\u0000\u0000\u0000b\\\u0001\u0000\u0000\u0000ba"+ + "\u0001\u0000\u0000\u0000c\r\u0001\u0000\u0000\u0000df\u0007\u0000\u0000"+ + "\u0000eg\u0003\u0010\b\u0000fe\u0001\u0000\u0000\u0000gh\u0001\u0000\u0000"+ + "\u0000hf\u0001\u0000\u0000\u0000hi\u0001\u0000\u0000\u0000ij\u0001\u0000"+ + "\u0000\u0000jk\u0005\u000b\u0000\u0000kl\u0003\u000e\u0007\u0000lp\u0001"+ + "\u0000\u0000\u0000mn\u0005\u0012\u0000\u0000np\u0003\u0012\t\u0000od\u0001"+ + "\u0000\u0000\u0000om\u0001\u0000\u0000\u0000p\u000f\u0001\u0000\u0000"+ + "\u0000q~\u0003\u001e\u000f\u0000r{\u0005\u0002\u0000\u0000sx\u0003\u0018"+ + "\f\u0000tu\u0005\t\u0000\u0000uw\u0003\u0018\f\u0000vt\u0001\u0000\u0000"+ + "\u0000wz\u0001\u0000\u0000\u0000xv\u0001\u0000\u0000\u0000xy\u0001\u0000"+ + "\u0000\u0000y|\u0001\u0000\u0000\u0000zx\u0001\u0000\u0000\u0000{s\u0001"+ + "\u0000\u0000\u0000{|\u0001\u0000\u0000\u0000|}\u0001\u0000\u0000\u0000"+ + "}\u007f\u0005\u0003\u0000\u0000~r\u0001\u0000\u0000\u0000~\u007f\u0001"+ + "\u0000\u0000\u0000\u007f\u0082\u0001\u0000\u0000\u0000\u0080\u0081\u0005"+ + "\u0013\u0000\u0000\u0081\u0083\u00050\u0000\u0000\u0082\u0080\u0001\u0000"+ + "\u0000\u0000\u0082\u0083\u0001\u0000\u0000\u0000\u0083\u0086\u0001\u0000"+ + "\u0000\u0000\u0084\u0085\u0005\u0014\u0000\u0000\u0085\u0087\u0003\u0016"+ + "\u000b\u0000\u0086\u0084\u0001\u0000\u0000\u0000\u0086\u0087\u0001\u0000"+ + "\u0000\u0000\u0087\u008a\u0001\u0000\u0000\u0000\u0088\u0089\u0005\u0015"+ + "\u0000\u0000\u0089\u008b\u0003\u0012\t\u0000\u008a\u0088\u0001\u0000\u0000"+ + "\u0000\u008a\u008b\u0001\u0000\u0000\u0000\u008b\u0011\u0001\u0000\u0000"+ + "\u0000\u008c\u008d\u0003\u0016\u000b\u0000\u008d\u008e\u0005\u0016\u0000"+ + "\u0000\u008e\u008f\u0003\u0012\t\u0000\u008f\u0090\u0005\n\u0000\u0000"+ + "\u0090\u0091\u0003\u0012\t\u0000\u0091\u00a6\u0001\u0000\u0000\u0000\u0092"+ + "\u0093\u0005\u0017\u0000\u0000\u0093\u0094\u0003\u0018\f\u0000\u0094\u0095"+ + "\u0005\u0007\u0000\u0000\u0095\u0096\u0003\u0016\u000b\u0000\u0096\u0097"+ + "\u0005\u0018\u0000\u0000\u0097\u0098\u0003\u0012\t\u0000\u0098\u00a6\u0001"+ + "\u0000\u0000\u0000\u0099\u009a\u0005\u0002\u0000\u0000\u009a\u009b\u0003"+ + "\u0012\t\u0000\u009b\u009c\u0005\u0003\u0000\u0000\u009c\u00a6\u0001\u0000"+ + "\u0000\u0000\u009d\u009f\u0005\u0004\u0000\u0000\u009e\u00a0\u0003\u0014"+ + "\n\u0000\u009f\u009e\u0001\u0000\u0000\u0000\u00a0\u00a1\u0001\u0000\u0000"+ + "\u0000\u00a1\u009f\u0001\u0000\u0000\u0000\u00a1\u00a2\u0001\u0000\u0000"+ + "\u0000\u00a2\u00a3\u0001\u0000\u0000\u0000\u00a3\u00a4\u0005\u0005\u0000"+ + "\u0000\u00a4\u00a6\u0001\u0000\u0000\u0000\u00a5\u008c\u0001\u0000\u0000"+ + "\u0000\u00a5\u0092\u0001\u0000\u0000\u0000\u00a5\u0099\u0001\u0000\u0000"+ + "\u0000\u00a5\u009d\u0001\u0000\u0000\u0000\u00a6\u0013\u0001\u0000\u0000"+ + "\u0000\u00a7\u00a8\u0003\u001e\u000f\u0000\u00a8\u00a9\u0005\u0019\u0000"+ + "\u0000\u00a9\u00ab\u0003\u0016\u000b\u0000\u00aa\u00ac\u0005\u000b\u0000"+ + "\u0000\u00ab\u00aa\u0001\u0000\u0000\u0000\u00ab\u00ac\u0001\u0000\u0000"+ + "\u0000\u00ac\u0015\u0001\u0000\u0000\u0000\u00ad\u00ae\u0006\u000b\uffff"+ + "\uffff\u0000\u00ae\u00af\u0005\u0002\u0000\u0000\u00af\u00b0\u0003\u0016"+ + "\u000b\u0000\u00b0\u00b1\u0005\u0003\u0000\u0000\u00b1\u00d2\u0001\u0000"+ + "\u0000\u0000\u00b2\u00b3\u0003\u001e\u000f\u0000\u00b3\u00b4\u0005\u001a"+ + "\u0000\u0000\u00b4\u00b5\u0003\u001c\u000e\u0000\u00b5\u00d2\u0001\u0000"+ + "\u0000\u0000\u00b6\u00b7\u0003\u001c\u000e\u0000\u00b7\u00c0\u0005\u0002"+ + "\u0000\u0000\u00b8\u00bd\u0003\u0016\u000b\u0000\u00b9\u00ba\u0005\t\u0000"+ + "\u0000\u00ba\u00bc\u0003\u0016\u000b\u0000\u00bb\u00b9\u0001\u0000\u0000"+ + "\u0000\u00bc\u00bf\u0001\u0000\u0000\u0000\u00bd\u00bb\u0001\u0000\u0000"+ + "\u0000\u00bd\u00be\u0001\u0000\u0000\u0000\u00be\u00c1\u0001\u0000\u0000"+ + "\u0000\u00bf\u00bd\u0001\u0000\u0000\u0000\u00c0\u00b8\u0001\u0000\u0000"+ + "\u0000\u00c0\u00c1\u0001\u0000\u0000\u0000\u00c1\u00c2\u0001\u0000\u0000"+ + "\u0000\u00c2\u00c3\u0005\u0003\u0000\u0000\u00c3\u00d2\u0001\u0000\u0000"+ + "\u0000\u00c4\u00c5\u0007\u0001\u0000\u0000\u00c5\u00d2\u0003\u0016\u000b"+ + "\r\u00c6\u00d2\u0007\u0002\u0000\u0000\u00c7\u00d2\u0003\u001c\u000e\u0000"+ + "\u00c8\u00d2\u00050\u0000\u0000\u00c9\u00d2\u00051\u0000\u0000\u00ca\u00cb"+ + "\u0005-\u0000\u0000\u00cb\u00cc\u0003\u0018\f\u0000\u00cc\u00cd\u0005"+ + "\u0007\u0000\u0000\u00cd\u00ce\u0003\u0016\u000b\u0000\u00ce\u00cf\u0005"+ + "\u0018\u0000\u0000\u00cf\u00d0\u0003\u0016\u000b\u0001\u00d0\u00d2\u0001"+ + "\u0000\u0000\u0000\u00d1\u00ad\u0001\u0000\u0000\u0000\u00d1\u00b2\u0001"+ + "\u0000\u0000\u0000\u00d1\u00b6\u0001\u0000\u0000\u0000\u00d1\u00c4\u0001"+ + "\u0000\u0000\u0000\u00d1\u00c6\u0001\u0000\u0000\u0000\u00d1\u00c7\u0001"+ + "\u0000\u0000\u0000\u00d1\u00c8\u0001\u0000\u0000\u0000\u00d1\u00c9\u0001"+ + "\u0000\u0000\u0000\u00d1\u00ca\u0001\u0000\u0000\u0000\u00d2\u00ed\u0001"+ + "\u0000\u0000\u0000\u00d3\u00d4\n\f\u0000\u0000\u00d4\u00d5\u0007\u0003"+ + "\u0000\u0000\u00d5\u00ec\u0003\u0016\u000b\r\u00d6\u00d7\n\u000b\u0000"+ + "\u0000\u00d7\u00d8\u0007\u0004\u0000\u0000\u00d8\u00ec\u0003\u0016\u000b"+ + "\f\u00d9\u00da\n\t\u0000\u0000\u00da\u00db\u0007\u0005\u0000\u0000\u00db"+ + "\u00ec\u0003\u0016\u000b\n\u00dc\u00dd\n\b\u0000\u0000\u00dd\u00de\u0007"+ + "\u0006\u0000\u0000\u00de\u00ec\u0003\u0016\u000b\t\u00df\u00e0\n\u0007"+ + "\u0000\u0000\u00e0\u00e1\u0007\u0007\u0000\u0000\u00e1\u00ec\u0003\u0016"+ + "\u000b\b\u00e2\u00e3\n\u0006\u0000\u0000\u00e3\u00e4\u0005\u0016\u0000"+ + "\u0000\u00e4\u00e5\u0003\u0016\u000b\u0000\u00e5\u00e6\u0005\n\u0000\u0000"+ + "\u00e6\u00e7\u0003\u0016\u000b\u0006\u00e7\u00ec\u0001\u0000\u0000\u0000"+ + "\u00e8\u00e9\n\n\u0000\u0000\u00e9\u00ea\u0007\b\u0000\u0000\u00ea\u00ec"+ + "\u0005#\u0000\u0000\u00eb\u00d3\u0001\u0000\u0000\u0000\u00eb\u00d6\u0001"+ + "\u0000\u0000\u0000\u00eb\u00d9\u0001\u0000\u0000\u0000\u00eb\u00dc\u0001"+ + "\u0000\u0000\u0000\u00eb\u00df\u0001\u0000\u0000\u0000\u00eb\u00e2\u0001"+ + "\u0000\u0000\u0000\u00eb\u00e8\u0001\u0000\u0000\u0000\u00ec\u00ef\u0001"+ + "\u0000\u0000\u0000\u00ed\u00eb\u0001\u0000\u0000\u0000\u00ed\u00ee\u0001"+ + "\u0000\u0000\u0000\u00ee\u0017\u0001\u0000\u0000\u0000\u00ef\u00ed\u0001"+ + "\u0000\u0000\u0000\u00f0\u00f1\u0003\u001c\u000e\u0000\u00f1\u00f2\u0005"+ + "\n\u0000\u0000\u00f2\u00f3\u0003\f\u0006\u0000\u00f3\u0019\u0001\u0000"+ + "\u0000\u0000\u00f4\u00f5\u0005/\u0000\u0000\u00f5\u001b\u0001\u0000\u0000"+ + "\u0000\u00f6\u00f7\u0005/\u0000\u0000\u00f7\u001d\u0001\u0000\u0000\u0000"+ + "\u00f8\u00f9\u0005.\u0000\u0000\u00f9\u001f\u0001\u0000\u0000\u0000\u0017"+ "\"$ADLXbhox{~\u0082\u0086\u008a\u00a1\u00a5\u00ab\u00bd\u00c0\u00d1\u00eb"+ - "\u00ed\u00f3"; + "\u00ed"; public static final ATN _ATN = new ATNDeserializer().deserialize(_serializedATN.toCharArray()); static { diff --git a/src/main/kotlin/vegas/TypeChecker.kt b/src/main/kotlin/vegas/TypeChecker.kt index 03dd7347..e3d33564 100644 --- a/src/main/kotlin/vegas/TypeChecker.kt +++ b/src/main/kotlin/vegas/TypeChecker.kt @@ -46,16 +46,17 @@ private object Pretty { * Architecture: * 1. **Universe Pass**: Validate type definitions and check for alias cycles. * 2. **Macro Pass**: Validate macro signatures and bodies in a pure context (no roles/fields). - * 3. **Protocol Pass**: Typecheck the game mechanics (Join/Yield/Reveal) and flow. + * 3. **Protocol Pass**: Typecheck the game mechanics (Join/Yield/Reveal/Commit) and flow. * 4. **IR/DAG Pass**: Compile to IR to validate causal structure (legacy). * * Key Invariants: - * - **Hidden Visibility**: `hidden T` is opaque. It is only "opened" (treated as `T`) inside the `where` - * clause of the owning role. This is enforced by the `View` layer. + * - **Commit Visibility**: Fields from `commit` are only visible to the owning role until `reveal`. + * From other players' POV: commit = declaration, reveal = definition, yield = both. + * - **Deferred Where**: The `where` clause on `commit` is stored and checked at `reveal` time. * - **Optionality as Quit State**: The type `opt T` does not mean "nullable" in the general programming * sense. It specifically means "this value might be missing because the actor Quit". - * - `YIELD` without a handler produces `opt T` (unsafe). - * - `YIELD` with a handler produces `T` (safe). + * - `YIELD`/`COMMIT` without a handler produces `opt T` (unsafe). + * - `YIELD`/`COMMIT` with a handler produces `T` (safe). * - `JOIN` always produces `T` (cannot quit from join). */ fun typeCheck(program: GameAst) { @@ -155,7 +156,7 @@ internal class TypeUniverse( fun validateValueAnnotationType(t: TypeExp, node: Ast) { fun go(x: TypeExp) { when (resolve(x)) { - is Hidden -> throw StaticError("'hidden' is only allowed on action parameters", node) + is Hidden -> throw StaticError("'hidden' is internal-only; use 'commit' command instead", node) is Opt -> throw StaticError("'opt' is internal-only (quit optionality); not allowed in annotations", node) is TypeId -> {} // already validated by validateDefined else -> {} @@ -296,10 +297,6 @@ internal class ExprTyper( is Exp.Const.Bool -> BOOL is Exp.Const.Address -> ADDRESS - is Exp.Const.Hidden -> { - throw StaticError("Hidden literals are not supported in expressions. They are only valid as action parameters.", e) - } - is Exp.Var -> view.vars[e.id] ?: throw StaticError("Variable '${e.id.name}' is undefined", e) is Exp.Field -> fieldType(e.fieldRef, view, e) @@ -568,7 +565,9 @@ internal class ProtocolTyper( data class State( val roles: Set = emptySet(), - val fields: Map = emptyMap() + val fields: Map = emptyMap(), + // Track committed fields that haven't been revealed yet, with their source node for error reporting + val unrevealedCommits: Map = emptyMap() ) fun typeGame(game: Ext) { @@ -578,6 +577,11 @@ internal class ProtocolTyper( private fun typeExt(ext: Ext, st: State) { when (ext) { is Ext.Value -> { + // Check that all commits have been revealed + if (st.unrevealedCommits.isNotEmpty()) { + val (field, node) = st.unrevealedCommits.entries.first() + throw StaticError("Commit of '$field' has no corresponding reveal", node) + } // Pass View to Outcome to allow var scoping val view = View(roles = st.roles, fields = st.fields, vars = emptyMap()) typeOutcome(ext.outcome, view) @@ -600,6 +604,7 @@ internal class ProtocolTyper( val role = q.role.id val isJoin = ext.kind == Kind.JOIN || ext.kind == Kind.JOIN_CHANCE val isReveal = ext.kind == Kind.REVEAL + val isCommit = ext.kind == Kind.COMMIT if (isJoin) roles2 += role else if (role !in roles2) throw StaticError("$role is not a role", q.role) @@ -614,6 +619,12 @@ internal class ProtocolTyper( } // Reveal preserves previous structure (opt hidden T -> opt T) isReveal -> revealTypeOf(fr, tRaw, st.fields, q) + // Commit wraps in Hidden (internally) - creates the commitment + isCommit -> { + val base = universe.resolve(tRaw) + // Commit with handler guarantees presence, otherwise Opt + if (q.handler != null) Hidden(base) else Opt(Hidden(base)) + } // Yield with handler guarantees presence (non-nullable) q.handler != null -> stripOpt(universe.resolve(tRaw)) // Yield without handler is nullable (Opt T) @@ -625,13 +636,28 @@ internal class ProtocolTyper( checkWhere(q, st.copy(roles = roles2), m) // Handler Policy B: Handlers can read all currently visible fields + // Note: handlers allowed on yield and commit (for quit behavior), not on join/reveal if (!isJoin && !isReveal) checkHandler(q, roles2, st.fields) deltaMaps += m } val newFields = st.fields + deltaMaps.flatMap { it.entries }.associate { it.key to it.value } - typeExt(ext.ext, State(roles = roles2, fields = newFields)) + + // Track commit/reveal for the "commits must be revealed" invariant + val newUnrevealed = st.unrevealedCommits.toMutableMap() + for (q in ext.qs) { + for ((k, _) in q.params) { + val fr = FieldRef(q.role.id, k.id) + when (ext.kind) { + Kind.COMMIT -> newUnrevealed[fr] = q // Track commit + Kind.REVEAL -> newUnrevealed.remove(fr) // Mark as revealed + else -> {} + } + } + } + + typeExt(ext.ext, State(roles = roles2, fields = newFields, unrevealedCommits = newUnrevealed)) } } } diff --git a/src/main/kotlin/vegas/frontend/Ast.kt b/src/main/kotlin/vegas/frontend/Ast.kt index 7d644d17..a7608059 100644 --- a/src/main/kotlin/vegas/frontend/Ast.kt +++ b/src/main/kotlin/vegas/frontend/Ast.kt @@ -52,7 +52,6 @@ sealed class Exp : Ast() { data class Num(val n: Int) : Const() data class Bool(val truth: Boolean) : Const() data class Address(val n: Int) : Const() - data class Hidden(val value: Const) : Const() } data class Let(val dec: VarDec, val init: Exp, val exp: Exp) : Exp() @@ -82,7 +81,7 @@ data class MacroParam( val type: TypeExp ) : Ast() -enum class Kind { JOIN, YIELD, REVEAL, JOIN_CHANCE } +enum class Kind { JOIN, YIELD, REVEAL, COMMIT, JOIN_CHANCE } sealed class TypeExp : Ast() { object INT : TypeExp(), IntClass @@ -90,7 +89,9 @@ sealed class TypeExp : Ast() { object ADDRESS : TypeExp() object EMPTY : TypeExp() + // Hidden is an internal type created for commit fields - not user-facing syntax data class Hidden(val type: TypeExp) : TypeExp() + data class TypeId(val name: String) : TypeExp() { override fun toString(): String = name } @@ -171,11 +172,6 @@ internal fun Exp.freeVars(bound: Set = emptySet()): Set { go(e.exp, b2) } - is Exp.Const.Hidden -> { - // hidden(payload) – just recurse into payload - go(e.value as Exp, b) - } - is Exp.Const.Num, is Exp.Const.Bool, is Exp.Const.Address, diff --git a/src/main/kotlin/vegas/frontend/AstTranslator.java b/src/main/kotlin/vegas/frontend/AstTranslator.java index e90085f4..803917b7 100644 --- a/src/main/kotlin/vegas/frontend/AstTranslator.java +++ b/src/main/kotlin/vegas/frontend/AstTranslator.java @@ -299,6 +299,7 @@ private Kind toKind(Token kind) { case "join" -> Kind.JOIN; case "yield" -> Kind.YIELD; case "reveal" -> Kind.REVEAL; + case "commit" -> Kind.COMMIT; case "random" -> Kind.JOIN_CHANCE; default -> throw new AssertionError(); }; @@ -306,7 +307,7 @@ private Kind toKind(Token kind) { private VarDec vardec(VarDecContext ctx) { TypeExp type = type(ctx); - return new VarDec(var(ctx.varId()), (ctx.hidden != null) ? withSpan(new TypeExp.Hidden(type), ctx.typeExp()) : type); + return new VarDec(var(ctx.varId()), type); } private TypeExp type(VarDecContext ctx) { diff --git a/src/main/kotlin/vegas/frontend/MacroInliner.kt b/src/main/kotlin/vegas/frontend/MacroInliner.kt index 29e10ef8..fcfd83ab 100644 --- a/src/main/kotlin/vegas/frontend/MacroInliner.kt +++ b/src/main/kotlin/vegas/frontend/MacroInliner.kt @@ -101,10 +101,6 @@ private fun inlineMacrosInExp(exp: Exp, macroEnv: Map): Exp = w exp = inlineMacrosInExp(exp.exp, macroEnv) ) - is Exp.Const.Hidden -> exp.copy( - value = inlineMacrosInExp(exp.value as Exp, macroEnv) as Exp.Const - ) - // Leaves: no inlining needed is Exp.Var, is Exp.Field, is Exp.Const.Num, is Exp.Const.Bool, is Exp.Const.Address, Exp.Const.UNDEFINED -> exp @@ -183,10 +179,6 @@ private fun substituteParams(exp: Exp, substitution: Map): Exp = whe ) } - is Exp.Const.Hidden -> exp.copy( - value = substituteParams(exp.value as Exp, substitution) as Exp.Const - ) - // Leaves: no substitution needed is Exp.Field, is Exp.Const.Num, is Exp.Const.Bool, is Exp.Const.Address, Exp.Const.UNDEFINED -> exp diff --git a/src/main/kotlin/vegas/frontend/ToIR.kt b/src/main/kotlin/vegas/frontend/ToIR.kt index 858aa36c..249e5249 100644 --- a/src/main/kotlin/vegas/frontend/ToIR.kt +++ b/src/main/kotlin/vegas/frontend/ToIR.kt @@ -316,7 +316,10 @@ private fun lowerQuery(query: Query, kind: Kind, typeEnv: Map true - else -> false -} - private fun lowerType(type: AstType, typeEnv: Map): Type { return when (type) { AstType.INT -> Type.IntType @@ -443,7 +441,6 @@ private fun lowerExpr(exp: AstExpr, typeEnv: Map): Expr is AstExpr.Const.Num -> Expr.Const.IntVal(exp.n) is AstExpr.Const.Bool -> Expr.Const.BoolVal(exp.truth) is AstExpr.Const.Address -> Expr.Const.IntVal(exp.n) - is AstExpr.Const.Hidden -> lowerExpr(exp.value, typeEnv) AstExpr.Const.UNDEFINED -> error("UNDEFINED should not appear in IR") // Field references diff --git a/src/main/kotlin/vegas/semantics/EvalFrontEnd.kt b/src/main/kotlin/vegas/semantics/EvalFrontEnd.kt index 8cb7dfb3..2c964f76 100644 --- a/src/main/kotlin/vegas/semantics/EvalFrontEnd.kt +++ b/src/main/kotlin/vegas/semantics/EvalFrontEnd.kt @@ -67,7 +67,7 @@ fun eval(exp: Exp, env: Env): Const { eval(e.exp, env + (e.dec.v.id to v)) } - is Num, is Bool, is Hidden, is Address -> e + is Num, is Bool, is Address -> e UNDEFINED -> UNDEFINED } diff --git a/src/test/kotlin/vegas/ActionDagTypecheckTest.kt b/src/test/kotlin/vegas/ActionDagTypecheckTest.kt index 7e467a7d..0221359c 100644 --- a/src/test/kotlin/vegas/ActionDagTypecheckTest.kt +++ b/src/test/kotlin/vegas/ActionDagTypecheckTest.kt @@ -12,7 +12,7 @@ class ActionDagTypecheckTest : FreeSpec({ "typechecker should reject invalid DAG structures" - { "should reject reading hidden field before reveal" { - val ast = parseFile("examples/Invalid_ReadHiddenField.vg") + val ast = parseFile("src/test/resources/non-examples/Invalid_ReadHiddenField.vg") var caught = false try { diff --git a/src/test/kotlin/vegas/GambitSemanticTest.kt b/src/test/kotlin/vegas/GambitSemanticTest.kt index ed856ac9..162bf2a8 100644 --- a/src/test/kotlin/vegas/GambitSemanticTest.kt +++ b/src/test/kotlin/vegas/GambitSemanticTest.kt @@ -70,7 +70,7 @@ join Alice() $ 100; join Bob() $ 100; // Alice commits a secret (hidden) -yield Alice(secret: hidden bool); +commit Alice(secret: bool); // Bob tries to respond, but cannot see Alice's secret // Bob should only be able to quit @@ -92,10 +92,10 @@ join Alice() $ 100; join Bob() $ 100; // Alice commits x (hidden) -yield Alice(x: hidden bool); +commit Alice(x: bool); // Alice commits y - can condition on x because Alice sees her own commits -yield Alice(y: hidden bool); +commit Alice(y: bool); // Bob acts yield Bob(z: bool); @@ -167,7 +167,7 @@ join Bob() $ 100; yield Alice(x: bool); // Alice's second write - hidden (overwrites with COMMIT visibility) -yield Alice(x: hidden bool); +commit Alice(x: bool); // Bob tries to use Alice.x // Since Alice's ACTUAL write is hidden, Bob should not see it diff --git a/src/test/kotlin/vegas/MacroTest.kt b/src/test/kotlin/vegas/MacroTest.kt index 63ba4a17..9ec3c7db 100644 --- a/src/test/kotlin/vegas/MacroTest.kt +++ b/src/test/kotlin/vegas/MacroTest.kt @@ -266,12 +266,14 @@ class MacroTest : FreeSpec({ inlined.macros.size shouldBe 0 } - "macros with hidden values in expressions" { + "macros with commit-reveal patterns" { val code = """ type num = {1..5} macro addBonus(x: int, bonus: int): int = x + bonus; - join A(secret: hidden num) $ 100; + join A() $ 100; join B(public: num) $ 100; + commit A(secret: num); + reveal A(secret: num); withdraw { A -> addBonus(B.public, 10); B -> addBonus(B.public, 5); diff --git a/src/test/kotlin/vegas/TypeCheckerTest.kt b/src/test/kotlin/vegas/TypeCheckerTest.kt index 8870a3b3..101bade0 100644 --- a/src/test/kotlin/vegas/TypeCheckerTest.kt +++ b/src/test/kotlin/vegas/TypeCheckerTest.kt @@ -25,7 +25,6 @@ private object B { fun n(i: Int) = Const.Num(i) fun b(v: Boolean) = Const.Bool(v) fun addr(i: Int) = Const.Address(i) - fun hid(e: Const) = Const.Hidden(e) // variables / members fun v(name: String) = Var(VarId(name)) @@ -51,7 +50,7 @@ private object B { fun i(name: String) = VarDec(v(name), INT) fun bl(name: String) = VarDec(v(name), BOOL) fun opt(t: TypeExp) = Opt(t) - fun hidden(t: TypeExp) = Hidden(t) + // Hidden is an internal type created by TypeChecker for commit fields // queries and binds private fun q(role: Role, params: List = emptyList(), deposit: Int = 0, where: Exp = b(true), handler: Outcome? = null) = @@ -63,6 +62,9 @@ private object B { fun yieldTo(role: Role, params: List, where: Exp = b(true), handler: Outcome? = null) = Ext.Bind(Kind.YIELD, listOf(q(role, params, 0, where, handler)), Ext.Value(Value(emptyMap()))) + fun commitTo(role: Role, params: List, where: Exp = b(true), handler: Outcome? = null) = + Ext.Bind(Kind.COMMIT, listOf(q(role, params, 0, where, handler)), Ext.Value(Value(emptyMap()))) + fun reveal(role: Role, params: List, where: Exp = b(true), handler: Outcome? = null) = Ext.Bind(Kind.REVEAL, listOf(q(role, params, 0, where, handler)), Ext.Value(Value(emptyMap()))) @@ -304,58 +306,73 @@ class TypeCheckerTest : FreeSpec({ } } - "Type System - Hidden Types" - { + "Type System - Hidden Types (via commit)" - { - "should handle hidden type declarations" - { + "should handle commit declarations (creates hidden fields)" - { withData(nameFn = { it.toString() }, - // join H(); yield H(secret: hidden int) + // join H(); commit H(secret: int); reveal H(secret: int) B.program( B.join(H), - B.yieldTo(H, listOf(B.dec("secret", B.hidden(INT)))) + B.commitTo(H, listOf(B.i("secret"))), + B.reveal(H, listOf(B.i("secret"))) ), - // type door = {0,1,2}; join H(); yield H(car: hidden door) + // type door = {0,1,2}; join H(); commit H(car: door); reveal H(car: door) B.program( types = mapOf(TypeId("door") to Subset(setOf(B.n(0), B.n(1), B.n(2)))), B.join(H), - B.yieldTo(H, listOf(B.dec("car", B.hidden(TypeId("door"))))) + B.commitTo(H, listOf(B.dec("car", TypeId("door")))), + B.reveal(H, listOf(B.dec("car", TypeId("door")))) ), - // join H(); yield H(x: hidden int, y: int) + // join H(); commit H(x: int); yield H(y: int); reveal H(x: int) B.program( B.join(H), - B.yieldTo(H, listOf(B.dec("x", B.hidden(INT)), B.dec("y", INT))) + B.commitTo(H, listOf(B.i("x"))), + B.yieldTo(H, listOf(B.i("y"))), + B.reveal(H, listOf(B.i("x"))) ), - // join H(); yield H(a: hidden bool, b: hidden bool) + // join H(); commit H(a: bool, b: bool); reveal H(a: bool, b: bool) B.program( B.join(H), - B.yieldTo(H, listOf(B.dec("a", B.hidden(BOOL)), B.dec("b", B.hidden(BOOL)))) + B.commitTo(H, listOf(B.bl("a"), B.bl("b"))), + B.reveal(H, listOf(B.bl("a"), B.bl("b"))) ) ) { prog -> shouldNotThrow { typeCheck(prog) } } } + "should reject commits without corresponding reveals" { + val bad = B.program( + B.join(H), + B.commitTo(H, listOf(B.i("secret"))) + // missing: B.reveal(H, listOf(B.i("secret"))) + ) + val exception = shouldThrow { typeCheck(bad) } + exception.message shouldContain "no corresponding reveal" + } + "should validate reveal operations" - { - "accepts revealing hidden values" { + "accepts revealing committed values" { val validReveals = listOf( - // join H(); yield H(s: hidden int); reveal H(s: int) + // join H(); commit H(s: int); reveal H(s: int) B.program( B.join(H), - B.yieldTo(H, listOf(B.dec("s", B.hidden(INT)))), - B.reveal(H, listOf(B.dec("s", INT))) + B.commitTo(H, listOf(B.i("s"))), + B.reveal(H, listOf(B.i("s"))) ), - // type door = {0,1,2}; join H(); yield H(car: hidden door); reveal H(car: door) + // type door = {0,1,2}; join H(); commit H(car: door); reveal H(car: door) B.program( types = mapOf(TypeId("door") to Subset(setOf(B.n(0), B.n(1), B.n(2)))), B.join(H), - B.yieldTo(H, listOf(B.dec("car", B.hidden(TypeId("door"))))), + B.commitTo(H, listOf(B.dec("car", TypeId("door")))), B.reveal(H, listOf(B.dec("car", TypeId("door")))) ), - // join H(); yield H(a: hidden int, b: hidden bool); reveal H(a: int, b: bool) + // join H(); commit H(a: int, b: bool); reveal H(a: int, b: bool) B.program( B.join(H), - B.yieldTo(H, listOf(B.dec("a", B.hidden(INT)), B.dec("b", B.hidden(BOOL)))), - B.reveal(H, listOf(B.dec("a", INT), B.dec("b", BOOL))) + B.commitTo(H, listOf(B.i("a"), B.bl("b"))), + B.reveal(H, listOf(B.i("a"), B.bl("b"))) ) ) validReveals.forEach { program -> @@ -363,7 +380,7 @@ class TypeCheckerTest : FreeSpec({ } } - "rejects revealing non-hidden values" { + "rejects revealing non-committed values" { val bad = B.program( B.join(H), B.yieldTo(H, listOf(B.i("public"))), @@ -376,7 +393,7 @@ class TypeCheckerTest : FreeSpec({ "rejects type mismatches in reveal" { val bad = B.program( B.join(H), - B.yieldTo(H, listOf(B.dec("s", B.hidden(INT)))), + B.commitTo(H, listOf(B.i("s"))), B.reveal(H, listOf(B.bl("s"))) // mismatch: int vs bool ) val exception = shouldThrow { typeCheck(bad) } @@ -826,7 +843,7 @@ class TypeCheckerTest : FreeSpec({ types, B.join(Host, deposit = 100), B.join(Guest, deposit = 100), - B.yieldTo(Host, listOf(B.dec("car", B.hidden(TypeId("door")))), handler = B.pay(Guest to B.n(200))), + B.commitTo(Host, listOf(B.dec("car", TypeId("door"))), handler = B.pay(Guest to B.n(200))), B.yieldTo( Guest, listOf(B.dec("choice", TypeId("door"))), handler = B.pay(Host to B.n(200)) diff --git a/src/test/kotlin/vegas/UnrollerTest.kt b/src/test/kotlin/vegas/UnrollerTest.kt index 9d6f6b30..59010740 100644 --- a/src/test/kotlin/vegas/UnrollerTest.kt +++ b/src/test/kotlin/vegas/UnrollerTest.kt @@ -421,7 +421,7 @@ class UnrollerTest : FreeSpec({ val code = """ join Alice() $ 100; join Bob() $ 100; - yield Alice(secret: hidden bool); + commit Alice(secret: bool); yield Bob(guess: bool); withdraw (Alice.secret == Bob.guess) ? { Alice -> 0; Bob -> 20 } diff --git a/examples/Invalid_ReadHiddenField.vg b/src/test/resources/non-examples/Invalid_ReadHiddenField.vg similarity index 73% rename from examples/Invalid_ReadHiddenField.vg rename to src/test/resources/non-examples/Invalid_ReadHiddenField.vg index 47c59744..e7a1ea34 100644 --- a/examples/Invalid_ReadHiddenField.vg +++ b/src/test/resources/non-examples/Invalid_ReadHiddenField.vg @@ -1,4 +1,4 @@ -// Invalid: B tries to read A's hidden field before it is revealed +// Invalid: B tries to read A's committed field before it is revealed // This is a test case for invalid code that should be rejected by the compiler // Distribution semantics: pot (200 wei) - but this code is invalid @@ -7,7 +7,7 @@ type bit = {0, 1} game main() { join A() $ 100; join B() $ 100; - yield A(secret: hidden bit); - yield B(guess: bit) where B.guess == A.secret; // ERROR: reads hidden field + commit A(secret: bit); + yield B(guess: bit) where B.guess == A.secret; // ERROR: reads committed field withdraw { A -> 0; B -> 200 } } diff --git a/src/test/resources/non-examples/Invalid_RevealWithoutCommit.vg b/src/test/resources/non-examples/Invalid_RevealWithoutCommit.vg new file mode 100644 index 00000000..22ab691e --- /dev/null +++ b/src/test/resources/non-examples/Invalid_RevealWithoutCommit.vg @@ -0,0 +1,10 @@ +// Invalid: Reveal of a field that was never committed +// This should be rejected - you can only reveal what was committed + +game main() { + join A() $ 100; + join B() $ 100; + yield A(x: bool); + reveal A(x: bool); // ERROR: x was yielded, not committed + withdraw { A -> 100; B -> 100 } +} diff --git a/src/test/resources/non-examples/Invalid_UnrevealedCommit.vg b/src/test/resources/non-examples/Invalid_UnrevealedCommit.vg new file mode 100644 index 00000000..510cf6da --- /dev/null +++ b/src/test/resources/non-examples/Invalid_UnrevealedCommit.vg @@ -0,0 +1,10 @@ +// Invalid: Commit without corresponding reveal +// This should be rejected - commits must eventually be revealed + +game main() { + join A() $ 100; + join B() $ 100; + commit A(secret: bool); + yield B(guess: bool); + withdraw { A -> 100; B -> 100 } +}