131 research outputs found

    On the Relation between Context-Free Grammars and Parsing Expression Grammars

    Full text link
    Context-Free Grammars (CFGs) and Parsing Expression Grammars (PEGs) have several similarities and a few differences in both their syntax and semantics, but they are usually presented through formalisms that hinder a proper comparison. In this paper we present a new formalism for CFGs that highlights the similarities and differences between them. The new formalism borrows from PEGs the use of parsing expressions and the recognition-based semantics. We show how one way of removing non-determinism from this formalism yields a formalism with the semantics of PEGs. We also prove, based on these new formalisms, how LL(1) grammars define the same language whether interpreted as CFGs or as PEGs, and also show how strong-LL(k), right-linear, and LL-regular grammars have simple language-preserving translations from CFGs to PEGs

    Left Recursion in Parsing Expression Grammars

    Full text link
    Parsing Expression Grammars (PEGs) are a formalism that can describe all deterministic context-free languages through a set of rules that specify a top-down parser for some language. PEGs are easy to use, and there are efficient implementations of PEG libraries in several programming languages. A frequently missed feature of PEGs is left recursion, which is commonly used in Context-Free Grammars (CFGs) to encode left-associative operations. We present a simple conservative extension to the semantics of PEGs that gives useful meaning to direct and indirect left-recursive rules, and show that our extensions make it easy to express left-recursive idioms from CFGs in PEGs, with similar results. We prove the conservativeness of these extensions, and also prove that they work with any left-recursive PEG. PEGs can also be compiled to programs in a low-level parsing machine. We present an extension to the semantics of the operations of this parsing machine that let it interpret left-recursive PEGs, and prove that this extension is correct with regards to our semantics for left-recursive PEGs.Comment: Extended version of the paper "Left Recursion in Parsing Expression Grammars", that was published on 2012 Brazilian Symposium on Programming Language

    Grapham: Graphical Models with Adaptive Random Walk Metropolis Algorithms

    Full text link
    Recently developed adaptive Markov chain Monte Carlo (MCMC) methods have been applied successfully to many problems in Bayesian statistics. Grapham is a new open source implementation covering several such methods, with emphasis on graphical models for directed acyclic graphs. The implemented algorithms include the seminal Adaptive Metropolis algorithm adjusting the proposal covariance according to the history of the chain and a Metropolis algorithm adjusting the proposal scale based on the observed acceptance probability. Different variants of the algorithms allow one, for example, to use these two algorithms together, employ delayed rejection and adjust several parameters of the algorithms. The implemented Metropolis-within-Gibbs update allows arbitrary sampling blocks. The software is written in C and uses a simple extension language Lua in configuration.Comment: 9 pages, 3 figures; added references, revised language, other minor change

    Extensão e inovação social na sala de aula, experiência prática minor em desafios globais: o estudo das desigualdades enquanto ferramenta de inclusão na internacionalização

    Get PDF
      Diante dos múltiplos desafios enfrentados para a expansão e a democratização do acesso à internacionalização acadêmica, assim como a premente necessidade de incorporação de uma temática global e relevante ao currículo local, surge o conceito do curso Minor em Desafios Globais: Desigualdades. Proposto e coordenado pela Superintendência de Relações Internacionais da Universidade Federal Fluminense, trata-se de um curso sequencial transdisciplinar, de formação complementar, oferecido integralmente em línguas estrangeiras. O curso, iniciado em 2021, aborda a temática das desigualdades por meio da lente dos Objetivos de Desenvolvimento Sustentável (ODS) da Organização das Nações Unidas (ONU), trazendo temáticas de grande relevância internacional ao currículo local, em disciplinas oferecidas por docentes de múltiplas áreas do conhecimento. Dessa forma, o programa se apresenta não somente como uma valiosa oportunidade acadêmica para a comunidade internacional, mas também democratiza o acesso a experiências de internacionalização do ensino para a comunidade local. Resultados parciais, obtidos por meio de pesquisa realizada junto aos estudantes e professores do curso, indicam que a iniciativa vem atingindo seus objetivos, impactando positivamente as trajetórias dos alunos e docentes envolvidos e, por meio de sua estrutura, proporcionando um ambiente dinâmico e inovador de aprendizado

    OsmoseLua – An Integrated Approach to Energy Systems Integration with LCIA and GIS

    Get PDF
    In this paper, we present our recent work on the implementation of an Energy Systems Integration platform allowing the modeling of Energy Systems integrating LCI (Life Cycle Inventory), LCIA (Life Cycle Impact Assessment) and GIS (Geographical Information Systems) data as modeling parameters and variables included in an industrial process model. Based on our previous experience in methodologies and models of Energy Systems Integrations, we developed a new generation of the platform using the script language Lua. The main motivation for choosing Lua was to radically improve the performance of the system, which was the main drawback of the existing Matlab-based system, while proposing a more convenient way of describing the modeling elements and their combination. The second objective of our work was to integrate LCI and LCIA aspects as a generic part of the Energy Systems modeling methodology. We are currently working on the process data mapping algorithm in order to match the appropriate Unit process and Elementary flows identifiers used in the ecoinvent v3 database. Thirdly, by having the possibility of importing GIS databases (in csv format), some coordination data, such as longitude and latitude, can be directly included as Energy System elements' location parameters. This possibility improves the efficiency in modeling the energy integration of urban systems
    corecore