Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaZotov committed Sep 26, 2024
1 parent 587470f commit 0bedbf8
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 117 deletions.
2 changes: 1 addition & 1 deletion docs/_assets/scg.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ encapsulated this logic;
| ```_<~``` | ```<~_``` |
| ```_<|~``` | ```<|~_``` |

- It is now not possible to specify constancy for fuzzy arcs, because it may lead to misunderstanding of the non-factor denoted by this sc-arc. So, designations ```-/>```, ```</-```, ```_-/>```, ```_</-```, ```</-_```, ```~/>```, ```</~```, ```_~/>```, ```_</~```, ```</~_``` were removed. Use ```/>```, ```</```, ```_/>```, ```</_``` instead.
- Now it is not possible to specify constancy for fuzzy arcs, because it may lead to misunderstanding of the non-factor denoted by this sc-arc. So, designations ```-/>```, ```</-```, ```_-/>```, ```_</-```, ```</-_```, ```~/>```, ```</~```, ```_~/>```, ```_</~```, ```</~_``` were removed. Use ```/>```, ```</```, ```_/>```, ```</_``` instead.

- Misleading system identifiers of sc.s-keynodes were also replaced by clear ones.

Expand All @@ -135,14 +135,14 @@ encapsulated this logic;
| sc_edge_main | sc_main_arc |
| sc_node_struct | sc_node_structure |

Type `ScType::NodeAbstract` and sc.s-keynode `sc_node_abstract` were removed.
- Type `ScType::NodeAbstract` and sc.s-keynode `sc_node_abstract` were removed.

See documentation, to learn more about using new API.

### Added

- `GetSCsElementKeynode` method for sc-types to get their sc.s-keynode system identifiers
- `GetDirectSCsConnectorType` and `GetReverseSCsConnectorType` for sc-types to get their designations in SCs-code
- `GetDirectSCsConnector` and `GetReverseSCsConnector` for sc-types to get their designations in SCs-code
- std::string operator for sc-types to get names of their variable names
- All possible combinations of subtypes in sc-types into ScMemoryContext API and the SCs-code
- Type `ScType::NodeSuperclass` and sc.s-keynode `sc_node_superclass`
Expand Down
2 changes: 1 addition & 1 deletion docs/sc-memory/api/cpp/core/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ large graph structures.
### **What is the difference between ScType::ConstCommonArc and ScType::ConstPermPosArc?**

`ScType::ConstCommonArc` is a sc-type of sc-arc that connects two sc-elements in some relation.
`ScType::ConstPermPosArc` is a sc-type of sc-arc that denotes access of target sc-element to source sc-element.
`ScType::ConstPermPosArc` is a sc-type of sc-arc that denotes membership of target sc-element to source sc-element.
The sc-arc with sc-type `ScType::ConstCommonArc` between some two sc-elements can be transformed to sc-node to which
this two sc-elements belong.

Expand Down
2 changes: 1 addition & 1 deletion docs/sc-memory/api/cpp/extended/agents/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ This implementation allows to provide any sc-event type to `DoProgram`.

In multi-agent systems most of the agents are implemented to execute actions initiated by other agents. While `ScAgent` is useful to generate broad event handling logic, using it to handle action initiations requires some boilerplate. We've implemented another agent class to make it easier for our users to implement action-executing agents. Implementing these agents requires passing action class node rather than checking initiation condition manually.

This class can be only used for agents that should be triggered by generating an output sc-arc from `action_initiated` class node.
This class can be only used for agents that should be triggered by generating an outgoing sc-arc from `action_initiated` class node.

