All of lore.kernel.org
 help / color / mirror / Atom feed
* [cocci] Reconsidering application of selected SmPL isomorphisms
@ 2024-11-25 13:16 Markus Elfring
  2024-11-25 15:37 ` Julia Lawall
  2024-11-25 15:42 ` Julia Lawall
  0 siblings, 2 replies; 14+ messages in thread
From: Markus Elfring @ 2024-11-25 13:16 UTC (permalink / raw)
  To: cocci

Hello,

I would like to clarify software development consequences also for
a simple script variant for the semantic patch language (like the following).


@show_questionable_checks@
expression e1, e2;
statement s1, s2;
@@
 if
 (
*!(e1 || e2)
 )
    s1
 else
    s2


Questionable test result:
Markus_Elfring@Sonne:/home/altes_Heim2/elfring/Projekte/Coccinelle/janitor> spatch --parse-cocci show_questionable_OR_checks2.cocci
…
(

(

(
if (*!*(*e1 *|| *e2*))
|
if (*!*e1 *|| *e2)
)s1 else s2
|
…


I would interpret such data display in the way that the isomorphism “paren”
was applied here.
https://gitlab.inria.fr/coccinelle/coccinelle/-/blob/04f71e76b0857ca12ec7207b26368df78d2b57d4/standard.iso#L389

I find the shown SmPL code transformation inappropriate at this place.
Would we like to apply De Morgan's laws instead?
https://en.wikipedia.org/wiki/De_Morgan%27s_laws

Would we like to reconsider the application of the isomorphism for the switching
of if/else branches accordingly?

Regards,
Markus

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-11-26  9:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 13:16 [cocci] Reconsidering application of selected SmPL isomorphisms Markus Elfring
2024-11-25 15:37 ` Julia Lawall
2024-11-25 15:42 ` Julia Lawall
2024-11-25 16:13   ` Markus Elfring
2024-11-25 16:23     ` Julia Lawall
2024-11-25 16:34       ` Markus Elfring
2024-11-25 16:46         ` Julia Lawall
2024-11-25 16:57           ` [cocci] Advanced handling of logical operator chains (with SmPL)? Markus Elfring
2024-11-25 17:03             ` Julia Lawall
2024-11-25 17:08               ` Markus Elfring
2024-11-25 17:04       ` [cocci] Data processing challenges for pointer expressions Markus Elfring
2024-11-25 17:16         ` Julia Lawall
2024-11-25 17:58           ` Markus Elfring
2024-11-26  9:21           ` [cocci] Data processing challenges for source code analyses Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.