Our paper compares the correctness, efficiency, and maintainability of human-generated and AI-generated program code. For that, we analyzed the computational resources of AI- and human-generated ...program code using metrics such as time and space complexity as well as runtime and memory usage. Additionally, we evaluated the maintainability using metrics such as lines of code, cyclomatic complexity, Halstead complexity and maintainability index. For our experiments, we had generative AIs produce program code in Java, Python, and C++ that solves problems defined on the competition coding website leetcode.com. We selected six LeetCode problems of varying difficulty, resulting in 18 program codes generated by each generative AI. GitHub Copilot, powered by Codex (GPT-3.0), performed best, solving 9 of the 18 problems (50.0%), whereas CodeWhisperer did not solve a single problem. BingAI Chat (GPT-4.0) generated correct program code for seven problems (38.9%), ChatGPT (GPT-3.5) and Code Llama (Llama 2) for four problems (22.2%) and StarCoder and InstructCodeT5+ for only one problem (5.6%). Surprisingly, although ChatGPT generated only four correct program codes, it was the only generative AI capable of providing a correct solution to a coding problem of difficulty level hard. In summary, 26 AI-generated codes (20.6%) solve the respective problem. For 11 AI-generated incorrect codes (8.7%), only minimal modifications to the program code are necessary to solve the problem, which results in time savings between 8.9% and even 71.3% in comparison to programming the program code from scratch.
In software, an algorithm is a well-organized sequence of actions that provides the optimal way to complete a task. Algorithmic thinking is also essential to break-down a problem and conceptualize ...solutions in some steps. The proper selection of an algorithm is pivotal to improve computational performance and software productivity as well as to programming learning. That is, determining a suitable algorithm from a given code is widely relevant in software engineering and programming education. However, both humans and machines find it difficult to identify algorithms from code without any meta-information. This study aims to propose a program code classification model that uses a convolutional neural network (CNN) to classify codes based on the algorithm. First, program codes are transformed into a sequence of structural features (SFs). Second, SFs are transformed into a one-hot binary matrix using several procedures. Third, different structures and hyperparameters of the CNN model are fine-tuned to identify the best model for the code classification task. To do so, 61,614 real-world program codes of different types of algorithms collected from an online judge system are used to train, validate, and evaluate the model. Finally, the experimental results show that the proposed model can identify algorithms and classify program codes with a high percentage of accuracy. The average precision, recall, and F-measure scores of the best CNN model are 95.65%, 95.85%, and 95.70%, respectively, indicating that it outperforms other baseline models.
The radiations emitted via 19F(α,nγ), 19F(α,pγ), and 19F(α,α′γ) reactions in compounds containing alpha-emitting elements and fluorine are used for non-destructive neutron and gamma-ray analyses in ...monitoring the contents of nuclear fissile materials during the manufacture, processing, and storage of nuclear fuels. As far as the literature survey confirms, the data available on the yield of (α,n) reaction on fluorine, which depends on alpha particle energy, have significant dispersion. For the accompanying gamma-rays, on the other hand, no reliable absolute data exist for the production yield of gamma-rays per number of interacting alpha particles or emitted nucleons as a function of alpha particle energy. Therefore, to improve the monitoring and control of nuclear materials and to ensure the safety of production processes, the present study was undertaken, where the neutron yields and energy spectra were calculated using the Nedis-2m program taking into account the updated values of the total cross-section for (α,n) reactions on 19F. The resulting Nedis-2m input datasets were used in the MCNP6 code to calculate the leakage multiplication factor and neutron energy spectrum.
•The necessity of updated reference data for 19F(α,n)-reaction yield is confirmed.•Nedis2m with updated data refined neutron and gamma yields and energy spectra.•The results of the study improve controlling of nuclear materials.•The detection of fusion α particles can be improved by the results of this study.
The 13C (α,n)16O reaction cross-section is important data for nuclear physics, astrophysical, and neutrino physics experiments, however, they exhibit uncertainties due to the discrepancies in the ...experimental data. In this study, using the Nedis-2m program code, the energy spectrum of α-induced neutrons in a thin carbon target was calculated and the corresponding reaction cross-section was refined in the alpha particle energy range of 5–8 MeV. The results were used to calculate the intensity and energy spectrum of background neutrons produced in the liquid scintillator of KamLAND. The results will be useful in a variety of astrophysical and neutrino experiments especially those based on LS or Gd-LS detectors.
•Neutron energy spectrum of 13C (alpha,n)16O in a thin carbon target was calculated.•Cross-section data of 13C (alpha,n)16O reaction was corrected for alpha energy range of 5–8 MeV.•Intensity and energy spectrum of background neutrons produced in liquid scintillator of KamLAND were calculated.
Objective
: due to the rapid technological changes, digital economy and contractual relations determine law transformation and legislation development towards adaptation to prospective spreading and ...application of smart contracts in civil and commercial turnover. In this regard, the study focuses on determining the legal essence of smart contracts as a fundamental step towards the development of their timely and clear regulation.
Methods
: the research is based on the methodology of formal-legal and comparative legal analysis. It compares the current Bulgarian legislation with supranational legal sources and identifies the characteristic features of smart contracts as demanded instruments necessary for modern law and economy. The article also compares them with the classical understanding of contracts, making it possible to understand and define the nature of smart contracts more accurately.
Results
: it was determined that a smart contract is a software code in which the parties predetermine conditions under which the contractual relationship between them is created, modified and terminated. The research proved that the contract execution does not depend on the action or inaction of its parties, but rather on the occurrence of a predetermined condition (a certain fact relevant to the parties) under which the contract must self-execute. It was substantiated that the will of the parties cannot be changed or replaced because of the special way in which the smart contract is recorded in a distributed ledger. It is found that the fundamental problem of transferring the will from the legal language to the program code of the smart contract persists: if the will of the parties is incorrectly transferred to the program code, the smart contract may self-execute, but its execution will not be the result that the parties counted on.
Scientific novelty
: the analysis made it possible to compare the current national (Bulgarian) legislation and supranational (European) law. It revealed the vagueness of smart contracts regulation, both at the national and international level, and identified a number of issues in need of scientific and legal interpretation, which refer to the legal nature of smart contracts in view of the self-executing program code concept.
Practical significance
: the study can serve as a basis for further development of legislation towards its adaptation to the prospects of smart contracts spreading and application in civil and commercial turnover. It also allows an in-depth analysis of the smart contracts practice referring to such unsolved problems as accurate transference of the parties' will to the program code (translation of specific terms from the legal language into the smart contract program code), electronic identification of subjects - parties to the transaction and many other issues.
Source code optimization using equivalent mutants López, Jorge; Kushik, Natalia; Yevtushenko, Nina
Information and software technology,
November 2018, 2018-11-00, 2018-11, Letnik:
103
Journal Article
Recenzirano
Odprti dostop
Context: A mutant is a program obtained by syntactically modifying a program’s source code; an equivalent mutant is a mutant, which is functionally equivalent to the original program. Mutants are ...primarily used in mutation testing, and when deriving a test suite, obtaining an equivalent mutant is considered to be highly negative, although these equivalent mutants could be used for other purposes.
Objective: We present an approach that considers equivalent mutants valuable, and utilizes them for source code optimization. Source code optimization enhances a program’s source code preserving its behavior.
Method: We showcase a procedure to achieve source code optimization based on equivalent mutants and discuss proper mutation operators.
Results: Experimental evaluation with Java and C programs demonstrates the applicability of the proposed approach.
Conclusion: An algorithmic approach for source code optimization using equivalent mutants is proposed. It is showcased that whenever applicable, the approach can outperform traditional compiler optimizations.
Program codes as one of big data should be disseminated to all sensor nodes in a wireless software-define smart network (WSDSN) quickly. Due to the limited energy of sensor nodes, sensor nodes adopt ...asynchronous duty-cycle model to save energy. But neighbor nodes with sleep status can’t receive program codes, resulting in longer transmission delay for spreading program codes. In this paper, an adjustable duty cycle based fast disseminate (ADCFD) scheme is proposed for minimum-transmission broadcast (MTB) in a smart wireless software-define network. In an ADCFD scheme, the duty cycle of nodes are adjusted to receive program codes timely. Thus, the transmission times and emergency transmission delay are reduced. The theoretical analysis and experimental results show that compare to previous broadcast scheme, the number of transmission in an ADCFD scheme is reduced by 44.776%–118.519%, the delay from disseminating program codes is reduced by 17.895%- 107.527%, while retaining network lifetime.