Abstract Wikipedia/Pre-generic function model/ja

Phabricator プロジェクト:#abstract wikipedia
From Meta, a Wikimedia project coordination wiki
This page is a translated version of the page Abstract Wikipedia/Pre-generic function model and the translation is 31% complete.
This page is historic and does not describe the current situation. See f:Wikifunctions:Function model for the current version of the function model.

メーリングリストによる抽象ウィキペディア IRCに関する抽象的なウィキペディア Telegramのウィキファンクションズ Wikifunctions on Mastodon Twitterのウィキファンクションズ Facebook上のウィキファンクションズ YouTubeのウィキファンクションズ ウィキファンクションズのウェブサイト Translate

The current function model prescribes the function model of Wikifunctions for the time where we plan to launch the wiki. 具体的には、すでに機能が完成しており、関数の実行、関数呼び出し、配合計算、ジェネリック分類が可能だと仮定します。しかしながらこれらはPhase ζ (zeta) まで利用できません。 This currently hampers the implementations of tasks in the earlier phases as we have to come up on the fly with non-generic versions of central types.

(実はもっと状況は悪く、実際の関数モデルは実装用関数モデルとジェネリック前モデルの奇妙なハイブリッドになってしまいました。 We want to clean up both parts with this rewrite, starting with defining the pre-generic function model.)

この障壁を解消するため、完全版の関数モデルを簡素化して、ジェネリック導入までストップギャップ解決策としてここに提示します。

全般的な差違とはジェネリクス generics を用いない場合、ローカルのキーが大きく減少する点です。 So the whole function model assumes that we do not have local keys, or that we can get rid of them in normalization. ジェネリクスを導入後は不可能になります。

下記の一覧で「変更なし」とは、その種別が pre-generic モデルでも完成版関数モデルでも変更がないという意味です。

Note that the ZIDs are not final. The discussion is ongoing here.

Z1/Object (Z4/Type)

  • Z1K1/type (Z4/Type)

変更なし。

Z2/Persistent object (Z4/Type)

  • Z2K1/id (Z6/String)
  • Z2K2/value (Z1/Object)
  • Z2K3/label (Z12/Multilingual text)
  • Z2K4/aliases (Z32/Multilingual set)
  • Z2K5/description (Z12/Multilingual text)


変更なし。

Z3/Key (Z4/Type)

  • Z3K1/value type (Z4/Type)
  • Z3K2/key id (Z6/String)
  • Z3K3/label (Z12/Multilingual text)

変更なし。

Z4/Type (Z4/Type)

  • Z4K1/identity (Z4/Type)
  • Z4K2/keys (Z10/List)
  • Z4K3/validator (Z8/Function)

Z4K2 should expect a Z10/List of Z3/Key but that is not possible yet. So it just expects a Z10/List.

Z4K3 should expect a Z8/Function that takes a single input of type Z1/Object and returns a Z10/List of Z5/Error, but that is not possible yet, so it is just Z8/Function.

Z5/Error (Z4/Type)

  • Z5K1/error type (Z50/Error type)
  • Z5K2/error value (Z1/Any)

変更なしか?

Z6/String (Z4/Type)

  • Z6K1/string value (Z6/String)

変更なし。

Z7/Function call (Z4/Type)

  • Z7K1/function (Z8/Function)
  • Others based on Z8/Function

This will change significantly. In the pre-generic version this is a Z4/Type whose instances have wildly different behavior than any other type’s instances: the keys are not defined by the Z4/Type, but by the Z8/Function. This will need special handling in the pre-generic world. For the post-generic world we hope to get a unified treatment. See discussion here.

Z8/Function (Z4/Type)

  • Z8K1/arguments (Z10/List)
  • Z8K2/return type (Z4/Type)
  • Z8K3/testers (Z10/List)
  • Z8K4/implementations (Z10/List)
  • Z8K5/identity (Z8/Function)

This will change significantly. In the pre-generic version this is a Z4/Type and this will become a Z8/Function later that has basically the given keys. Z8K1/arguments should be a Z10/List of Z17/Argument declaration (TBD). Z8K3 and Z8K4 should be a Z10/List of Z20/Tester respectively Z14/Implementation with the given Z8/Function as an argument. Needs to be specced out fully.

