-
Notifications
You must be signed in to change notification settings - Fork 14
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
Nfa compose #389
Nfa compose #389
Changes from all commits
69c3439
a94d301
cbde761
69b7cd3
3a004db
eafbc4f
3911a35
7d4fc8c
361fa5b
0bf29dd
c1b7c0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,19 +91,21 @@ Simlib::Util::BinaryRelation compute_relation( | |
const ParameterMap& params = {{ "relation", "simulation"}, { "direction", "forward"}}); | ||
|
||
/** | ||
* @brief Compute product of two NFTs, final condition is to be specified, with a possibility of using multiple epsilons. | ||
* @brief Compute product of two NFTs, final condition is to be specified. | ||
* | ||
* @param[in] lhs First NFT to compute intersection for. | ||
* @param[in] rhs Second NFT to compute intersection for. | ||
* @param[in] first_epsilons The smallest epsilon. | ||
* @param[in] final_condition The predicate that tells whether a pair of states is final (conjunction for intersection). | ||
* @param[out] prod_map Can be used to get the mapping of the pairs of the original states to product states. | ||
* Mostly useless, it is only filled in and returned if !=nullptr, but the algorithm internally uses another data structures, | ||
* because this one is too slow. | ||
* @return NFT as a product of NFTs @p lhs and @p rhs with ε-transitions preserved. | ||
* @param[in] lhs_first_aux_state The first auxiliary state in @p lhs. Two auxiliary states can not form a product state. | ||
* @param[in] rhs_first_aux_state The first auxiliary state in @p rhs. Two auxiliary states con not form a product state. | ||
* @return NFT as a product of NFTs @p lhs and @p rhs with ε handled as regular symbols. | ||
Comment on lines
+102
to
+104
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would explain here what are these auxiliary states for. |
||
*/ | ||
Nft product(const Nft& lhs, const Nft& rhs, const std::function<bool(State,State)> && final_condition, | ||
const Symbol first_epsilon = EPSILON, std::unordered_map<std::pair<State,State>, State> *prod_map = nullptr); | ||
std::unordered_map<std::pair<State,State>, State> *prod_map = nullptr, | ||
const State lhs_first_aux_state = Limits::max_state, const State rhs_first_aux_state = Limits::max_state); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are the states used anywhere in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, these states are not used in Delta if they are not already a part of it. Essentially, it prevents two states from Delta, which are greater than the specified auxiliary state (implying that these states are auxiliary), from forming a product state. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right. I kind of saw it in the code later on, but I wanted to make sure. |
||
|
||
/** | ||
* @brief Concatenate two NFTs. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future TODO: The target state should be optional and be returned from the function afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, when the target state will not be specified, the method will create a sequence of states from
src
(already existing) totgt
(newly created), wheretgt
does not have any successors and is not a final state. It that correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. And the newly created target will be returned from the function so that the user knows where to continue.