Level-p-complexity of Boolean functions using thinning, memoization, and polynomials

IF 1.1 3区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Journal of Functional Programming Pub Date : 2023-12-12 DOI:10.1017/s0956796823000102
JULIA JANSSON, PATRIK JANSSON
{"title":"Level-p-complexity of Boolean functions using thinning, memoization, and polynomials","authors":"JULIA JANSSON, PATRIK JANSSON","doi":"10.1017/s0956796823000102","DOIUrl":null,"url":null,"abstract":"<p>This paper describes a purely functional library for computing level-<span>p</span>-complexity of Boolean functions and applies it to two-level iterated majority. Boolean functions are simply functions from <span>n</span> bits to one bit, and they can describe digital circuits, voting systems, etc. An example of a Boolean function is majority, which returns the value that has majority among the <span>n</span> input bits for odd <span>n</span>. The complexity of a Boolean function <span>f</span> measures the <span>cost</span> of evaluating it: how many bits of the input are needed to be certain about the result of <span>f</span>. There are many competing complexity measures, but we focus on level-<span>p</span>-complexity — a function of the probability <span>p</span> that a bit is 1. The level-<span>p</span>-complexity <span><span><img data-mimesubtype=\"png\" data-type=\"\" src=\"https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20231209151452171-0101:S0956796823000102:S0956796823000102_inline1.png\"><span data-mathjax-type=\"texmath\"><span>$D_p(f)$</span></span></img></span></span> is the minimum expected cost when the input bits are independent and identically distributed with Bernoulli(<span>p</span>) distribution. We specify the problem as choosing the minimum expected cost of all possible decision trees — which directly translates to a clearly correct, but very inefficient implementation. The library uses thinning and memoization for efficiency and type classes for separation of concerns. The complexity is represented using (sets of) polynomials, and the order relation used for thinning is implemented using polynomial factorization and root counting. Finally, we compute the complexity for two-level iterated majority and improve on an earlier result by J. Jansson.</p>","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1000,"publicationDate":"2023-12-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Functional Programming","FirstCategoryId":"94","ListUrlMain":"https://doi.org/10.1017/s0956796823000102","RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

This paper describes a purely functional library for computing level-p-complexity of Boolean functions and applies it to two-level iterated majority. Boolean functions are simply functions from n bits to one bit, and they can describe digital circuits, voting systems, etc. An example of a Boolean function is majority, which returns the value that has majority among the n input bits for odd n. The complexity of a Boolean function f measures the cost of evaluating it: how many bits of the input are needed to be certain about the result of f. There are many competing complexity measures, but we focus on level-p-complexity — a function of the probability p that a bit is 1. The level-p-complexity Abstract Image$D_p(f)$ is the minimum expected cost when the input bits are independent and identically distributed with Bernoulli(p) distribution. We specify the problem as choosing the minimum expected cost of all possible decision trees — which directly translates to a clearly correct, but very inefficient implementation. The library uses thinning and memoization for efficiency and type classes for separation of concerns. The complexity is represented using (sets of) polynomials, and the order relation used for thinning is implemented using polynomial factorization and root counting. Finally, we compute the complexity for two-level iterated majority and improve on an earlier result by J. Jansson.

查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
利用稀疏化、记忆化和多项式实现布尔函数的平穷复杂性
本文描述了一个用于计算布尔函数级数-p 复杂性的纯函数库,并将其应用于两级迭代多数。布尔函数是简单的从 n 位到 1 位的函数,可以描述数字电路、投票系统等。布尔函数的一个例子是多数函数,它返回奇数 n 的 n 个输入比特中的多数值。布尔函数 f 的复杂度衡量的是求值的成本:需要多少比特的输入才能确定 f 的结果。有许多相互竞争的复杂度度量,但我们关注的是水平-比特复杂度--一个比特为 1 的概率 p 的函数。水平-比特复杂度 $D_p(f)$ 是当输入比特是独立且相同的伯努利(p)分布时的最小预期成本。我们将问题定义为从所有可能的决策树中选择最小的预期成本--这直接转化为一个明显正确但效率极低的实现方法。为了提高效率,库使用了精简和 memoization,并使用类型类来分离关注点。复杂度使用(多项式集)表示,而用于稀疏化的阶次关系则使用多项式因式分解和根计数来实现。最后,我们计算了两级迭代多数的复杂度,并改进了 J. Jansson 早期的一个结果。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
Journal of Functional Programming
Journal of Functional Programming 工程技术-计算机:软件工程
CiteScore
1.70
自引率
0.00%
发文量
9
审稿时长
>12 weeks
期刊介绍: Journal of Functional Programming is the only journal devoted solely to the design, implementation, and application of functional programming languages, spanning the range from mathematical theory to industrial practice. Topics covered include functional languages and extensions, implementation techniques, reasoning and proof, program transformation and synthesis, type systems, type theory, language-based security, memory management, parallelism and applications. The journal is of interest to computer scientists, software engineers, programming language researchers and mathematicians interested in the logical foundations of programming.
期刊最新文献
Signature restriction for polymorphic algebraic effects Asymptotic speedup via effect handlers Static Blame for gradual typing Knuth–Morris–Pratt illustrated Sparcl: A language for partially invertible computation
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1