[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-83779-en":3,"doc-seo-83779-105":30,"detail-sidebar-cat-0-en-105":91},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":13,"seo_description":14,"update_tm":28,"read_time":29},83779,4398048950312,"Violet","https://ap-avatar.wpscdn.com/avatar/400002538284de19e3c?_k=1778320343897328908",8,"Research & Report","CSB A Counting and Sampling Tool for Bit vectors","Satisfiability Modulo Theory (SMT) solvers are widely used for automated reasoning, yet solving only satisfiability often falls short when solution-set statistics and sampling are needed. This work examines whether modern CNF model counters and CNF samplers can extend SMT solving to support counting and sampling over bit-vectors. It introduces csb, an efficient, user-friendly tool that bit-blasts bit-vector formulas to CNF, preserves variable mappings, and integrates ApproxMC, Ganak, UniGen, and CMSGen to deliver exact, projected, and approximate counting plus uniform-like and almost-uniform sampling with strong experimental performance.","CSB: A Counting and Sampling tool for Bit-vectors ∗  \nArijit Shaw  \nChennai Mathematical Institute IAI, TCG-CREST, Kolkata  \nKuldeep S. Meel  \nGeorgia Institute of Technology University of Toronto  \narXiv :2607 .04 142v 1 [ cs .LO] 5 Jul 2026  \nAbstract  \nSatisfiability Modulo Theory (SMT) solvers have significantly advanced automated reasoning due to their effectiveness in solving problems across various fields. With the advancement in SMT solvers, there is growing interest in exploring capabilities beyond mere satisfiability, similar to the progression observed in Boolean satisfiability solvers that expanded into counting and sampling. In this study, we investigate the following question:  \nCan we rely on modern CNF model counters and CNF samplers to extend modern SMT solvers to handle the problems of counting and sampling over bit-vectors?  \nThe main contribution of this work is the development of an efficient and user-friendly tool, csb, that solves a bunch of problems around model counting and sampling on the theory of bit-vectors, namely exact and approximate projected and non-projected model counting, along with the almost-uniform and uniform-like sampling. In the case of exact counting, projected counting, and uniform sampling, csb is the first tool to solve the problem—although all these problems have a lot of applications.  \nOur tool csb converts the bit-vector formula into a CNF formula using bit-blasting techniques before applying CNF model counters or samplers to perform counting or sampling. It keeps track of the variable mapping between the bitvector and CNF formula and passes that information to the CNF counter. We built our tool on top of SMT solver STP by integrating approximate model counter ApproxMC, exact model counter Ganak, almost-uniform sampler UniGen, and uniform-like sampler CMSGen in it. Our experiments demonstrate significant performance improvements over existing methods.  \n1 Introduction  \nThe paradigm of Satisfiability Modulo Theory (SMT) solving has been central to advancesin hardware and software verification over the past two decades. Over time, the community has developed several scalable state-of-the-art SMT solvers [BBB+22 , BSST21 , BB09 , CGSS13 , NP23] . For many problem instances, satisfiability alone does not suffice, and one is often interested in computations over the solution set. Two such problems are computing an estimate of the cardinality of the solution set and uniformly sampling a solution from the entire solution set. As a starting point, we focus on the case when the underlying formula is expressed in QF BV, or quantifier-free bit-vector arithmetic (referred to as bit-vectors hereafter) . Our choice of QF BV stems from its being one of the first theories to be investigated in the context of SMT solving, as well as recent empirical studies showing the importance of counting problems over bit-vector formulas in domains such as cryptography [BZG20] and software verification [GFB21, TW21] . In many of the problems like [TW21], the underlying problem becomes a projected model counting problem, where we want the count projected on a subset of variables.  \n∗ This is the authors’ version of the article published in Acta Informatica [SM26] . The corresponding tool csbis available at [https://github.com/meelgroup/csb](https://github.com/meelgroup/csb).  \nThe problem of counting and sampling over bit-vectors can be addressed through two methods:(i) reasoning directly over bit-vectors, or (ii) reducing the problem to a Boolean formula in conjunctive normal form (CNF) . While the former approach has been studied in recent years using lifting techniques for word-level constraints [CDM15 , CMMV16 , DBS18 , DBS19], the latter has not been thoroughly assessed. In this paper, we focus on whether a modern SMT solver can be extended with CNF-based model counters and CNF samplers to efficiently address the problems of counting and sampling over bit-vectors. Our investigation into the design of ","cbCaikoiEUdA7zV7","https://ap.wps.com/l/cbCaikoiEUdA7zV7","pdf",655429,3,1,16,"English","en",105,"# Introduction\n# Background\n# Framework Overview\n# Experimental Methodology and Results\n# Conclusion","[{\"question\":\"What problem does csb address in SMT solving?\",\"answer\":\"csb enables counting and sampling over bit-vector solution sets, including exact and approximate projected and non-projected model counting, as well as uniform-like and almost-uniform sampling.\"},{\"question\":\"How does csb reduce bit-vectors to CNF for counting and sampling?\",\"answer\":\"csb converts bit-vector formulas into CNF using bit-blasting, tracks the variable mapping between bit-vector variables and CNF variables, and forwards that mapping to the CNF counter/sampler.\"},{\"question\":\"Which existing engines does csb integrate?\",\"answer\":\"csb is built on STP and integrates ApproxMC for approximate model counting, Ganak for exact model counting, UniGen for almost-uniform sampling, and CMSGen for uniform-like sampling.\"}]",1784190355,40,{"code":4,"msg":31,"data":32},"ok",{"site_id":25,"language":24,"slug":33,"title":13,"keywords":34,"description":14,"schema_data":35,"social_meta":86,"head_meta":88,"extra_data":90,"updated_unix":28},"csb-a-counting-and-sampling-tool-for-bit-vectors","",{"@graph":36,"@context":85},[37,53,68],{"@type":38,"itemListElement":39},"BreadcrumbList",[40,44,48,50],{"item":41,"name":42,"@type":43,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":45,"name":46,"@type":43,"position":47},"https://docshare.wps.com/document/","Document",2,{"item":49,"name":12,"@type":43,"position":20},"https://docshare.wps.com/document/research-report/",{"item":51,"name":13,"@type":43,"position":52},"https://docshare.wps.com/document/csb-a-counting-and-sampling-tool-for-bit-vectors/83779/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":24,"description":14,"dateModified":61,"datePublished":62,"encodingFormat":60,"isAccessibleForFree":63,"interactionStatistic":64},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":41,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-26","2026-07-16",true,{"@type":65,"interactionType":66,"userInteractionCount":20},"InteractionCounter",{"@type":67},"ViewAction",{"@type":69,"mainEntity":70},"FAQPage",[71,77,81],{"name":72,"@type":73,"acceptedAnswer":74},"What problem does csb address in SMT solving?","Question",{"text":75,"@type":76},"csb enables counting and sampling over bit-vector solution sets, including exact and approximate projected and non-projected model counting, as well as uniform-like and almost-uniform sampling.","Answer",{"name":78,"@type":73,"acceptedAnswer":79},"How does csb reduce bit-vectors to CNF for counting and sampling?",{"text":80,"@type":76},"csb converts bit-vector formulas into CNF using bit-blasting, tracks the variable mapping between bit-vector variables and CNF variables, and forwards that mapping to the CNF counter/sampler.",{"name":82,"@type":73,"acceptedAnswer":83},"Which existing engines does csb integrate?",{"text":84,"@type":76},"csb is built on STP and integrates ApproxMC for approximate model counting, Ganak for exact model counting, UniGen for almost-uniform sampling, and CMSGen for uniform-like sampling.","https://schema.org",{"og:url":51,"og:type":87,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":89,"canonical":51},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":92},[93,97,101,105,110,115,119,122,127,130,134],{"id":21,"doc_module":4,"doc_module_name":46,"category_name":94,"show_sort_weight":95,"slug":96},"Story & Novel",90,"story-novel",{"id":47,"doc_module":4,"doc_module_name":46,"category_name":98,"show_sort_weight":99,"slug":100},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":46,"category_name":102,"show_sort_weight":103,"slug":104},"Exam",70,"exam",{"id":106,"doc_module":4,"doc_module_name":46,"category_name":107,"show_sort_weight":108,"slug":109},5,"Comic",60,"comic",{"id":111,"doc_module":4,"doc_module_name":46,"category_name":112,"show_sort_weight":113,"slug":114},6,"Technology",50,"technology",{"id":116,"doc_module":4,"doc_module_name":46,"category_name":117,"show_sort_weight":29,"slug":118},7,"Healthcare","healthcare",{"id":11,"doc_module":4,"doc_module_name":46,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":46,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":46,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":46,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":46,"category_name":136,"show_sort_weight":106,"slug":137},19,"General","general"]