2016-07-13 67 views
8

In Edward Kmett's article on CRCs Ha la seguente derivazione:Su questo articolo CRC Kmett, perché ab = a0^n + 0^m b? Cosa significa questa notazione?

CRC(ab) =        -- definition of CRC 
crc(INIT,ab) + FINAL =     -- linearity 
crc(INIT,a0^n + 0^m b) + FINAL =  -- additive homomorphism 
crc(INIT,a0^n) + crc(0,0^nb) + FINAL = -- zero blindness 
crc(INIT,a0^n) + crc(0,b) + FINAL  -- definition of crc 
crc(crc(INIT,a),0^n) + crc(0,b) + FINAL -- additive homomorphism 
crc(crc(INIT,0^m)+crc(0,a),0^n) + crc(0,b) + FINAL 

Che cosa nel mondo è a0^n e 0^m b? Sono questi poteri, come a * pow(0, n)? Se è così, non sarebbe 0^n = 0? O XOR? Qualcos'altro interamente? Lo spazio è significativo? Non sto capendo il motivo per cui, ad esempio:

ab = a0^n + 0^m b 

e perché 0^m b divenne 0^nb tra il terzo e il quarto linee?

+0

https://wiki.haskell.org/Power_function –

+0

@ Mika'il Come ho già detto, non avrebbe '0^n = 0 '? Non ha senso. – rityzmon

risposta

9

Sta usando una notazione per le stringhe di bit. Qui a e b sono stringhe di bit di lunghezza m e n rispettivamente.

ab = a concatenated with b 
0^n = the bit string of length n consisting of all 0s 
a0^n = a concatenated with 0^n 
0^m b = 0^m concatenated with b 
a0^n + 0^m b = sum of a0^n and 0^m b (same as the bitwise OR in this case) 
       = a concatenated with b