TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Program slicing

59 点作者 mhasbini超过 7 年前

7 条评论

andymaule超过 7 年前
Nice to see interest in this here. Program slicing can also be used for everyday tools too, not just formal verification. I did some research with Microsoft Research trying to show how it can be used to discover which parts of program will be affected, before you make a database schema change. I think program slicing has a lot of potential, and is generally under-appreciated because a lot of the research looks for conservative and safe (i.e. no false positives or negatives) analysis. When you relax this constraint, there are many useful things you can do with slicing.<p>Details on one such example here if anyone is interested: <a href="http:&#x2F;&#x2F;www0.cs.ucl.ac.uk&#x2F;staff&#x2F;w.emmerich&#x2F;publications&#x2F;ICSE2008&#x2F;schemaChangeICSE08&#x2F;icse08.pdf" rel="nofollow">http:&#x2F;&#x2F;www0.cs.ucl.ac.uk&#x2F;staff&#x2F;w.emmerich&#x2F;publications&#x2F;ICSE2...</a>
arithma超过 7 年前
I&#x27;ve kind of wanted to formalize this concept ever since I learned about the Static_single_assignment_form used in compilers for optimisation. Programs may be able to benefit greatly from this in terms of refactoring: it&#x27;s basically separating concerns (from a mechanical point of view.) Separated concerns can open venues for parallelism!<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Static_single_assignment_form" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Static_single_assignment_form</a>
评论 #16004451 未加载
zmonx超过 7 年前
Very nice, thank you for posting this!<p>Program slicing is especially useful when debugging and reasoning about programs in <i>declarative</i> languages, such as Prolog.<p>In Prolog, it is natural to think in terms of generalizations and specializations of programs, and you can often explain important program properties such as <i>nontermination</i> and <i>failure</i> by showing relevant <i>fragments</i> of clauses.<p>See also <i>failure slicing</i>.<p>In declarative languages, slicing is much more convenient and useful than <i>tracing</i> the execution.
cdevs超过 7 年前
I would be interested in a source code scanner that tells you how many functions or lines can modify a variable and show a table of variables&#x2F;counts. This could be helpful on a new small codebase or checking variables in a specific ugly class that always has scope errors so we can tell our bosses it sucks.
评论 #16004271 未加载
quadcore超过 7 年前
I think every program should be sliced like this and not doing so is a programming mistake. Of course, Im talking <i>before bottlenecks optimization</i>.
评论 #16004394 未加载
nemo1618超过 7 年前
Alan Shreve demonstrated a version of this in Go: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dSqLt8BgbRQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=dSqLt8BgbRQ</a>
userbinator超过 7 年前
This seems like a technique which a lot of programmers use, without ever hearing the name &quot;program slicing&quot; --- I call it &quot;follow the data flow&quot;. It&#x27;s especially useful when reverse-engineering.