EBNF of Secure Programmable Block Definition Language (SPBDL) ============================================================= Program ::= {Input} {Element} {Output}; Input ::= Line 'input' Player [ '[' Positive ']' ]; Element ::= Gate | Block | Vector; Gate ::= Line 'gate' 'in' '[' WireSlice ']' 'p' '[' {Bit} ']'; Block ::= Line 'block' '[' Btype ']' 'out' Positive 'in' '[' LineSlice ']' [ 's' '[' {Unsigned} ']' ]; PPB ::= Line 'ppb' '[' PPBtype ']' 'out' Positive 'in' '[' LineSlice ']' [ 's' '[' {Unsigned} ']' ] 'p' '[' PPBprog ']'; Vector ::= Line 'vector' '[' WireSlice ']'; Output ::= Line 'output' Player Line; Btype ::= 'addsub' | 'mul' | 'x' | 'y' | 'mux' ; PPBtype ::= 'addsub' | 'addsubc' | 'mulc' | 'comp' | 'compc' | 'bool' | 'boolc' | 'x' | 'y' | 'mux' | 'sel' | 'perm' | 'uc' | 'minmax' | 'minmaxindex'; PPBprog ::= Paddsub | Paddubc | Pmulc | Pcomp | Pcompc | Pbool | Pboolc | Px | Py | Pmux | Psel | Pperm | Puc | Pminmax; Paddsub ::= 'ADD' | 'SUB'; Paddsubc ::= Paddsub Unsigned; Pmulc ::= Unsigned; Pcomp ::= 'L' | 'G' | 'E' | 'LE' | 'GE' | 'NE'; Pcompc ::= Pcomp Unsigned; Pbool ::= 'AND' | 'OR' | 'XOR' | 'NAND'| 'NOR' | 'XNOR'; Pboolc ::= Pbool Unsigned; Px ::= 'H' | 'X' ; Py ::= 'L' | 'R' ; Pmux ::= 'L' | 'R' ; Psel ::= Unsigned {Unsigned}; Pperm ::= Unsigned {Unsigned}; Puc ::= Unsigned ; Pminmax ::= 'MIN' | 'MAX'; Line ::= Unsigned; Wire ::= Line | Line '.' Unsigned; Player ::= 'alice' | 'bob'; WireSlice ::= {Wire} | Line '..' Line | Line '.' Unsigned '..' Unsigned; LineSlice ::= {Line} | Line '..' Line; Bit ::= '0'|'1'; Digit ::= '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'; Unsigned ::= Digit {Digit}; Positive ::= ('1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9') {Digit};