Property Provider Console
03/2024
Abstract: This article describes the development of a tool for mapping and relating objects to properties. The user can rank objects based on their properties and examine object sets.
As a starting point, I considered combinations of properties of certain mathematical structures like sets, tuples, lists, and so on. Then, I mapped a complete set of combinations of properties, and in the process, I found out I could now rank them according to the similarity of their set of properties. This complete enumeration also allowed to discover new objects.
I implemented a relation relating objects to properties, and a scoring algorithm ordering arbitrary objects with respect to a particular object which worked as a similarity measure between two objects. It's now possible to identify most similar and dissimilar objects with respect to an object and check for definitional holes, defining new objects for such missing combinations of properties.
Let's present a practical example. Given the following input file:
Collections, Multiset Collections, Tuple Collections, Struct Collections, ElementNamedTuple Collections, Set Collections, Track Collections, Array Collections, String Collections, Column Properties, NaturalOrdering Properties, ElementNaming Properties, Uniqueness Properties, Typing Properties, Naming // Multiset has no properties Collections.Tuple , Properties.NaturalOrdering Collections.Struct, Properties.ElementNaming Collections.Set , Properties.Uniqueness Collections.Track , Properties.Typing Collections.String, Properties.Naming Collections.ElementNamedTuple, Properties.ElementNaming Collections.ElementNamedTuple, Properties.NaturalOrdering Collections.Array , Properties.NaturalOrdering Collections.Array , Properties.Typing Collections.Column , Properties.Naming Collections.Column , Properties.NaturalOrdering Collections.Column , Properties.Typing
The following results would follow:
PropertyProvider v0.1 PP> load D:\PropertyProviderConsoleSample.txt 2 classes constructed 14 class elements added 2 relations defined 24 relation elements defined PP> help exit, outfile, classes, relations, [className], [className] v [className] [className] v [className] (!|!!|?|??) [classElement] PP> classes Collections, Properties PP> relations (Collections, Properties), (Properties, Collections) PP> Collections Collections.Multiset, Collections.Tuple, Collections.Struct, Collections.ElementNamedTuple, Collections.Set, Collections.Track, Collections.Array, Collections.String, Collections.Column PP> Properties Properties.NaturalOrdering, Properties.ElementNaming, Properties.Uniqueness, Properties.Typing, Properties.Naming PP> Collections v Properties > +---------------------------+-----------------+ | (Collections, Properties) | 1/5 | +---------------------------+-----------------+ | Multiset | | | Tuple | | | Struct | ElementNaming | | ElementNamedTuple | ElementNaming | | Set | | | Track | | | Array | | | String | | | Column | | +---------------------------+-----------------+ < > > help b|break, c|clear, pp, pn, pf, pl, p[pageNumber] > pn +---------------------------+-----------------+ | (Collections, Properties) | 2/5 | +---------------------------+-----------------+ | Multiset | | | Tuple | | | Struct | | | ElementNamedTuple | | | Set | | | Track | | | Array | | | String | Naming | | Column | Naming | +---------------------------+-----------------+ < > PP> Properties v Collections > +---------------------------+-------------------+ | (Properties, Collections) | 1/9 | +---------------------------+-------------------+ | NaturalOrdering | Array | | ElementNaming | | | Uniqueness | | | Typing | Array | | Naming | | +---------------------------+-------------------+ < > PP> Properties v Collections > pn +---------------------------+-------------------+ | (Properties, Collections) | 2/9 | +---------------------------+-------------------+ | NaturalOrdering | Column | | ElementNaming | | | Uniqueness | | | Typing | Column | | Naming | Column | +---------------------------+-------------------+ < > PP> Collections v Properties ! Set > s +---------------------------+-----------------+ | (Collections, Properties) | 1/5 | +---------------------------+-----------------+ | (5) Set | ElementNaming | | (4) Multiset | ElementNaming | | (3) Tuple | ElementNaming | | (3) Struct | | | (3) Track | ElementNaming | | (3) String | ElementNaming | | (2) ElementNamedTuple | | | (2) Array | ElementNaming | | (1) Column | ElementNaming | +---------------------------+-----------------+ < > > pn +---------------------------+-----------------+ | (Collections, Properties) | 2/5 | +---------------------------+-----------------+ | (5) Set | Naming | | (4) Multiset | Naming | | (3) Tuple | Naming | | (3) Struct | Naming | | (3) Track | Naming | | (3) String | | | (2) ElementNamedTuple | Naming | | (2) Array | Naming | | (1) Column | | +---------------------------+-----------------+ < > PP> Properties v Collections !! Uniqueness > s +---------------------------+-------------------+ | (Properties, Collections) | 1/9 | +---------------------------+-------------------+ | (9) Uniqueness | | | (6) ElementNaming | | | (6) Naming | | | (5) Typing | Array | | (4) NaturalOrdering | Array | +---------------------------+-------------------+ < > PP> Properties v Collections ! Uniqueness > s +---------------------------+-------------------+ | (Properties, Collections) | 1/9 | +---------------------------+-------------------+ | (9) Uniqueness | Array | | (6) ElementNaming | Array | | (6) Naming | Array | | (5) Typing | | | (4) NaturalOrdering | | +---------------------------+-------------------+ < > PP> Collections v Properties ? Array > s +---------------------------+-----------------+ | (Collections, Properties) | 1/5 | +---------------------------+-----------------+ | (3) Struct | | | (3) Set | ElementNaming | | (3) String | ElementNaming | | (2) Multiset | ElementNaming | | (2) ElementNamedTuple | | | (1) Tuple | ElementNaming | | (1) Track | ElementNaming | | (1) Column | ElementNaming | | (0) Array | ElementNaming | +---------------------------+-----------------+ < > > save %LOCALAPPDATA%\PropertyProvider\PropertyProviderOut.txt +---------------------------+-----------------+-----------------+-----------------+-----------------+-----------------+ | (Collections, Properties) | 1/5 | 2/5 | 3/5 | 4/5 | 5/5 | +---------------------------+-----------------+-----------------+-----------------+-----------------+-----------------+ | (3) Struct | | Naming | | | Uniqueness | | (3) Set | ElementNaming | Naming | | | | | (3) String | ElementNaming | | | | Uniqueness | | (2) Multiset | ElementNaming | Naming | | | Uniqueness | | (2) ElementNamedTuple | | Naming | NaturalOrdering | | Uniqueness | | (1) Tuple | ElementNaming | Naming | NaturalOrdering | | Uniqueness | | (1) Track | ElementNaming | Naming | | Typing | Uniqueness | | (1) Column | ElementNaming | | NaturalOrdering | Typing | Uniqueness | | (0) Array | ElementNaming | Naming | NaturalOrdering | Typing | Uniqueness | +---------------------------+-----------------+-----------------+-----------------+-----------------+-----------------+
Observations
- A project can contain any number of classes and relations. The "Properties" classes is not hardcoded and is just a "default" class name for properties of objects. Any classes of objects could be related
- Tables are paged to allow a constant width for inspection. Full tables can be printed to files with
save
- Reverse relations are automatically created from any relation
- The
A v B ! C
syntax, whereA
is the "key" class andB
is the "value" class, performs similarity scoring (non-unique) in the relation with respect to elementC
of the key class. The descending similarity score is shown in parenthesis on the key cell - Dissimilarity scoring is also available with the
?
operator - The double operators
!!
and??
for scoring shows true or false values (which we call "characteristics"), as opposed to equal or distinct values (for similarity or dissimilarity respectively), for each key class - The project abstracts class element names as Symbols, which allows to:
- Enforce uniqueness of Symbols on a class
- Implement integer encoding of Symbols, as 1) combination of elements on a Set is expressible as a sum, 2) powers-of-two sums are unique, and 3) classes are Sets. Thus, element combinations (or Objects) are encoded as unique integers in a way such that, from an integer, the combination (or Object) is recoverable.
Implementation
The operations have been implemented in a command line program written in C# 11 and released under the AGPL-3.0.