summaryrefslogtreecommitdiffstats
path: root/content/zettel/3a8g4a.md
blob: 6c3973fd7d3b10cf5f3ee1e807c6c835804730ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
+++
title = "Rebuilding the correct order of arguments"
author = "Yann Herklotz"
tags = []
categories = []
backlinks = ["3a8g4"]
forwardlinks = ["3a8g4b"]
zettelid = "3a8g4a"
+++

This has been corrected in another note ([\#3a8g4b]).

We therefore have to recreate the correct order of the arguments based
on the predecessors. The correctness of this might be quite hard to
show, however, the idea of the algorithm is the following:

1.  Find all the points of definition of the variables inside the φ
    function, and get all the predecessors. The main idea is that the
    definition points of the variables must necessarily dominate the
    predecessor that should be used to select that variable. However,
    the difficulty is that it might not uniquely dominate the
    predecessor of the variable.
2.  Find all the points of definition that dominate the minimum number
    of predecessors. If there are more than one, this means that there
    must be duplicate versions of the variable inside the φ function.
3.  Take all the points where the number of predecessors that are
    dominated by the point of definition also coincides with the number
    of uses of that variable inside of the φ function.
4.  Take the list of predecessors and map through it, always looking up
    the variables that were assigned to that predecessor in the previous
    step, and replace the predecessor in the list.
5.  The result should be a correctly ordered list for the phi function,
    which will work with an arbitrary order in the GSA input.

  [\#3a8g4b]: /zettel/3a8g4b