Changeset 985ff5f for doc


Ignore:
Timestamp:
Feb 4, 2025, 9:17:13 PM (7 weeks ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
332e93a
Parents:
7846f91
Message:

small proofreading changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified doc/theses/fangren_yu_MMath/content2.tex

    r7846f91 r985ff5f  
    5555In addition, fixing unexpected interactions within the type system has presented challenges.
    5656This chapter describes in detail the type-resolution rules currently in use and some major problems that have been identified.
    57 Not all of those problems have solutions, because fixing them may require redesigning parts of the \CFA type system at a larger scale, which correspondingly affects the language design.
     57Not all of those problems have immediate solutions, because fixing them may require redesigning parts of the \CFA type system at a larger scale, which correspondingly affects the language design.
    5858
    5959
     
    6262\CFA has been using a total-order expression cost-model to resolve ambiguity of overloaded expressions from the very beginning.
    6363Most \CFA operators can be overloaded in \CFA\footnote{
    64 \CFA excludes overloading the comma operator, short-circuit logical operators \lstinline{&&} and \lstinline{||} (control structures), and ternary conditional operator \lstinline{?} (control structure).
    65 \CC overloads the comma and short-circuit logical operators, where the overloaded short-circuit operators do not exhibit short-circuit semantics, which is confusing.};
     64\CFA excludes overloading the comma operator, short-circuit logical operators \lstinline{&&} and \lstinline{||}, and ternary conditional operator \lstinline{?}, all of which are short-hand control structures rather than operators.
     65\CC overloads the comma and short-circuit logical operators, where the overloaded comma is esoteric short-circuit operators do not exhibit short-circuit semantics, which is confusing.};
    6666hence, they are treated the same way as other function calls with the same rules for overload resolution.
    6767
     
    7878At a subexpression level, the lowest cost candidate for each result type is included as a possible interpretation of the expression;
    7979at the top level, all possible interpretations of different types are considered (generating a total ordering) and the overall lowest cost is selected as the final interpretation of the expression.
    80 Glen Ditchfield first proposed this costing model~\cite[\S~4.4.5]{Ditchfield92} to generate a resolution behaviour that is reasonable to C programmers based on existing conversions in the language.
     80Glen Ditchfield first proposed this costing model~\cite[\S~4.4.5]{Ditchfield92} to generate a resolution behaviour that is reasonable to C programmers based on existing conversions in the C programming language.
    8181This model carried over into the first implementation of the \CFA type-system by Richard Bilson~\cite[\S~2.2]{Bilson03}, and was extended but not redesigned by Aaron Moss~\cite[chap.~4]{Moss19}.
    8282Moss's work began to show problems with the underlying costing model;
     
    114114In many languages that support function/method overloading, such as \CC and Java, a partial-order system decides which interpretation of the expression gets selected.
    115115Hence, sometimes the candidates are incomparable (none are considered a better match), and only when one candidate is considered better than all others (maximal with respect to the partial order) is the expression unambiguous.
    116 Specifically, the resolution algorithms used in \CC and Java are greedy, as they select the best match for each sub-expression without considering the higher level ones, and therefore at each step of resolution, the arguments are already given unique interpretations, so the ordering only needs to consider comparing different sets of conversion targets (function parameter types) on the same set of input.
     116Specifically, the resolution algorithms used in \CC and Java are greedy, selecting the best match for each sub-expression without considering the higher-level ones (bottom-up).
     117Therefore, at each resolution step, the arguments are already given unique interpretations, so the ordering only needs to compare different sets of conversion targets (function parameter types) on the same set of input.
    117118\begin{cfa}
    118119@generate a C++ example here@
Note: See TracChangeset for help on using the changeset viewer.