Velocity Reviews > A method of static code analysis

# A method of static code analysis

Logan Lee
Guest
Posts: n/a

 12-24-2007
This is a method I have devised.

Not really organized but
http://www.geocities.com/logan.lee30...d_examples.pdf.

Definitions

I=if; EI=else if; E=else

(I) is one of I, EI, E or I, EI or I, E.
(I)[3]=I, EI, E
(I)[2]=I, EI or I, E.

Let ((I))_1 be F, (I)_i, F and ((I))_2 be (I)_i, F, (I)_j. Then:

((I))_1[5]=F, (I)[3], F
((I))_2[7]=(I)[3], F, (I)[3].

Sample Code:

Let's try to represent(I apologise for incorrect syntax in relation to
ANSI C):

for
if
else if

in terms of our definition above.

It is equivalent to ((I))_1[3] or F, (I)[2]. Actually ((I))_1[3]=F, (I)[2].

Note that this is ambiguous because we haven't distinguished between
(I)[2]= I, EI or I, E. But this is a minor issue that can be resolved very
easily. The point is that using my method we are able to quickly classify
a certain control loop structure found in ANSI C code. Tell me what you
think. Thanks.

Logan Lee
Guest
Posts: n/a

 12-24-2007
Mon, 24 Dec 2007 01:39:14 +0000에, Logan Lee 썼습니다:

> This is a method I have devised.
>
> Not really organized but
> http://www.geocities.com/logan.lee30...d_examples.pdf.
>
> Definitions
>
> I=if; EI=else if; E=else
>
> (I) is one of I, EI, E or I, EI or I, E.
> (I)[3]=I, EI, E
> (I)[2]=I, EI or I, E.
>
> Let ((I))_1 be F, (I)_i, F and ((I))_2 be (I)_i, F, (I)_j. Then:
>
> ((I))_1[5]=F, (I)[3], F
> ((I))_2[7]=(I)[3], F, (I)[3].
>
> Sample Code:
>
> Let's try to represent(I apologise for incorrect syntax in relation to
> ANSI C):
>
> for
> if
> else if
>
> in terms of our definition above.
>
> It is equivalent to ((I))_1[3] or F, (I)[2]. Actually ((I))_1[3]=F, (I)[2].
>
> Note that this is ambiguous because we haven't distinguished between
> (I)[2]= I, EI or I, E. But this is a minor issue that can be resolved very
> easily. The point is that using my method we are able to quickly classify
> a certain control loop structure found in ANSI C code. Tell me what you
> think. Thanks.

http://www.geocities.com/logan.lee30...e_example.html

Logan Lee
Guest
Posts: n/a

 12-24-2007
Mon, 24 Dec 2007 01:39:14 +0000에, Logan Lee 썼습니다:

> This is a method I have devised.
>
> Not really organized but
> http://www.geocities.com/logan.lee30...d_examples.pdf.
>
> Definitions
>
> I=if; EI=else if; E=else
>
> (I) is one of I, EI, E or I, EI or I, E.
> (I)[3]=I, EI, E
> (I)[2]=I, EI or I, E.
>
> Let ((I))_1 be F, (I)_i, F and ((I))_2 be (I)_i, F, (I)_j. Then:
>
> ((I))_1[5]=F, (I)[3], F
> ((I))_2[7]=(I)[3], F, (I)[3].
>
> Sample Code:
>
> Let's try to represent(I apologise for incorrect syntax in relation to
> ANSI C):
>
> for
> if
> else if
>
> in terms of our definition above.
>
> It is equivalent to ((I))_1[3] or F, (I)[2]. Actually ((I))_1[3]=F, (I)[2].
>
> Note that this is ambiguous because we haven't distinguished between
> (I)[2]= I, EI or I, E. But this is a minor issue that can be resolved very
> easily. The point is that using my method we are able to quickly classify
> a certain control loop structure found in ANSI C code. Tell me what you
> think. Thanks.

Logan Lee
Guest
Posts: n/a

 12-24-2007
Mon, 24 Dec 2007 01:39:14 +0000에, Logan Lee 썼습니다:

> This is a method I have devised.
>
> Not really organized but
> http://www.geocities.com/logan.lee30...d_examples.pdf.
>
> Definitions
>
> I=if; EI=else if; E=else
>
> (I) is one of I, EI, E or I, EI or I, E.
> (I)[3]=I, EI, E
> (I)[2]=I, EI or I, E.
>
> Let ((I))_1 be F, (I)_i, F and ((I))_2 be (I)_i, F, (I)_j. Then:
>
> ((I))_1[5]=F, (I)[3], F
> ((I))_2[7]=(I)[3], F, (I)[3].
>
> Sample Code:
>
> Let's try to represent(I apologise for incorrect syntax in relation to
> ANSI C):
>
> for
> if
> else if
>
> in terms of our definition above.
>
> It is equivalent to ((I))_1[3] or F, (I)[2]. Actually ((I))_1[3]=F, (I)[2].
>
> Note that this is ambiguous because we haven't distinguished between
> (I)[2]= I, EI or I, E. But this is a minor issue that can be resolved very
> easily. The point is that using my method we are able to quickly classify
> a certain control loop structure found in ANSI C code. Tell me what you
> think. Thanks.

http://www.geocities.com/logan.lee30..._analysis.html

Remo D.
Guest
Posts: n/a

 12-24-2007
Logan Lee ha scritto:
>> This is a method I have devised.
>> Definitions
>>
>> I=if; EI=else if; E=else
>> [...]

Sorry Logan, I might have missed it. Which problem are you trying to solve?

Remo.D

Mark McIntyre
Guest
Posts: n/a

 12-24-2007
On Mon, 24 Dec 2007 01:39:14 +0000, Logan Lee wrote:

> This is a method I have devised.

(snip )

> very easily. The point is that using my method we are able to quickly
> classify a certain control loop structure found in ANSI C code. Tell me
> what you think. Thanks.

Euh, what exactly is the problem you're trying to solve, and how is it a
C problem?