Questions tagged [program-slicing]

Program slicing is a technique to analyze certain properties of a program by identifying a fragment of the program - the slice - according to a "slicing criterion". Program slicing is particularly useful when debugging programs.

Program slicing is a technique to analyze certain program properties by identifying a fragment of the program – the slice – according to a slicing criterion.

Program slicing is particularly useful when debugging programs.

Concrete slicing techniques:

To determine the reason for infinite loops in programs see .

42 questions
2
votes
1 answer

Slicing using frama-c

I'm using frama-c in order to do some experiments on program slicing. The tool is great and there are a lot of different types of slicing (by result or by statement, for example). I'm using a program data structure like: typedef struct ComplexData…
Luke
  • 25
  • 3
2
votes
1 answer

What does the message "unreachable entry point" mean?

I have a file containing several ACSL assertions (file.c): #include #include void foo() { int a=0; //@ assert(a==0); } void print(const char* text) { int a=0; //@ assert(a==0); printf("%s\n",text); } int…
Paddre
  • 798
  • 1
  • 9
  • 19
2
votes
1 answer

Einstein Riddle using Prolog

I'm trying to solve the Einstein riddle using Prolog. When I'm trying to run by houses(Hs), it shows No. Task is The Brit lives in the red house. The Swede keeps dogs as pets. The Dane drinks tea. The green house is on the immediate left of the…
user3637775
  • 499
  • 4
  • 20
2
votes
2 answers

Logic Puzzle in Prolog - using lists

I am trying to solve the following problem in Prolog, and I think I have coded it right, but my queries simply return false. Any advice on what to change? The problem is as follows: "Bagel Alley, the local bagel shop, was always a location of…
2
votes
1 answer

Slicing for multiple asserts

Is it possible to use Frama-C's slicing plugin to slice for more than one assertion? E.g. given the following code: #include "assert.h" int main() { double a=3; double b=4; b=a+b; double c=123; //@ assert(b>=0); double d=a/b; …
Paddre
  • 798
  • 1
  • 9
  • 19
2
votes
1 answer

Using Soot programmatically to analyze .java source files

I have just started playing around with Soot in order to analyze .java files programmatically. From what I've read, Soot seems to be a very powerful tool for source code analysis but most of the material I found online talks about using it as a…
2
votes
1 answer

Pre-processing Source Code before slicing using Frama-c

Iam trying to compare the source code with the sliced code, but frama-c normalizes the code at parsing time which makes the sliced code statements not identical to the source code statements. Is it possible to Pre-processes the code using frama-c so…
2
votes
1 answer

Backward slice generation for a java file

I have a java file and I want to get all the lines that have impact on result of a specific line (Backward Slice Generation). I know the solution but is there any java code to do that? as an example cosider the following…
HaMi
  • 539
  • 6
  • 23
1
vote
2 answers

Trouble implementing greater-than/inequality sudoku solver in SWI-Prolog

I have been trying to modify the sudoku solver available in the clpfd docs in order to solve greater-than sudoku puzzles, such as this one: Example of greater-than sudoku puzzle In these puzzles, each block contains twelve inequalities between cells…
desalles
  • 13
  • 3
1
vote
1 answer

Basic string slicing from indices

I will state the obvious that I am a beginner. I should also mention that I have been coding in Zybooks, which affects things. My textbook hasn't helped me much I tried sub_lyric= rhyme_lyric[ : ] Zybooks should be able to input an index number can…
Randall McGrath
  • 33
  • 1
  • 3
  • 7
1
vote
3 answers

Python: Given a list of integers x, write a single expression that returns True if all odd index values are twice their preceding values

Given a list of integers, say, x = [5, 10, 6, 12, 10, 20, 11, 22] write a single expression that returns True if all odd index values are twice their preceding values. We need to use skip slicing, zip, all, and list comprehension I'm new to Python…
inferno
  • 55
  • 5
1
vote
3 answers

Solving a puzzle in Prolog about time constraints

Stuck on a Prolog problem. I know the answer (because I did it on paper first), but I cannot figure out how to get Prolog to come up with the answer. Problem: Bill eats a snack every night, having a different fruit and different nuts each night.…
user12957754
1
vote
1 answer

Slicing a C code with Frama-c

I want to slice the unused variables which are shown down with frama-c. But I have no idea which command line should I write to slice all unused variables with one command line Last login: Thu Nov 9 20:48:42 on ttys000 Recep-MacBook-Pro:~…
1
vote
1 answer

Nested List using indexing and slicing

How do I slice or index this list in order to get the answer below? I've tried doing multiple methods of slicing and nothing has worked for me. L = [0, [], [1,2,3,4], [[5],[6,7]], [8,9,10]] newL = [L[0],L[2][1],L[2][2],L[3][0]] Answer: [0, 2, 3,…
1
vote
2 answers

find specific word and read after that word in python

so i am very very new to python. need some basic help. my logic is to find words in text file. party A %aapple 1 Party B %bat 2 Party C c 3 i need to find all the words starts from %. my code is searchfile = open("text.txt", "r") for line in…