```cpp
// File my_agent.hpp
Expand Down
6 changes: 3 additions & 3 deletions docs/sc-memory/api/cpp/extended/helper_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ScAddr const & arcToSystemIdtfLinkAddr = quintuple.addr2;
ScAddr const & systemIdtfLinkAddr = quintuple.addr3;
// The sc-address of sc-link with system identifier of your sc-node.
ScAddr const & arcToArcToSystemIdtfLinkAddr = quintuple.addr4;
// The sc-address of access sc-arc between binary sc-relation
// The sc-address of membership sc-arc between binary sc-relation
// with system identifier `nrel_system_identifier` and the common sc-arc
// between your sc-node and sc-link with system identifier of your sc-node.
ScAddr const & nrelSystemIdtfAddr = quintuple.addr5;
Expand Down Expand Up @@ -138,7 +138,7 @@ ScAddr const & arcToSystemIdtfLinkAddr = quintuple.addr2;
ScAddr const & systemIdtfLinkAddr = quintuple.addr3;
// The sc-address of sc-link with system identifier of your sc-node.
ScAddr const & arcToArcToSystemIdtfLinkAddr = quintuple.addr4;
// The sc-address of access sc-arc between binary sc-relation
// The sc-address of membership sc-arc between binary sc-relation
// with system identifier `nrel_system_identifier` and the common sc-arc
// between your sc-node and sc-link with system identifier of your sc-node.
ScAddr const & nrelSystemIdtfAddr = quintuple.addr5;
Expand Down Expand Up @@ -182,7 +182,7 @@ ScAddr const & arcToSystemIdtfLinkAddr = quintuple.addr2;
ScAddr const & systemIdtfLinkAddr = quintuple.addr3;
// The sc-address of sc-link with system identifier of your sc-node.
ScAddr const & arcToArcToSystemIdtfLinkAddr = quintuple.addr4;
// The sc-address of access sc-arc between binary sc-relation
// The sc-address of membership sc-arc between binary sc-relation
// with system identifier `nrel_system_identifier` and the common sc-arc
// between your sc-node and sc-link with system identifier of your sc-node.
ScAddr const & nrelSystemIdtfAddr = quintuple.addr5;
Expand Down
2 changes: 1 addition & 1 deletion docs/sc-memory/api/cpp/extended/template_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The class to work with sc-templates in C++ API. Before reading this paragraph yo
common [information about sc-element types](../../../../scs/sc_element_types.md).

Let use `f` symbols for constant parameter of sc-template. Let use `a` symbol for a variable parameter of sc-template.
Then sc-template to search all output sc-connectors from specified sc-element will be a triple:
Then sc-template to search all outgoing sc-connectors from specified sc-element will be a triple:

* where the first sc-element is known `f`;
* second and the third sc-elements need to be found `a`.
Expand Down
4 changes: 2 additions & 2 deletions docs/sc-memory/sc-server/sc_json.g4
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ fragment CONTENT_ESCAPED
: '\\' ('[' | ']' | '\\')
;

fragment CONTENT_SYBMOL
fragment CONTENT_SYMBOL
: (CONTENT_ESCAPED | ~('[' | ']' | '\\'))
;

fragment CONTENT_SYBMOL_FIRST_END
fragment CONTENT_SYMBOL_FIRST_END
: (CONTENT_ESCAPED | ~('[' | ']' | '\\' | '*'))
;

Expand Down
190 changes: 95 additions & 95 deletions docs/scs/sc_element_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,101 +3,101 @@
---

<!-- This table is generated by test `PrintTypesToBitValues` in sc-memory/tests/sc-memory/common/test_sc_type.cpp -->
| C++ name | Value | Hex Value |
|---------------------------------|-------|-----------|
| ScType::Unknown | 0 | 0x0 |
| ScType::Node | 1 | 0x1 |
| ScType::Connector | 16384 | 0x4000 |
| ScType::CommonEdge | 16388 | 0x4004 |
| ScType::Arc | 49152 | 0xC000 |
| ScType::CommonArc | 49160 | 0xC008 |
| ScType::MembershipArc | 49168 | 0xC010 |
| ScType::Const | 32 | 0x20 |
| ScType::Var | 64 | 0x40 |
| ScType::ConstNode | 33 | 0x21 |
| ScType::VarNode | 65 | 0x41 |
| ScType::ConstConnector | 16416 | 0x4020 |
| ScType::VarConnector | 16448 | 0x4040 |
| ScType::ConstCommonEdge | 16420 | 0x4024 |
| ScType::VarCommonEdge | 16452 | 0x4044 |
| ScType::ConstArc | 49184 | 0xC020 |
| ScType::VarArc | 49216 | 0xC040 |
| ScType::ConstCommonArc | 49192 | 0xC028 |
| ScType::VarCommonArc | 49224 | 0xC048 |
| ScType::ConstMembershipArc | 49200 | 0xC030 |
| ScType::VarMembershipArc | 49232 | 0xC050 |
| ScType::PermArc | 55312 | 0xD810 |
| ScType::TempArc | 50192 | 0xC410 |
| ScType::ConstPermArc | 55344 | 0xD830 |
| ScType::VarPermArc | 55376 | 0xD850 |
| ScType::ConstTempArc | 50224 | 0xC430 |
| ScType::VarTempArc | 50256 | 0xC450 |
| ScType::ActualTempArc | 54288 | 0xD410 |
| ScType::InactualTempArc | 58384 | 0xE410 |
| ScType::ConstActualTempArc | 54320 | 0xD430 |
| ScType::VarActualTempArc | 54352 | 0xD450 |
| ScType::ConstInactualTempArc | 58416 | 0xE430 |
| ScType::VarInactualTempArc | 58448 | 0xE450 |
| ScType::PosArc | 49296 | 0xC090 |
| ScType::NegArc | 49424 | 0xC110 |
| ScType::FuzArc | 49680 | 0xC210 |
| ScType::ConstPosArc | 49328 | 0xC0B0 |
| ScType::VarPosArc | 49360 | 0xC0D0 |
| ScType::PermPosArc | 55440 | 0xD890 |
| ScType::TempPosArc | 50320 | 0xC490 |
| ScType::ActualTempPosArc | 54416 | 0xD490 |
| ScType::InactualTempPosArc | 58512 | 0xE490 |
| ScType::ConstPermPosArc | 55472 | 0xD8B0 |
| ScType::ConstTempPosArc | 50352 | 0xC4B0 |
| ScType::ConstActualTempPosArc | 54448 | 0xD4B0 |
| ScType::ConstInactualTempPosArc | 58544 | 0xE4B0 |
| ScType::VarPermPosArc | 55504 | 0xD8D0 |
| ScType::VarTempPosArc | 50384 | 0xC4D0 |
| ScType::VarActualTempPosArc | 54480 | 0xD4D0 |
| ScType::VarInactualTempPosArc | 58576 | 0xE4D0 |
| ScType::ConstNegArc | 49456 | 0xC130 |
| ScType::VarNegArc | 49488 | 0xC150 |
| ScType::PermNegArc | 55568 | 0xD910 |
| ScType::TempNegArc | 50448 | 0xC510 |
| ScType::ActualTempNegArc | 54544 | 0xD510 |
| ScType::InactualTempNegArc | 58640 | 0xE510 |
| ScType::ConstPermNegArc | 55600 | 0xD930 |
| ScType::ConstTempNegArc | 50480 | 0xC530 |
| ScType::ConstActualTempNegArc | 54576 | 0xD530 |
| ScType::ConstInactualTempNegArc | 58672 | 0xE530 |
| ScType::VarPermNegArc | 55632 | 0xD950 |
| ScType::VarTempNegArc | 50512 | 0xC550 |
| ScType::VarActualTempNegArc | 54608 | 0xD550 |
| ScType::VarInactualTempNegArc | 58704 | 0xE550 |
| ScType::ConstFuzArc | 49712 | 0xC230 |
| ScType::VarFuzArc | 49744 | 0xC250 |
| ScType::NodeLink | 3 | 0x3 |
| ScType::NodeLinkClass | 2051 | 0x803 |
| ScType::NodeTuple | 129 | 0x81 |
| ScType::NodeStructure | 257 | 0x101 |
| ScType::NodeRole | 513 | 0x201 |
| ScType::NodeNoRole | 1025 | 0x401 |
| ScType::NodeClass | 2049 | 0x801 |
| ScType::NodeSuperclass | 4097 | 0x1001 |
| ScType::NodeMaterial | 8193 | 0x2001 |
| ScType::ConstNodeLink | 35 | 0x23 |
| ScType::ConstNodeLinkClass | 2083 | 0x823 |
| ScType::ConstNodeTuple | 161 | 0xA1 |
| ScType::ConstNodeStructure | 289 | 0x121 |
| ScType::ConstNodeRole | 545 | 0x221 |
| ScType::ConstNodeNoRole | 1057 | 0x421 |
| ScType::ConstNodeClass | 2081 | 0x821 |
| ScType::ConstNodeSuperclass | 4129 | 0x1021 |
| ScType::ConstNodeMaterial | 8225 | 0x2021 |
| ScType::VarNodeLink | 67 | 0x43 |
| ScType::VarNodeLinkClass | 2115 | 0x843 |
| ScType::VarNodeTuple | 193 | 0xC1 |
| ScType::VarNodeStructure | 321 | 0x141 |
| ScType::VarNodeRole | 577 | 0x241 |
| ScType::VarNodeNoRole | 1089 | 0x441 |
| ScType::VarNodeClass | 2113 | 0x841 |
| ScType::VarNodeSuperclass | 4161 | 0x1041 |
| ScType::VarNodeMaterial | 8257 | 0x2041 |
| C++ name | Decimal value | Hex value |
|---------------------------------|---------------|-----------|
| ScType::Unknown | 0 | 0x0 |
| ScType::Node | 1 | 0x1 |
| ScType::Connector | 16384 | 0x4000 |
| ScType::CommonEdge | 16388 | 0x4004 |
| ScType::Arc | 49152 | 0xC000 |
| ScType::CommonArc | 49160 | 0xC008 |
| ScType::MembershipArc | 49168 | 0xC010 |
| ScType::Const | 32 | 0x20 |
| ScType::Var | 64 | 0x40 |
| ScType::ConstNode | 33 | 0x21 |
| ScType::VarNode | 65 | 0x41 |
| ScType::ConstConnector | 16416 | 0x4020 |
| ScType::VarConnector | 16448 | 0x4040 |
| ScType::ConstCommonEdge | 16420 | 0x4024 |
| ScType::VarCommonEdge | 16452 | 0x4044 |
| ScType::ConstArc | 49184 | 0xC020 |
| ScType::VarArc | 49216 | 0xC040 |
| ScType::ConstCommonArc | 49192 | 0xC028 |
| ScType::VarCommonArc | 49224 | 0xC048 |
| ScType::ConstMembershipArc | 49200 | 0xC030 |
| ScType::VarMembershipArc | 49232 | 0xC050 |
| ScType::PermArc | 55312 | 0xD810 |
| ScType::TempArc | 50192 | 0xC410 |
| ScType::ConstPermArc | 55344 | 0xD830 |
| ScType::VarPermArc | 55376 | 0xD850 |
| ScType::ConstTempArc | 50224 | 0xC430 |
| ScType::VarTempArc | 50256 | 0xC450 |
| ScType::ActualTempArc | 54288 | 0xD410 |
| ScType::InactualTempArc | 58384 | 0xE410 |
| ScType::ConstActualTempArc | 54320 | 0xD430 |
| ScType::VarActualTempArc | 54352 | 0xD450 |
| ScType::ConstInactualTempArc | 58416 | 0xE430 |
| ScType::VarInactualTempArc | 58448 | 0xE450 |
| ScType::PosArc | 49296 | 0xC090 |
| ScType::NegArc | 49424 | 0xC110 |
| ScType::FuzArc | 49680 | 0xC210 |
| ScType::ConstPosArc | 49328 | 0xC0B0 |
| ScType::VarPosArc | 49360 | 0xC0D0 |
| ScType::PermPosArc | 55440 | 0xD890 |
| ScType::TempPosArc | 50320 | 0xC490 |
| ScType::ActualTempPosArc | 54416 | 0xD490 |
| ScType::InactualTempPosArc | 58512 | 0xE490 |
| ScType::ConstPermPosArc | 55472 | 0xD8B0 |
| ScType::ConstTempPosArc | 50352 | 0xC4B0 |
| ScType::ConstActualTempPosArc | 54448 | 0xD4B0 |
| ScType::ConstInactualTempPosArc | 58544 | 0xE4B0 |
| ScType::VarPermPosArc | 55504 | 0xD8D0 |
| ScType::VarTempPosArc | 50384 | 0xC4D0 |
| ScType::VarActualTempPosArc | 54480 | 0xD4D0 |
| ScType::VarInactualTempPosArc | 58576 | 0xE4D0 |
| ScType::ConstNegArc | 49456 | 0xC130 |
| ScType::VarNegArc | 49488 | 0xC150 |
| ScType::PermNegArc | 55568 | 0xD910 |
| ScType::TempNegArc | 50448 | 0xC510 |
| ScType::ActualTempNegArc | 54544 | 0xD510 |
| ScType::InactualTempNegArc | 58640 | 0xE510 |
| ScType::ConstPermNegArc | 55600 | 0xD930 |
| ScType::ConstTempNegArc | 50480 | 0xC530 |
| ScType::ConstActualTempNegArc | 54576 | 0xD530 |
| ScType::ConstInactualTempNegArc | 58672 | 0xE530 |
| ScType::VarPermNegArc | 55632 | 0xD950 |
| ScType::VarTempNegArc | 50512 | 0xC550 |
| ScType::VarActualTempNegArc | 54608 | 0xD550 |
| ScType::VarInactualTempNegArc | 58704 | 0xE550 |
| ScType::ConstFuzArc | 49712 | 0xC230 |
| ScType::VarFuzArc | 49744 | 0xC250 |
| ScType::NodeLink | 3 | 0x3 |
| ScType::NodeLinkClass | 2051 | 0x803 |
| ScType::NodeTuple | 129 | 0x81 |
| ScType::NodeStructure | 257 | 0x101 |
| ScType::NodeRole | 513 | 0x201 |
| ScType::NodeNoRole | 1025 | 0x401 |
| ScType::NodeClass | 2049 | 0x801 |
| ScType::NodeSuperclass | 4097 | 0x1001 |
| ScType::NodeMaterial | 8193 | 0x2001 |
| ScType::ConstNodeLink | 35 | 0x23 |
| ScType::ConstNodeLinkClass | 2083 | 0x823 |
| ScType::ConstNodeTuple | 161 | 0xA1 |
| ScType::ConstNodeStructure | 289 | 0x121 |
| ScType::ConstNodeRole | 545 | 0x221 |
| ScType::ConstNodeNoRole | 1057 | 0x421 |
| ScType::ConstNodeClass | 2081 | 0x821 |
| ScType::ConstNodeSuperclass | 4129 | 0x1021 |
| ScType::ConstNodeMaterial | 8225 | 0x2021 |
| ScType::VarNodeLink | 67 | 0x43 |
| ScType::VarNodeLinkClass | 2115 | 0x843 |
| ScType::VarNodeTuple | 193 | 0xC1 |
| ScType::VarNodeStructure | 321 | 0x141 |
| ScType::VarNodeRole | 577 | 0x241 |
| ScType::VarNodeNoRole | 1089 | 0x441 |
| ScType::VarNodeClass | 2113 | 0x841 |
| ScType::VarNodeSuperclass | 4161 | 0x1041 |
| ScType::VarNodeMaterial | 8257 | 0x2041 |

<!-- This table is generated by test `PrintTypesToSCsSCgNodes` in sc-memory/tests/sc-memory/common/test_sc_type.cpp -->
| C++ name | SCg-code | SCs-code |
Expand Down
19 changes: 9 additions & 10 deletions docs/scs/scs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ To make an `sc-link` into specified file you can use special type identifier:

#### **Names**

There are some tricks with object names:
There are some tricks with sc-node names:

* `...` - is an unnamed object;
* `_<object name>` - all object names, that starts with symbol `_` represents a variable type of objects.
* `...` - is an unnamed sc-node;
* `_<node name>` - all sc-node names, that starts with symbol `_` represents a variable type of sc-nodes.

Objects identifier visibility. By default, all objects with name `x` are visible anywhere. After translating it into memory this object will have a **system identifier** equal to `x`. So if you use `x` in different *scs* files, then you designate the same object in them (would be the same element in a knowledge base).

Expand Down Expand Up @@ -74,7 +74,7 @@ You can use alias for any sc-element by using `=` operator. There are some examp

SCs-code level 1 is a simple representation of SC-code. It represents SC-texts
with just simple triples. Each triple contains `subject`, `predicate`, `object`
that are split by `|` symbol. Line `sc_node#subject | sc_membership_arc#predicate | sc_node#object;;` is a sentence.
that are split by `|` symbol. Line `sc_node#subject_identifier | sc_membership_arc#predicate_identifier | sc_node#object_identifier;;` is a sentence.

