scholarly journals Lambda-Lifting in Quadratic Time

2004 ◽  
Vol 11 (12) ◽  
Author(s):  
Olivier Danvy ◽  
Ulrik P. Schultz

Lambda-lifting is a program transformation that is used in compilers, partial evaluators, and program transformers. In this article, we show how to reduce its complexity from cubic time to quadratic time, and we present a flow-sensitive lambda-lifter that also works in quadratic time. <br /> <br />Lambda-lifting transforms a block-structured program into a set of recursive equations, one for each local function in the source program. Each equation carries extra parameters to account for the free variables of the corresponding local function <em>and of all its callees</em>. It is the search for these extra parameters that yields the cubic factor in the traditional formulation of lambda-lifting, which is due to Johnsson. This search is carried out by computing a transitive closure. <br /> <br />To reduce the complexity of lambda-lifting, we partition the call graph of the source program into strongly connected components, based on the simple observation that <em>all functions in each component need the same extra parameters and thus a transitive closure is not needed</em>. We therefore simplify the search for extra parameters by treating each strongly connected component instead of each function as a unit, thereby reducing the time complexity of lambda-lifting from O(n^3) to O(n^2), where n is the size of the program. <br /> <br />Since a lambda-lifter can output programs of size O(n^2), our algorithm is asympotically optimal.

2003 ◽  
Vol 10 (26) ◽  
Author(s):  
Olivier Danvy ◽  
Ulrik P. Schultz

Lambda-lifting is a program transformation used in compilers and in partial evaluators and that operates in cubic time. In this article, we show how to reduce this complexity to quadratic time, and we present a flow-sensitive lambda-lifter that also works in quadratic time.<br /> <br />Lambda-lifting transforms a block-structured program into a set of recursive equations, one for each local function in the source program. Each equation carries extra parameters to account for the free variables of the corresponding local function <em>and of all its callees</em>. It is the search for these extra parameters that yields the cubic factor in the traditional formulation of lambda-lifting, which is due to Johnsson. This search is carried out by a transitive closure.<br /> <br />Instead, we partition the call graph of the source program into strongly connected components, based on the simple observation that <em>all functions in each component need the same extra parameters and thus a transitive closure is not needed</em>. We therefore simplify the search for extra parameters by treating each strongly connected component instead of each function as a unit, thereby reducing the time complexity of lambda-lifting from O(n^3 log n) to O(n^2 log n), where n is the size of the program.<br /> <br />Since a lambda-lifter can output programs of size O(n^2), we believe that our algorithm is close to optimal.


2002 ◽  
Vol 9 (30) ◽  
Author(s):  
Olivier Danvy ◽  
Ulrik P. Schultz

Lambda-lifting is a program transformation used in compilers and in partial evaluators and that operates in cubic time. In this article, we show how to reduce this complexity to quadratic time.<br /> <br /> Lambda-lifting transforms a block-structured program into a set of recursive equations, one for each local function in the source program. Each equation carries extra parameters to account for the free variables of the corresponding local function and of all its callees. It is the search for these extra parameters that yields the cubic factor in the traditional formulation of lambda-lifting, which is due to Johnsson. This search is carried out by a transitive closure.<br /> <br />Instead, we partition the call graph of the source program into strongly connected components, based on the simple observation that all functions in each component need the same extra parameters and thus a transitive closure is not needed. We therefore simplify the search for extra parameters by treating each strongly connected component instead of each function as a unit, thereby reducing the time complexity of lambda-lifting from O(n^3 log n) to O(n^2 log n), where n is the size of the program. <br /><br />Since a lambda-filter can output programs of size O(n^2), we believe that our algorithm is close to optimal.<br /><br />Superseded by (BRICS-RS-03-26 and) BRICS-RS-04-12.


2020 ◽  
Author(s):  
Сергей Черноухов

Предложен подход к решению проблемы проверки изоморфности двух графов исходя из анализа их максимально протяженных неразветвляющихся путей. На его основе предлагается подход и алгоритм решения частного случая задачи поиска в некотором графе A всех подграфов, изоморфных заданному графу B (а именно, поиск только «вписанных» подграфов), а также определяется само понятие «вписанного» подграфа. «Вписанным» подграфом графа A здесь называется такой его подграф, который может быть «приклеен» к другим частям графа A только за счет ребер, инцидентных лишь граничным вершинам его (подграфа) неразветвляющихся путей максимальной длины (при этом граф A может содержать и иные компоненты связности). Решение частного случая задачи поиска «вписанных» подграфов обобщается для поиска в графе A всех подграфов, изоморфных данному графу-образцу B. Для этого вместо рассмотрения их максимально протяженных неразветвляющихся путей необходимо рассматривать все их ребра. Предложенные подход и алгоритм применимы: (1) как для ориентированных, так и для неориентированных графов, (2) для графов, содержащих более одной компоненты связности/ сильной связности, (3) для графов, содержащих кратные (множественные) ребра и петли. ----------- An approach based on maximal non-branching paths analysis to solve graph isomorphism problem is introduced. An algorithm to solve the particular case of the problem of finding in a some graph A all subgraphs that are isomorphic to given graph B is proposed (only “inscribed” subgraphs can be found this way, not all of them). Here we shall name a subgraph of some given graph A as "inscribed" if (1) this subgraph is "glued" to other parts of A only by edges that connected to those vertices of this subgraph that are begin/ end ones of any max-length non-branching path of it, or (2) this subgraph is a separate connected component of the graph A. The proposed algorithm of finding “inscribed” subgraphs is expanded to solve a whole problem of finding all (not only “inscribed”) subgraphs of a graph A that are isomorphic to given template graph B. To do so one should consider all edges of these graphs instead of their max-length non-branching paths. These proposed approach and algorithm may be implemented to: (1) directed or undirected graphs, (2) graphs that have more than one connected components/ strongly connected components, (3) graphs that contain multiple edges and multiple loops.


2021 ◽  
Vol 1 ◽  
pp. 122-133
Author(s):  
Alexey V. Oletsky ◽  
◽  
Mikhail F. Makhno ◽  
◽  

A problem of automated assessing of students’ study projects is regarded. A heuristic algorithm based on fuzzy estimating of projects and on pairwise comparisons among them is proposed. For improving adequacy and naturalness of grades, an approach based on introducing a parameter named relaxation parameter was suggested in the paper. This enables to reduce the spread between maximum and minimum values of projects in comparison with the one in the standard scale suggested by T. Saati. Reasonable values of this parameter were selected experimentally. For estimating the best alternative, a center of mass of a fuzzy max-min composition should be calculated. An estimation algorithm for a case of non-transitive preferences based on getting strongly connected components and on pairwise comparisons between them is also suggested. In this case, relaxation parameters should be chosen separately for each subtask. So the combined technique of evaluating alternatives proposed in the paper depends of the following parameters: relaxation parameters for pairwise comparisons matrices within each strongly connected components; relaxation parameter for pairwise comparisons matrices among strongly connected components; membership function for describing the best alternative.


Sign in / Sign up

Export Citation Format

Share Document