ツイートする Facebook にシェア

Expression Problem

From Wikipedia, the free encyclopedia

Jump to:navigation, search

The Expression Problem is a term used in discussing strengths and weaknesses of various programming paradigms and programming languages. The expression problem can treated as a use case in programming language design.[1] [2] [3] [4] [5]

Philip Wadler coined the term:

The Expression Problem is a new name for an old problem. The goal is to define a datatype by cases, where one can add new cases to the datatype and new functions over the datatype, without recompiling existing code, and while retaining static type safety (e.g., no casts). [6]

Wadler selected the term as a pun. On the one hand, the programmer is trying to "express" a solution to a problem. On the other hand, the standard illustrative example given is that of an interpreter for expressions in some simple calculator language.

The expression problem is also a fundamental problem in multi-dimensional Software Product Line design and in particular as an application (?) or special case(?) of FOSD Program Cubes.

News:

A modular solution of the expression problem was given by Lect.Drd. Dan Popa, from Bacau University during the summer of 2008. His idea has at least three important parts:

  • to produce a modular tree by using a sort of special functions called pseudoconstructors
  • to produce a modular language interpreter or a modular language evaluator using pseudoconstructors over monadic values instead of usual monadic semantics
  • to NOT use an interpret or an eval function but to make every expression an itself evaluator.

Basically, the main idea was to replace a typical case from the evaluator or interpreter which is written in Haskell as

do {vx <-interp x env;
    vy <-interp y env;
    return(vx +  vy); }:: M Float

by something very simple, a modular simple itself evaluator:

plus x y  =
do { vx <-x;
     vy <-y;
     return(vx +  vy); }:: M Float

supported by some definitions for numbers and classes of operations.Such functions can be spread in various modules.

As a result,an interpreter or an evaluator can be built by simply imported all the required modules in a main client module (program.)

Imagine.png

In the figure above you may see GHCI including the modules and being able to evaluate an abstract syntax tree which is built using pseudoconstructors. Note the fact that pseudoconstructors did not use Capitals as the usual constructors from the data declaration.

References

  1. ^ "User-defined types and procedural data structures as complementary approaches to data abstraction". http://www.google.com/url?sa=U&start=1&q=http://portal.acm.org/citation.cfm%3Fid%3D186680&ei=iM3QSdLVNYLoyAWv3szRCQ&usg=AFQjCNHnntAxyeeK5SzrnmPiJ77Qgr_pSw. 
  2. ^ "Object-Oriented Programming versues Abstract Data Types". http://www.google.com/url?sa=U&start=1&q=http://www.cs.utexas.edu/users/wcook/papers/OOPvsADT/CookOOPvsADT90.pdf&ei=Ms7QSYOwAqCyyQXPioHKCQ&usg=AFQjCNEx070KUZDcmbDS_x3uslsIYSaZCQ. 
  3. ^ "Synthesizing Object-Oriented and Functional Design to Promote Re-Use". http://www.google.com/url?sa=U&start=2&q=http://citeseer.ist.psu.edu/krishnamurthi98synthesizing.html&ei=xczQScHyNIvEyQWEv9nWCQ&usg=AFQjCNEU3GvIyhjYeU2JndB3Uu3-1olEBQ. 
  4. ^ "Extensible Algebraic Datatypes with Defaults". http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.28.6778. 
  5. ^ "Independently extensible solutions to the expression problem". http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.107.4449. 
  6. ^ "The Expression Problem". http://www.daimi.au.dk/~madst/tool/papers/expression.txt. 
  • ソーシャルブックマークに追加:

gooウェブ検索 急上昇ランキング (総合)
注目のニュース - gooニュース
米大統領 戦略核3分の1削減提案New
橋下氏、都議選次第で進退判断も
反韓デモで小競り合い、書類送検
俳優欠席で公演中止、賠償請求へ
集団パニック?女子生徒18人搬送
海で流され小6女児死亡 宮崎
NZ戦は「勝利を意識」佐々木監督
成嶋早穂妊娠、マエケンがパパに
gooのお知らせ
おもいやり食堂gooヘルスケア「おもいやり食堂」ヘルシー美味しい社員食堂に「おもいやり」。健康に配慮した人への“食”を通じた「おもいやり」。
スマホ版gooトップページの使い方gooトップページさらに使いやすくなった「スマホ版gooトップページ」の使い方をご紹介。実は60種類以上のデザインが選べるんです
gooブログのスマホアプリgooブログのスマホアプリを使えばいつでもどこでもブログが書ける♪今日を明日の思い出にしよう!
災害用伝言サービスから節電サポートまでNTTグループ内の災害対策リンク集で、万が一のための情報を知っておこう。
goo電子書籍特集「キミと話がしたいのだ。」何気ないしあわせ、疲れたココロに染みわたる、珠玉のショートストーリー。
Wikipedia記事検索について
gooサービス
不動産   賃貸   歌詞   恋愛相談   婚活   ダイエット   地図   乗り換え案内   天気   エコ   節電   中古車   バイク   講座   資格   求人転職   アルバイト   マネー   電話番号   国内旅行   海外旅行   行列ラーメン店   ビジネスコラム   プレスリリース   健康食品   妊娠・出産   子育て