ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Program slicing - Wikipedia, the free encyclopedia

Program slicing

From Wikipedia, the free encyclopedia

In computer programming, program slicing is the computation of a program slice. The program slice consists of the parts of a program that may affect the values computed at some point of interest, referred as a slicing criterion. Program slicing can be used in debugging to locate more easily source of errors. Other applications of slicing include software maintenance, optimization, and program analysis.

Slicing techniques has been knowing a rapid development since the original definition of Mark Weiser. At first, the slicing was only static, i.e. applied on the source code with no other information than the source code. Bogdan Korel and Janusz Laski introduced dynamic slicing which works on a specific execution of the program (for a given execution trace). Other forms of slicing exist, for instance path slicing.

Contents

[edit] Static slicing

Based on the original definition of Weiser, informally, a static program slice S consists of all statements in program P that may affect the value of variable v at some point p. The slice is defined for a slicing criterion C=(x,V), where x is a statement in program P and V is a subset of variables in P. A static slicing includes all the statements that affect variable v for a set of all possible inputs at the point of interest. Static slices are computed by finding consecutive sets of indirectly relevant statements, according to data and control dependencies.

[edit] Example

int i;
int sum = 0;
int product = 1;
for(i = 0; i < N; ++i) {
  sum = sum + i;
  product = product *i;
}
write(sum);
write(product);

This new program is a valid slicing of the above program with respect to the criterion (write(sum),{sum}):

int i;
int sum = 0;
 
for(i = 0; i < N; ++i) {
  sum = sum + i;
 
}
write(sum);

In fact, most static slicing techniques, including Weiser's own technique, will also remove the write(sum) statement. Indeed, at the statement write(sum), the value of sum is not dependent of the statement itself.

[edit] See also

[edit] References

[edit] External links

Languages


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -