3,295 research outputs found
Side-Effect Localization for Lazy, Purely Functional Languages via Aspects
Many side-effecting programming activities, such as profiling and tracing,
can be formulated as crosscutting concerns and be framed as side-effecting aspects in the aspect-oriented programming paradigm. The benefit gained from this separation of concerns is particularly evident in purely functional programming, as adding such aspects using techniques such as monadification will generally lead to crosscutting changes. This paper presents an approach to provide side-effecting aspects for lazy purely functional languages in a user transparent fashion. We propose a simple yet direct state manipulation construct for developing side-effecting aspects and devise a
systematic monadification scheme to translate the woven code to monadic style purely functional code. Furthermore, we present a static and dynamic semantics of the aspect programs and reason about the correctness of our monadification scheme with respect to them
Type-Directed Weaving of Aspects for Polymorphically Typed Functional Languages
Incorporating aspect-oriented paradigm to a polymorphically typed functional
language enables the declaration of type-scoped advice, in which the
effect of an aspect can be harnessed by introducing possibly polymorphic
type constraints to the aspect. The amalgamation of aspect orientation and
functional programming enables quick behavioral adaption of functions, clear
separation of concerns and expressive type-directed programming. However,
proper static weaving of aspects in polymorphic languages with a type-erasure
semantics remains a challenge. In this paper, we describe a type-directed
static weaving strategy, as well as its implementation, that supports
static type inference and static weaving of programs written in an aspect-oriented
polymorphically typed functional language, AspectFun. We show
examples of type-scoped advice, identify the challenges faced with compile-time
weaving in the presence of type-scoped advice, and demonstrate how
various advanced aspect features can be handled by our techniques. Lastly,
we prove the correctness of the static weaving strategy with respect to the
operational semantics of AspectFun
Projecting future carbon emissions from cement production in developing countries
Achieving low-carbon development of the cement industry in the developing countries is fundamental to global emissions abatement, considering the local construction industry’s rapid growth. However, there is currently a lack of systematic and accurate accounting and projection of cement emissions in developing countries, which are characterized with lower basic economic country condition. Here, we provide bottom-up quantifications of emissions from global cement production and reveal a regional shift in the main contributors to global cement CO2 emissions. The study further explores cement emissions over 2020-2050 that correspond to different housing and infrastructure conditions and emissions mitigation options for all developing countries except China. We find that cement emissions in developing countries except China will reach 1.4-3.8 Gt in 2050 (depending on different industrialization trajectories), compared to their annual emissions of 0.7 Gt in 2018. The optimal combination of low-carbon measures could contribute to reducing annual emissions by around 65% in 2050 and cumulative emissions by around 48% over 2020-2050. The efficient technological paths towards a low carbon future of cement industry vary among the countries and infrastructure scenarios. Our results are essential to understanding future emissions patterns of the cement industry in the developing countries and can inform policies in the cement sector that contribute to meeting the climate targets set out in the Paris Agreement
Projecting future carbon emissions from cement production in developing countries
Achieving low-carbon development of the cement industry in the developing countries is fundamental to global emissions abatement, considering the local construction industry’s rapid growth. However, there is currently a lack of systematic and accurate accounting and projection of cement emissions in developing countries, which are characterized with lower basic economic country condition. Here, we provide bottom-up quantifications of emissions from global cement production and reveal a regional shift in the main contributors to global cement CO2 emissions. The study further explores cement emissions over 2020-2050 that correspond to different housing and infrastructure conditions and emissions mitigation options for all developing countries except China. We find that cement emissions in developing countries except China will reach 1.4-3.8 Gt in 2050 (depending on different industrialization trajectories), compared to their annual emissions of 0.7 Gt in 2018. The optimal combination of low-carbon measures could contribute to reducing annual emissions by around 65% in 2050 and cumulative emissions by around 48% over 2020-2050. The efficient technological paths towards a low carbon future of cement industry vary among the countries and infrastructure scenarios. Our results are essential to understanding future emissions patterns of the cement industry in the developing countries and can inform policies in the cement sector that contribute to meeting the climate targets set out in the Paris Agreement
Distinguishing Smilax glabra and Smilax china rhizomes by flow-injection mass spectrometry combined with principal component analysis
Flow-injection mass spectrometry (FIMS) coupled with a chemometric method is proposed in this study to profile and distinguish between rhizomes of Smilax glabra (S. glabra) and Smilax china (S. china). The proposed method employed an electrospray-time-of-flight MS. The MS fingerprints were analyzed using principal component analysis (PCA) and orthogonal partial least squares discriminant analysis (OPLS-DA) with the aid of SIMCA software. Findings showed that the two kinds of samples perfectly fell into their own classes. Further predictive study showed desirable predictability and the tested samples were successfully and reliably identified. The study demonstrated that the proposed method could serve as a powerful tool for distinguishing between S. glabra and S. china
SiRA: Sparse Mixture of Low Rank Adaptation
Parameter Efficient Tuning has been an prominent approach to adapt the Large
Language Model to downstream tasks. Most previous works considers adding the
dense trainable parameters, where all parameters are used to adapt certain
task. We found this less effective empirically using the example of LoRA that
introducing more trainable parameters does not help. Motivated by this we
investigate the importance of leveraging "sparse" computation and propose SiRA:
sparse mixture of low rank adaption. SiRA leverages the Sparse Mixture of
Expert(SMoE) to boost the performance of LoRA. Specifically it enforces the top
experts routing with a capacity limit restricting the maximum number of
tokens each expert can process. We propose a novel and simple expert dropout on
top of gating network to reduce the over-fitting issue. Through extensive
experiments, we verify SiRA performs better than LoRA and other mixture of
expert approaches across different single tasks and multitask settings
Distinguishing Emission-Associated Ambient Air PM2.5 Concentrations and Meteorological Factor-Induced Fluctuations
Although PM2.5 (particulate matter with aerodynamic diameters less than 2.5 μm) in the air originates from emissions, its concentrations are often affected by confounding meteorological effects. Therefore, direct comparisons of PM2.5 concentrations made across two periods, which are commonly used by environmental protection administrations to measure the effectiveness of mitigation efforts, can be misleading. Here, we developed a two-step method to distinguish the significance of emissions and meteorological factors and assess the effectiveness of emission mitigation efforts. We modeled ambient PM2.5 concentrations from 1980 to 2014 based on three conditional scenarios: realistic conditions, fixed emissions, and fixed meteorology. The differences found between the model outputs were analyzed to quantify the relative contributions of emissions and meteorological factors. Emission-related gridded PM2.5 concentrations excluding the meteorological effects were predicted using multivariate regression models, whereas meteorological confounding effects on PM2.5 fluctuations were characterized by probabilistic functions. When the regression models and probabilistic functions were combined, fluctuations in the PM2.5 concentrations induced by emissions and meteorological factors were quantified for all model grid cells and regions. The method was then applied to assess the historical and future trends of PM2.5 concentrations and potential fluctuations on global, national, and city scales. The proposed method may thus be used to assess the effectiveness of mitigation actions
- …