Logiweb(TM)

13.4.10 Pages

Prev Up Next Page 450 of 800 Search internet


Logiweb-vector::=bibliography dictionary body
bibliography::=reference reference* nil
nil::=0000 0000
dictionary::=entry* x00
entry::=id arity
id::=cardinal (whose value is non-zero)
arity::=cardinal
body::=bytes
default-format::=flat-tree ignored
flat-tree::=cardinal*
ignored::=bytes

A Logiweb vector is the format in which Logiweb pages are stored on disk and transmitted over networks.

The syntax for Logiweb vectors is irrelevant to the Logiweb protocol, but is included here because it just takes up a few lines in the present context.

A Logiweb vector consists of a bibliography, a dictionary, and a body.

A bibliography is a sequence of references consisting of at least one reference. Reference zero (the first reference) is the reference of the page itself. The key of reference zero must be the RIPEMD-160 hash key for all the bytes following the key (i.e. the timestamp of reference zero, the remainder of the bibliography, and the bytes following the bibliography).

A dictionary is an association list which maps indexes to arities. The dictionary introduces a list of symbols where a symbol is a pair (r,i) of cardinals. Each entry (i,a) in the dictionary introduces the symbol (r,i) where r is the reference cardinal of the page, i.e. the first reference in the bibliography converted to a cardinal. Furthermore, each entry (i,a) assigns arity a to the symbol (r,i).

If the bibliography has more than one element, then the Logiweb page referenced by reference number 1 (the second element in the list) is termed the 'bed' page. The bed page may specify how to unpack a body from a sequence of bytes to a tree structure. If it does not, then the body must have the format specified by default-format

A flat-tree is a Polish prefix representation of a body. Each cardinal in the flat-tree represents one symbol (r,i) as follows: each cardinal has value i*n+j+1 where i is the index of the represented symbol, n is the number of elements of the bibliography, and the reference of the symbol is reference number j in the bibliography.

Unpacking the Polish prefix representation into a tree requires knowledge of all arities of all symbols, i.e. knowledge of the dictionary of all pages mentioned in the bibliography.

Since symbols are represented by i*n+j+1 where i, n, and j are cardinals, the number zero does not represent a symbol. If the number zero occurs in a flat-tree, then the cardinal following the zero is a length field which defines a cardinal B, and the next B bytes constitute a string of bytes to be included as a string in the body.

Prev Up Next Page 450 of 800 Search logiweb.eu

Copyright © 2010 Klaus Grue, GRD-2010-01-05