Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmonise role relations for operator operands #31

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

NikitaZotov
Copy link
Member

No description provided.

@NikitaZotov NikitaZotov self-assigned this Nov 17, 2024
@NikitaZotov NikitaZotov added 0.1.0 enhancement New feature or request labels Nov 17, 2024
@@ -3,6 +3,7 @@ project(scp-machine)
set(CMAKE_CXX_STANDARD 17)
get_filename_component(PARENT_DIR ${CMAKE_SOURCE_DIR} DIRECTORY)

set(CMAKE_BUILD_TYPE Debug)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it enables logs

_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._action;;
_-> rrel_2:: rrel_assign:: rrel_scp_var:: rrel_const_perm_pos_arc:: .._arc1;;
_-> rrel_3:: rrel_assign:: rrel_scp_var:: rrel_const:: rrel_node:: .._param;;
_-> rrel_4:: rrel_assign:: rrel_scp_var:: rrel_const_perm_pos_arc:: .._arc2;;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indent

@@ -0,0 +1,165 @@
agent_program_search_all_outgoing_arcs_with_relations
=> nrel_main_idtf:
[агентная scp-программа поиска всех выходящих sc-дуг с отношениями] (* <- lang_ru;; *);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[агентная scp-программа поиска всех выходящих sc-дуг с отношениями] (* <- lang_ru;; *);
[агентная scp-программа поиска всех выходящих базовых sc-дуг с отношениями] (* <- lang_ru;; *);

<-_ genElStr5;;

_-> rrel_1:: rrel_fixed:: rrel_scp_var:: .._action;;
_-> rrel_2:: rrel_assign:: rrel_scp_var:: rrel_const:: rrel_common_arc:: rrel_arc:: .._arc1;;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one has rrel_common_arc and rrel_arc, second one can be removed

@@ -0,0 +1,54 @@
sc_agent_search_all_outgoing_arcs_with_relations
=> nrel_main_idtf:
[sc-агент поиска всех выходящих sc-дуг с отношениями] (* <- lang_ru;; *);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[sc-агент поиска всех выходящих sc-дуг с отношениями] (* <- lang_ru;; *);
[sc-агент поиска всех выходящих базовых sc-дуг с отношениями] (* <- lang_ru;; *);


// Node types
static inline ScKeynode const rrel_struct{"rrel_struct"};
static inline ScKeynode const rrel_fuz_arc{"rrel_fuz", ScType::ConstNodeRole};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static inline ScKeynode const rrel_fuz_arc{"rrel_fuz", ScType::ConstNodeRole};
static inline ScKeynode const rrel_fuz_arc{"rrel_fuz_arc", ScType::ConstNodeRole};

@@ -277,13 +279,17 @@ void SCPOperand::resolveModifiers()
element_type = element_type | ScType::Node;
continue;
}
if (modifier == Keynodes::rrel_link)
if (modifier == Keynodes::rrel_node_link || modifier == Keynodes::rrel_link)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should replace old roles with new roles in ims as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do it later

Comment on lines 284 to 285
if (modifier == Keynodes::rrel_link)
SCP_LOG_WARNING("Role relation `rrel_link` is deprecated. Use role relation `rrel_node_link` instead.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do this with some map instead of 5000 copy-pastes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why, but have it your way.

Comment on lines +49 to +63
@input_arc = (.._subscription_element _-> .._action);;
.._process
<-_ scp_process;

_-> rrel_1:: rrel_in:: _event;
_-> rrel_2:: rrel_in:: @input_arc;

<=_ nrel_decomposition_of_action:: _...
(*
_-> rrel_1:: .._operator1
(*
<-_ searchElStr3;;

_-> rrel_1:: rrel_assign:: rrel_scp_var:: .._subscription_element;;
_-> rrel_2:: rrel_fixed:: rrel_scp_const:: @input_arc;;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@input_arc = (.._subscription_element _-> .._action);;
.._process
<-_ scp_process;
_-> rrel_1:: rrel_in:: _event;
_-> rrel_2:: rrel_in:: @input_arc;
<=_ nrel_decomposition_of_action:: _...
(*
_-> rrel_1:: .._operator1
(*
<-_ searchElStr3;;
_-> rrel_1:: rrel_assign:: rrel_scp_var:: .._subscription_element;;
_-> rrel_2:: rrel_fixed:: rrel_scp_const:: @input_arc;;
.._process
<-_ scp_process;
_-> rrel_1:: rrel_in:: _event;
_-> rrel_2:: rrel_in:: _input_arc;
<=_ nrel_decomposition_of_action:: _...
(*
_-> rrel_1:: .._operator1
(*
<-_ searchElStr3;;
_-> rrel_1:: rrel_assign:: rrel_scp_var:: .._subscription_element;;
_-> rrel_2:: rrel_fixed:: rrel_scp_const:: _input_arc;;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

loader.loadScsFile(context, TEST_AGENT_FILES_DIR_PATH + "agent1_proc.scs");
loader.loadScsFile(context, TEST_AGENT_FILES_DIR_PATH + "proc_find_all_input.scs");
loader.loadScsFile(context, TEST_AGENT_FILES_DIR_PATH + "sc_agent1.scs");
loader.loadScsFile(context, TEST_AGENT_FILES_DIR_PATH + "agent_program_search_all_outgoing_arcs_with_relations.scs");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
test fails

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests do not work macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.1.0 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants