1 / 21

Bitstate Hashing

Bitstate Hashing. Presented by Yunho Kim Provable Software Lab, KAIST. TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A. Introduction Bitstate hashing Multi-bit hashing Analysis Conclusion. Contents.

debra
Download Presentation

Bitstate Hashing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bitstate Hashing Presented by Yunho Kim Provable Software Lab, KAIST TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAA

  2. Introduction Bitstate hashing Multi-bit hashing Analysis Conclusion Contents Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  3. Explicit model checking problem is reduced to the reachability problem in a state graph Explicit model checker enumerate and explore all the states to solve the reachability problem To prevent the re-exploration of previously visited states, all the states visited are stored in memory Introduction Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  4. To enable fast lookup of states, the states are stored in a hash table • Each item in the table and the list is a pointer to a corresponding state Introduction 0 hash(s) Sorted linked list s h-1 Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  5. All the states should be stored in another memory storage for resolving hash conflicts • If not so, search algorithm allows false positive • The effective way to handle large state space is required for scalability • Mainly two approaches • Reduce the number of states to check • Partial order reduction, statement merging • Reduce the amount of memory needed to store visited states • Loseless method: collapse compression, minimized automaton • Lossymethod: bitstate hashing, hash compact Introduction Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  6. Bitstate hashing uses a bit to store a state • The value 1 in a entry indicates that the state is visited • Each entry in a standard hash table can have ‘sizeof(pointer) £ 8’ bitstate hash entries Bitstate Hashing 0 hash(s) Sorted linked list s (sizeof(pointer) £ 8 £ h) - 1 Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  7. Model checking using bitstate hashing is not sound • If hash(s2) = hash(s3) and s2 is visited, s3 is also considered as a visited state and s6, the violated state, is not reachable • The main issue of bitstate hashing is to estimate and maximize its coverage Bitstate Hashing S1 S2 S3 S4 S5 S6 S7 Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  8. m: the size of a hash table in bits Assume that hash function is uniformly distributed After insertingrstates to the hash table, the probability that a specific bit of the hash table is still 0 is The probability of a false positive at (r+1)th stateis The expected number of omissions when attempting to add n distinct states is Bitstate Hashing Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  9. Bitstate hashing has more coverage than exhaustive search does with a given fixed amount of memory Bitstate Hashing s: the size of state 320bits n: the number of states 219 Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  10. Original bitstate hashing uses a bit to represent the state is visited or not • Multi-bit hashing uses multiple independent hash functions to minimize hash conflicts • If all the positions from hash functions are set to 1, then hash conflict occurs Multi-bit Hashing s1 s2 h1(s2)=3 h2(s2)=6 h1(s1)=1 h2(s1)=3 Conflict Not conflict 0 9 Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  11. m: the size of a hash table in bits k: the number of independent hash functions used Assume that all hash functions are uniformly distributed After insertingr states, the probability that a specific bit is still 0 is The probability of a false positive at (r+1)thstates is Multi-bit Hashing Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  12. m: the size of a hash table in bits k: the number of independent hash functions used The expected number of omissions when attempting to add n distinct states is To obtain the best coverage for a fixed m and n, we have to choose appropriate value of k The estimate for the best value of k is derived Multi-bit Hashing Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  13. Multi-bit hashing uses two or more independent hash functions to minimize hash conflicts • It means multi-bit hashing is used to maximize coverage Multi-bit Hashing m: 1MB = 223 bits n: 626,211 From Fast and Accurate Bitstate Verification for SPIN by Peter C. Dillinger and PanagiotisManolios in SPIN 2004 Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  14. Using two independent hash functions for a state is inadequate for efficiency • The case k=2 takes twice time compared with k=1 for hash calculation • Instead, We use double hashing scheme used for hash resolution • It shows as good coverage as independent hash functions does Multi-bit Hashing Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  15. Multi-bit Hashing Double hash algorithm Input a, b: hash function d: input value m: the size of hash table k: the number of hash functions used Output f: array of bit positions Procedure 1 x := a(d)%m 2 y := b(d)%m 3 f[0] := x 4 i := 1 5 while i < k 6 x := (x+y)%m 7 f[i] := x 8 i := +1 In SPIN, the values of a(d) and b(d) are calculated from Jenkins’ hash function Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  16. Multi-bit Hashing Triple hashing algorithm extended from double hashing algorithm Input a, b, c: hash function d: input value m: the size of hash table k: the number of hash functions used Output f: array of bit positions Procedure 1 x, y, z := a(d)%m, b(d)%m, c(d)%m 2 f[0] := x 3 i := 1 4 while i < k 5 x := (x+y)%m 6 f[i] := x 7 Y := (y+z)%m 8 i := i+1 In SPIN, the values of a(d),b(d), and c(d) are calculated from Jenkins’ hash function Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  17. Experimental results • n = 606,211, m = 224 bits, k=21 Multi-bit Hashing Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  18. Experimental results • n = 606,211, m = 224 bits, Multi-bit Hashing Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  19. Experimental results • n = 606,211, m = 3 £ 8 M bits, k = 30 Multi-bit Hashing Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  20. Bitstate hashing can give a good coverage in a fixed amount of memory Model checking using bitstate hashing is not sound but does not generate an infeasible counterexample Multi-bit hashing using triple hashing scheme can provide good coverage efficiently Conclusion Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

  21. The SPIN Model Checker by Gerard J. Holzmann Addison –Wesley, 2004 An Analysis of Bitstate Hashing by Gerard J. Holzmann in FMSD 1998 Fast and Accurate Bitstate Verification for SPIN by Peter C. Dillinger and PanagiotisManolios in SPIN 2004 Reference Bitstate Hashing, Yunho Kim, Provable Software Lab, KAIST

More Related