arrow
Return

An Interpretable Deterministic Framework for Cross-Language Educational Code Similarity Using Code Property Graphs

delete2026-08-27
delete0
delete
OA
AI
T
T. Hareesh
A
Abhinav C. Das
M
M.G. Thushara
DOI:10.1109/access.2026.3727772delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Recognizing algorithmically equivalent code written in different programming languages remains a fundamental challenge in multi-language introductory programming courses. Two programs representing the same algorithm using two different languages—in one case, C and another case, Java—create disjoint syntax trees such that matching tokenization algorithms will not detect algorithmic equivalence between languages. Neural embedding approaches achieve cross-language representation but require labeled fine-tuning corpora unavailable in labeled-data-scarce CS-1 settings, and produce dense vectors that cannot enumerate which algorithmic patterns a submission contains—a capability essential for interpretable instructional feedback. This paper proposes a deterministic, gradient-free framework for cross-language algorithmic similarity in CS-1 educational settings, covering C, C++, and Java. Context Normalization Protocol—a cross-language label unification process applied to Code Property Graph (CPG) nodes—our framework makes it possible to perform direct comparisons between patterns irrespective of language without any form of learned alignment. An extended 21-pattern Computation Evolution Signatures (CES) taxonomy, comprising pattern-level descriptors of variable evolution within loops and recursive calls, covers CS-1 imperative strategies across all three languages. An asymmetrical Tversky formulation compensates for Java’s innate verbosity by assigning a low weight to irrelevant patterns submitted by the students while retaining the ability to capture necessary reference strategies. The framework is able to enumerate the algorithmic patterns present in every submitted code without using GPUs and labeled fine-tuning data. Under matched held-out evaluation, the model attains 88.75% top-1 recall accuracy, whereas the neural baseline achieves 71.37%, highlighting the model’s effectiveness in scenarios where labeled data for fine-tuning is lacking. On the entire 400-program cross-language evaluation task, the aggregate cross-language retrieval accuracy is 87.25% ( $349/400$ , all directions), with the core directions (Java→C/C++ and C $\leftrightarrow $ C++) reaching 88.60% ( $342/386$ ). The Java→C/C++ cross-frontend direction, which constitutes 35% of evaluation pairs, attains 91.43% ( $128/140$ ). The remaining 61.5% of pairs share the C/C++ parser frontend. The aggregate performance is primarily driven by the Java→C/C++ and C $\leftrightarrow $ C++ directions; the remaining sparse directions are detailed in Section VI-B, indicating that the aggregate score does not imply symmetric cross-language performance. Feature weights are estimated using only monolingual C code without retraining ( $p{\lt }0.0001$ compared to a lexical BL-view ablation). All findings described here relate only to CS-1 imperative programming - algorithmic problems within an institution-based sample ( $N=400$ ); the expert-designed ontology and knowledge base deliberately sacrifice scalability for explainability, while generalizability necessitates institutional validation. Artifacts: https://github.com/Abhinav-C-Das/Multi-language-extension-of-semantic-code-similarity-framework-with-code-translation
Keywords:
Automated program assessment
code property graph
computation evolution signatures
cross-language code similarity
Weisfeiler-Lehman graph kernel
context normalization
rule-based code generation
interpretable similarity
educational code assessment
deterministic program analysis

Journal

IEEE Access cover
IEEE Access
IF:
3.6
Papers:
9.8W
Citations:
29.4W

Organization

A
Amrita Vishwa Vidyapeetham
Scholars:
7.0K
Papers: 4.2K
Citations: 3.3K
Cited Papers

Cited Papers

No cited papers available