まだまだ工夫の余地と変更はあるが。
type token = string/* token */; type value = any; type tokenData = Array<token>; type tokenSpaceName = string/*(remark="name of token space")*/; type MatrixEntry = [token, token] | [[token, token], value]; type MatrixData = Array<MatrixEntry>; type Matrix = { "type"?: "matrix", "dom"?: (tokenSpaceName | tokenData), "cod"?: (tokenSpaceName | tokenData), "data": MatrixData /*(, ** )*/ }; type matrixName = string; type MixedMatrixEntry = [matrixName , [token, token]] | [matrixName, [[token, token], value]]; type MixedMatrixData = Array<MixedMatrixEntry>; type MixedMatrix = { "type"?: "mixedMatrix", "dom"?: (tokenSpaceName | tokenData), "cod"?: (tokenSpaceName | tokenData), "data": MixedMatrixData /*(, ** )*/ };
テキスト表示:区切りはセミコロンまたは空白改行
- x : x∈dom(M)
- x,y : M(x, y) = 1 : `[x, y]`
- x,y,v : M(x, y) = v : `[[x, y], v]`
- ,y : y∈cod(M)
- A(x, y) : A(x, y) = 1 : `[A, [x, y]]`
- A(x, y, v) : A(x, y) = v : `[A, [ [x,y], v] ]`
{ "type": "matrix", "dom" : {"@id": "my:Term"}, "cod" : {"@id": "ourBLit/common/Term"}, "data" : [ ["ベクトル空間", "線形空間"] ] }
テキスト:
#--- # dom: my:Term # cod: our/common/Term #--- ベクトル空間, 線形空間