55 research outputs found

    StaticFixer: From Static Analysis to Static Repair

    Full text link
    Static analysis tools are traditionally used to detect and flag programs that violate properties. We show that static analysis tools can also be used to perturb programs that satisfy a property to construct variants that violate the property. Using this insight we can construct paired data sets of unsafe-safe program pairs, and learn strategies to automatically repair property violations. We present a system called \sysname, which automatically repairs information flow vulnerabilities using this approach. Since information flow properties are non-local (both to check and repair), \sysname also introduces a novel domain specific language (DSL) and strategy learning algorithms for synthesizing non-local repairs. We use \sysname to synthesize strategies for repairing two types of information flow vulnerabilities, unvalidated dynamic calls and cross-site scripting, and show that \sysname successfully repairs several hundred vulnerabilities from open source {\sc JavaScript} repositories, outperforming neural baselines built using {\sc CodeT5} and {\sc Codex}. Our datasets can be downloaded from \url{http://aka.ms/StaticFixer}

    Frustrated with Code Quality Issues? LLMs can Help!

    Full text link
    As software projects progress, quality of code assumes paramount importance as it affects reliability, maintainability and security of software. For this reason, static analysis tools are used in developer workflows to flag code quality issues. However, developers need to spend extra efforts to revise their code to improve code quality based on the tool findings. In this work, we investigate the use of (instruction-following) large language models (LLMs) to assist developers in revising code to resolve code quality issues. We present a tool, CORE (short for COde REvisions), architected using a pair of LLMs organized as a duo comprised of a proposer and a ranker. Providers of static analysis tools recommend ways to mitigate the tool warnings and developers follow them to revise their code. The \emph{proposer LLM} of CORE takes the same set of recommendations and applies them to generate candidate code revisions. The candidates which pass the static quality checks are retained. However, the LLM may introduce subtle, unintended functionality changes which may go un-detected by the static analysis. The \emph{ranker LLM} evaluates the changes made by the proposer using a rubric that closely follows the acceptance criteria that a developer would enforce. CORE uses the scores assigned by the ranker LLM to rank the candidate revisions before presenting them to the developer. CORE could revise 59.2% Python files (across 52 quality checks) so that they pass scrutiny by both a tool and a human reviewer. The ranker LLM is able to reduce false positives by 25.8% in these cases. CORE produced revisions that passed the static analysis tool in 76.8% Java files (across 10 quality checks) comparable to 78.3% of a specialized program repair tool, with significantly much less engineering efforts

    Structure and superconducting properties of Ga-substituted YBa2Cu3O7δYBa_2Cu_3O_{7-\delta} and YBaSrCu3O7δYBaSrCu_3O_{7-\delta} systems

    No full text
    In YBa2Cu3yGayO7δYBa_2Cu_{3-y}Ga_yO_{7-\delta}, Ga can be substituted at the Cu(1) site up to y = 0.1 without change in structure, but this is accompanied by a slight decrease in the hole concentration and TcT_c; the same is true when Y is partly substituted by Ca, as in Y1xCaxBa2Cu3yGayO7δY_{1-x}Ca_xBa_2Cu_{3-y}Ga_yO_{7-\delta} (0.0<x0.2)(0.0 < x \leq 0.2). When one Ba is replaced by Sr as in YBaSrCu3yGayO7δYBaSrCu_{3-y}Ga_yO_{7-\delta}, however, Ga can be substituted at the Cu(1) site to a much greater extent (up to y = 0.6). In this system, Ga substitution changes the structure from orthorhombic to tetragonal, unlike in YBa2Cu3yGayCu3O7δYBa_2Cu_{3-y}Ga_yCu_3O_{7-\delta}. Both the hole concentration and TcT_c decrease with an increase in y and the material becomes non-superconducting for y > 0.2. The y = 0.3 and 0.4 compositions show metal–semiconductor transitions at 60 and 120 K, respectively, while the y = 0.6 composition is a semiconductor. When Y is partly substituted by Ca as in Y1xCaxBaSrCu3yGayO7δY_{1-x}Ca_xBaSrCu_{3-y}Ga_yO_{7-\delta}, the material is superconducting even when y = 0.3. All these Ga-substituted cuprates are in the underdoped region and accordingly TcT_c increases with increase in hole concentration

    Highly ordered polyaniline as an efficient dye remover

    No full text
    Polyaniline was synthesized by the chemical oxidative polymerization procedure at room temperature employing hydrogen peroxide (H 2 O 2 ) as oxidant and ferrous chloride (FeCl 2 ·2H 2 O) and vanadyl sulphate (VOSO 4 ·H 2 O) as co-catalysts, respectively. The obtained polymers were characterized by high resolution powder X-ray diffraction, Fourier transform infrared spectroscopy, Raman, UV–Visible, photoluminescence spectroscopy, thermogravimetric Field Emission Scanning Electron Microscopy (FESEM) and Transmission Electron Microscopy (TEM) techniques. Ordered arrangement indicative of semi-crystalline nature of polyaniline was evidenced from the presence of intense reflection at d  = 13.72 Å in the powder X-ray diffraction pattern followed by two lesser intense peaks at 4.61 and 3.47 Å. Fourier transform infrared spectroscopy and Raman spectroscopic results indicated the polyaniline to be emeraldine salt form. Fibrous morphology was observed in scanning electron microscope images. Nearly 93% of Methyl Orange dye was adsorbed in 30 min by the ordered polyaniline at room temperature. No significant difference in the crystallinity and/or ordering was noticed in the powder X-ray diffraction pattern after dye adsorption. The correlation between the ordered structure of polyaniline and its higher adsorption property derived in the current study has the potential to fabricate devices consisting polyaniline to detect dye molecules

    Structure and superconducting properties of Ga-substituted YBa<SUB>2</SUB>Cu<SUB>3</SUB>O<SUB>7−δ</SUB> and YBaSrCu<SUB>3</SUB>O<SUB>7−δ</SUB> systems

    No full text
    In YBa<SUB>2</SUB>Cu<SUB>3&#8722;y</SUB>Ga<SUB>y</SUB>O<SUB>7&#8722;&#948;,</SUB> Ga can be substituted at the Cu(1) site up to y=0.1 without change in structure, but this is accompanied by a slight decrease in the hole concentration and T<SUB>c</SUB>; the same is true when Y is partly substituted by Ca, as in Y<SUB>1&#8722;x</SUB>Ca<SUB>x</SUB>Ba<SUB>2</SUB>Cu<SUB>3&#8722;y</SUB>Ga<SUB>y</SUB>O<SUB>7&#8722;&#948;,</SUB>(0 .0&#60;x&#8804;0.2). When one Ba is replaced by Sr as in YBaSrCu<SUB>3&#8722;y</SUB>Ga<SUB>y</SUB>O<SUB>7&#8722;&#948;,</SUB>, however, Ga can be substituted at the Cu(1) site to a much greater extent (up to y=0.6). In this system, Ga substitution changes the structure from orthorhombic to tetragonal, unlike in YBa<SUB>2</SUB>Cu<SUB>3&#8722;y</SUB>Ga<SUB>y</SUB>Cu<SUB>3</SUB>O<SUB>7&#8722;&#948;,</SUB>. Both the hole concentration and T<SUB>c</SUB> decrease with an increase in y and the material becomes non-superconducting for y&#62;0.2. The y=0.3 and 0.4 compositions show metal-semiconductor transitions at 60 and 120 K, respectively, while the y=0.6 composition is a semiconductor. When Y is partly substituted by Ca as in Y<SUB>1&#8722;x</SUB>Ca<SUB>x</SUB>BaSrCu<SUB>3&#8722;y</SUB>Ga<SUB>y</SUB>O<SUB>7&#8722;&#948;,</SUB>, the material is superconducting even when y=0.3. All these Ga-substituted cuprates are in the underdoped region and accordingly T<SUB>c</SUB> increases with increase in hole concentration

    Correlating the Influence of Two Magnetic Ions at the A‑Site with the Electronic, Magnetic, and Catalytic Properties in Gd<sub>1–<i>x</i></sub>Dy<sub><i>x</i></sub>CrO<sub>3</sub>

    No full text
    Considering the absence of reports dealing with the perovskite-structured orthochromites containing two A-site magnetic rare-earth ions, GdCrO<sub>3</sub> and progressively Dy<sup>3+</sup>-substituted samples of the series Gd<sub>1–<i>x</i></sub>Dy<sub><i>x</i></sub>CrO<sub>3</sub> have been synthesized employing the epoxide-mediated sol–gel procedure. The samples were characterized extensively using high-resolution powder X-ray diffraction, thermal analysis, Fourier transform infrared, Raman, and UV–visible spectroscopies, scanning electron microscopy (SEM), and transmission electron microscopy (TEM) measurements. Monophasic samples possessing an orthorhombic perovskite structure emerged by calcining the xerogels formed by the reaction of rare-earth nitrates, chromium­(III)­chloride, and propylene oxide at 800 °C for 2 h. Uniform presence of wormlike morphology was observed in both the field emission SEM (FE-SEM) and TEM images of the samples. Zero-field and field-cooled magnetic measurements using a SQUID magnetometer down to 4 K showed that the Neel temperature of Gd<sub>0.5</sub>Dy<sub>0.5</sub>CrO<sub>3</sub> was 155 K, more or less midway between the values observed for GdCrO<sub>3</sub>(169 K) and DyCrO<sub>3</sub> (146 K). For the Gd<sub>0.5</sub>Dy<sub>0.5</sub>CrO<sub>3</sub> sample, a spin reorientation was observed at ∼38 K when measured under an applied field. Because the optical band gap, determined by Kubelka–Munk function, of these chromites was around 3 eV, their application as a catalyst for the photodegradation of the aqueous rhodamine-6G dye solution was demonstrated, in which the percentage of the total dye that was degraded varied with the average ionic radius of A-site ions. A similar systematic trend was observed even for the catalytic oxidation of the XO dye in the presence of H<sub>2</sub>O<sub>2</sub>, with DyCrO<sub>3</sub> influencing the reaction to a greater extent followed by Gd<sub>0.5</sub>Dy<sub>0.5</sub>CrO<sub>3</sub> and GdCrO<sub>3</sub>. Both the photocatalytic and catalytic reactions followed pseudo-first-order kinetics

    Sol–Gel Synthesis of High-Purity Actinide Oxide ThO<sub>2</sub> and Its Solid Solutions with Technologically Important Tin and Zinc Ions

    No full text
    The applicability of epoxide-based sol–gel synthesis for actinide oxide (thoria) starting from air-stable salt, Th­(NO<sub>3</sub>)<sub>4</sub>, has been examined. The homogeneous gel formed from Th­(NO<sub>3</sub>)<sub>4</sub> when calcined at 400 °C yielded nanostructured thoria, and with increasing tempeartures (600, 700, and 800 °C), the average crystallite size increased. Successful Rietveld refinement of the powder X-ray diffraction pattern of ThO<sub>2</sub> in <i>Fm</i>3̅<i>m</i> space group was carried out with <i>a</i> = 5.6030(35) Å. The fingerprint vibrational mode of the fluorite structure of ThO<sub>2</sub> was noticed as a sharp band in the Raman spectrum at 457 cm<sup>–1</sup>. In the SEM image, a near spherical morphology of thoria was noticed. Samples showed blue emission on exciting with λ = 380 nm in the photoluminescence spectrum indicative of the presence of defects. Following this approach, 50 mol % of Sn<sup>4+</sup> could be substituted for Th<sup>4+</sup>, retaining the fluorite structure as evidenced by the PXRD, Raman spectroscopy, electron microscopy, EDAX, and XPS measurements. Randomization of the lattice was observed for the tin-substituted samples. A significant blue shift in the absorption threshold along with a persistent blue emission in the photoluminesence spectra were evident for the tin-substituted samples. The concentration of Zn<sup>2+</sup> ion in thoria was limited to 15 mol % as revealed by PXRD and XPS measurements. The Raman peak shifted to higher values for Zn<sup>2+</sup>-substituted samples. A change in the optical absorbance characteristics was observed for the zinc-substituted thoria. A 50 mol % Sn<sup>4+</sup>-substituted thoria degraded aqueous Rhodamine 6G dye solutions in the presence of UV–vis radiation following pseudo-first-order kinetics
    corecore