Z9/Reference (Z4/Type)

  • Z9K1/reference ID (Z6/String)

変更なし。

Z10/List (Z4/Type)

  • Z10K1/head (Z1/Object)
  • Z10K2/tail (Z10/List)

これは典型的な Z4/Type になります。 In the pre-generic version it takes any Z1/Object as a value and then has a Z10/List as its continuation. In the post-generic world this will become a Z8/Function with a single argument of type Z4/Type that returns a Z4/Type (the parameterized list) whose type for the head will be the given Z4/Type and whose type for the tail will be a Z10/List parametrized with the same type.

Z11/Monolingual text (Z4/Type)

  • Z11K1/language (Z60/Language)
  • Z11K2/text (Z6/String)

変更なし。

Z12/Multilingual text (Z4/Type)

  • Z12K1/texts (Z10/List)

The type of Z12K1 should become a Z10/List of Z11/Monolingual texts.

Z14/Implementation (Z4/Type)

  • Z14K1/function (Z8/Function)
  • Z14K2/composition (Z1/Any)
  • Z14K3/code (Z16/Code)
  • Z14K4/built in (Z6/String)

This should take the function as an argument. Needs to be rethought.

Z16/Code (Z4/Type)

  • Z16K1/language (Z61/Programming language)
  • Z16K2/code (Z6/String)
  • Z16K3/signature (Z10/List)

The signature will be a Z10/List of Z4/Types. That will be only needed in the generic model: the only reason for having a signature separate from the one in the definition is that we might not need to evaluate the values before executing the function.

Z17/Argument declaration

  • Z17K1/argument type (Z4/Type)
  • Z17K2/key id (Z6/String)
  • Z17K3/label (Z12/Multilingual text)

変更なし。 But does it even need to exist or can it be just Z3/Key?

Z18/Argument reference (Z4/Type)

  • Z18K1/key id (Z6/String)

変更なし。

Z20/Tester (Z4/Type)

  • Z20K1/function (Z8/Function)
  • Z20K2/call (Z7/Function call)
  • Z20K3/result validation (Z7/Function call)

Z21/Unit (Z4/Type)

  • (No keys)

変更なし。

Z22/Pair (Z4/Type)

  • Z22K1/first (Z1/Object)
  • Z22K2/second (Z1/Object)

これもジェネリクス(総体型)です。

Z23/Nothing (Z4/Type)

  • (No keys)

変更なし。

Z31/MonoLingualStringSet (Z4/Type)

  • Z31K1/language (Z60/Language)
  • Z31K2/stringset (Z10/List)

Z31K2/stringset will be a Z10/List of Z6/Strings.

Z32/MultiLingualStringSet (Z4/Type)

  • Z21K1/stringsets (Z10/List)

Z32K1/stringsets will be a Z10/List of Z31/MonoLingualStringSets.

Z39/Key reference (Z4/Type)

  • Z39K1/reference (Z6/String)

変更なし。

Z40/Boolean (Z4/Type)

  • Z40K1/identity (Z40/Boolean)

変更なし。

Z50/Error type (Z4/Type)

  • Z50K1/keys (Z10/List)
  • Z50K2/...: Something that turns this into a string given the keys. This will be added later.

This will change. The Z50K1 will be a Z10/List of Z3/Keys, and more importantly, this would become a function that creates a Z4/Type.

Z60/Language (Z4/Type)

  • Z60K1/code (Z6/String)
  • Z60K2/code aliases (Z10/List)

変更なし。

Z61/Programming language (Z4/Type)

  • Z61K1/code (Z6/String)

変更なし。

Z70/Union (Z4/Type)

Does not exist in the pre-generic model.

Z80/Byte (Z4/Type)

  • Z80K1/value (Z6/String)

変更なし。

Z86/Code point (Z4/Type)

  • Z86K1/value (Z6/String)

変更なし。

Z99/引用 (Z4/Type)

  • Z99K1/quotation (Z1/Object)

変更なし。

関連項目