Identifier of `subject`, `predicate`, `object` build with rule:

Expand Down Expand Up @@ -108,11 +108,11 @@ Where `type` is an element type specification. It can be one of possible values:
<code class="js hljs javascript">
// append set of apples into fruit set
sc_node#fruit
| sc_arc_main#..arc
| sc_main_arc#..arc
| sc_node#apple;;
// append set of bananas into fruit set
sc_node#fruit
| sc_arc_main#..arc
| sc_main_arc#..arc
| sc_node#banana;;
</code>
</pre>
Expand Down Expand Up @@ -304,7 +304,7 @@ For this example it would be like this:
a -> c: b;;
```

In case, when output sc-arc from `c` is a variable, then use `::` splitter instead of `:`:
In case, when outgoing sc-arc from `c` is a variable, then use `::` splitter instead of `:`:

```scs
a -> c:: b;;
Expand All @@ -316,9 +316,8 @@ equal to:
c _-> (a -> b);;
```

<div class="note">
<b>Note</b>: you can use <code>:</code>, <code>::</code> just to replace <code>-></code> or <code>_-></code> sc-arcs.
</div>
!!! note
You can use <code>:</code>, <code>::</code> just to replace <code>-></code> or <code>_-></code> sc-arcs.

<hr/>

Expand Down

0 comments on commit 0bedbf8

Please sign in to comment.