Generated by Cython 3.1.2
Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it.
Raw output: covering_subgraph.cpp
+001: '''
__pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
002: This file is part of Prolothar-Process-Discovery (More Info: https://github.com/shs-it/prolothar-process-discovery).
003:
004: Prolothar-Process-Discovery is free software: you can redistribute it and/or modify
005: it under the terms of the GNU General Public License as published by
006: the Free Software Foundation, either version 3 of the License, or
007: (at your option) any later version.
008:
009: Prolothar-Process-Discovery is distributed in the hope that it will be useful,
010: but WITHOUT ANY WARRANTY; without even the implied warranty of
011: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: GNU General Public License for more details.
013:
014: You should have received a copy of the GNU General Public License
015: along with Prolothar-Process-Discovery. If not, see <https://www.gnu.org/licenses/>.
016: '''
017: """
018: contains logic for covering a subtrace with a SubGraph pattern
019: """
020:
021: from prolothar_common.models.eventlog.trace cimport Trace
022: from prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_pattern cimport CoveringPattern
023: from prolothar_process_discovery.discovery.proseqo.cover cimport Cover
024:
+025: from typing import List
__pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_typing, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_List, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
026:
+027: cdef class CoveringSubGraph(CoveringPattern):
struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph {
struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern __pyx_base;
PyObject *(*_start_covering)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *, PyObject *, PyObject *);
PyObject *(*_CoveringSubGraph__get_set_of_subpattern_names)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *);
PyObject *(*_skip_activities)(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *, PyObject *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_vtabptr_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph;
028:
+029: def __init__(self, object community, object trace, str last_covered_activity):
/* Python wrapper */
static int __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_community = 0;
PyObject *__pyx_v_trace = 0;
PyObject *__pyx_v_last_covered_activity = 0;
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
#endif
__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_community,&__pyx_mstate_global->__pyx_n_u_trace,&__pyx_mstate_global->__pyx_n_u_last_covered_activity,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 29, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 29, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 29, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 29, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 29, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, i); __PYX_ERR(0, 29, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 29, __pyx_L3_error)
values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 29, __pyx_L3_error)
values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 29, __pyx_L3_error)
}
__pyx_v_community = values[0];
__pyx_v_trace = values[1];
__pyx_v_last_covered_activity = ((PyObject*)values[2]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 29, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_covered_activity), (&PyUnicode_Type), 1, "last_covered_activity", 1))) __PYX_ERR(0, 29, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph___init__(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_community, __pyx_v_trace, __pyx_v_last_covered_activity);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = -1;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph___init__(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, PyObject *__pyx_v_community, PyObject *__pyx_v_trace, PyObject *__pyx_v_last_covered_activity) {
int __pyx_r;
/* … */
/* function exit code */
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+030: super().__init__(community, trace, last_covered_activity)
__pyx_t_4 = NULL; __Pyx_INCREF(__pyx_builtin_super); __pyx_t_5 = __pyx_builtin_super; __pyx_t_6 = 1; { PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph), ((PyObject *)__pyx_v_self)}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_community, __pyx_v_trace, __pyx_v_last_covered_activity}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+031: self.current_node = None
__Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->current_node); __Pyx_DECREF(__pyx_v_self->current_node); __pyx_v_self->current_node = Py_None;
+032: self.covering_subpattern = None
__Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF((PyObject *)__pyx_v_self->covering_subpattern); __Pyx_DECREF((PyObject *)__pyx_v_self->covering_subpattern); __pyx_v_self->covering_subpattern = ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)Py_None);
033:
+034: cpdef process_covering_step(self, Cover cover, str last_activity, str next_activity):
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_3process_covering_step(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_process_covering_step(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover, PyObject *__pyx_v_last_activity, PyObject *__pyx_v_next_activity, int __pyx_skip_dispatch) {
PyObject *__pyx_r = NULL;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (
#if !CYTHON_USE_TYPE_SLOTS
unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph &&
__Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
#else
unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
#endif
) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_process_covering_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_3process_covering_step)) {
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_cover), __pyx_v_last_activity, __pyx_v_next_activity};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
__pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
__pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
}
#endif
}
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.process_covering_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_3process_covering_step(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_3process_covering_step = {"process_covering_step", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_3process_covering_step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_3process_covering_step(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover = 0;
PyObject *__pyx_v_last_activity = 0;
PyObject *__pyx_v_next_activity = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("process_covering_step (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cover,&__pyx_mstate_global->__pyx_n_u_last_activity,&__pyx_mstate_global->__pyx_n_u_next_activity,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 34, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 34, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 34, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 34, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "process_covering_step", 0) < 0) __PYX_ERR(0, 34, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("process_covering_step", 1, 3, 3, i); __PYX_ERR(0, 34, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 34, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 34, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 34, __pyx_L3_error)
}
__pyx_v_cover = ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *)values[0]);
__pyx_v_last_activity = ((PyObject*)values[1]);
__pyx_v_next_activity = ((PyObject*)values[2]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("process_covering_step", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 34, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.process_covering_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cover), __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover, 1, "cover", 0))) __PYX_ERR(0, 34, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_activity), (&PyUnicode_Type), 1, "last_activity", 1))) __PYX_ERR(0, 34, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_next_activity), (&PyUnicode_Type), 1, "next_activity", 1))) __PYX_ERR(0, 34, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_2process_covering_step(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_2process_covering_step(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover, PyObject *__pyx_v_last_activity, PyObject *__pyx_v_next_activity) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_process_covering_step(__pyx_v_self, __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.process_covering_step", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_3process_covering_step, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph_process_coverin, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_process_covering_step, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+035: if self.completed_covering:
if (unlikely(__pyx_v_self->__pyx_base.completed_covering)) {
/* … */
}
+036: raise ValueError('covering already completed')
__pyx_t_2 = NULL;
__Pyx_INCREF(__pyx_builtin_ValueError);
__pyx_t_4 = __pyx_builtin_ValueError;
__pyx_t_5 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_covering_already_completed};
__pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__PYX_ERR(0, 36, __pyx_L1_error)
+037: if not self.started_covering:
__pyx_t_6 = (!__pyx_v_self->__pyx_base.started_covering);
if (__pyx_t_6) {
/* … */
goto __pyx_L4;
}
+038: self._start_covering(cover, last_activity, next_activity)
__pyx_t_1 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self->__pyx_base.__pyx_vtab)->_start_covering(__pyx_v_self, __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
039: else:
+040: self._continue_covering(cover, last_activity, next_activity)
/*else*/ {
__pyx_t_4 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_4, ((PyObject *)__pyx_v_cover), __pyx_v_last_activity, __pyx_v_next_activity};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_continue_covering, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L4:;
041:
+042: cdef _start_covering(self, Cover cover, str last_activity, str next_activity):
static PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph__start_covering(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover, PyObject *__pyx_v_last_activity, PyObject *__pyx_v_next_activity) {
PyObject *__pyx_v_shortest_path = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._start_covering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_shortest_path);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+043: self.current_node = self.pattern.find_node_containing_activity(next_activity)
__pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.pattern); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_next_activity}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find_node_containing_activity, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->current_node); __Pyx_DECREF(__pyx_v_self->current_node); __pyx_v_self->current_node = __pyx_t_1; __pyx_t_1 = 0;
+044: if self.current_node is None:
__pyx_t_4 = (__pyx_v_self->current_node == Py_None);
if (__pyx_t_4) {
/* … */
goto __pyx_L3;
}
+045: self.__add_log_move(cover, last_activity, next_activity)
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_2, ((PyObject *)__pyx_v_cover), __pyx_v_last_activity, __pyx_v_next_activity};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_CoveringSubGraph__add_log_move, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
046: else:
+047: shortest_path = self._get_shortest_path_from_sources()
/*else*/ {
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path_from_sources, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_v_shortest_path = __pyx_t_1;
__pyx_t_1 = 0;
+048: if shortest_path:
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_shortest_path); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 48, __pyx_L1_error) if (__pyx_t_4) { /* … */ goto __pyx_L4; }
+049: self._skip_activities(cover, None, shortest_path[1:-1],
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_shortest_path, 1, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_1))) __PYX_ERR(0, 49, __pyx_L1_error) /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self->__pyx_base.__pyx_vtab)->_skip_activities(__pyx_v_self, __pyx_v_cover, ((PyObject*)Py_None), ((PyObject*)__pyx_t_1), __pyx_v_last_activity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* … */ __pyx_mstate_global->__pyx_slice[0] = PySlice_New(__pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_int_neg_1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[0])) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[0]);
050: last_activity)
+051: self._start_covering_current_node(
__pyx_t_1 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_1);
052: cover, last_activity, next_activity,
+053: self.pattern.pattern_dfg.get_following_activities(
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.pattern), __pyx_mstate_global->__pyx_n_u_pattern_dfg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6);
+054: shortest_path[-2]))
__pyx_t_8 = __Pyx_GetItemInt(__pyx_v_shortest_path, -2L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_following_activities, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_3 = 0; { PyObject *__pyx_callargs[5] = {__pyx_t_1, ((PyObject *)__pyx_v_cover), __pyx_v_last_activity, __pyx_v_next_activity, __pyx_t_5}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_start_covering_current_node, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
055: else:
+056: self._start_covering_current_node(
/*else*/ {
__pyx_t_5 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_5);
057: cover,last_activity, next_activity,
+058: self.pattern.get_start_activities())
__pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.pattern);
__Pyx_INCREF(__pyx_t_7);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_start_activities, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[5] = {__pyx_t_5, ((PyObject *)__pyx_v_cover), __pyx_v_last_activity, __pyx_v_next_activity, __pyx_t_1};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_start_covering_current_node, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L4:;
+059: self.started_covering = True
__pyx_v_self->__pyx_base.started_covering = 1; } __pyx_L3:;
060:
+061: def _continue_covering(self, cover, last_activity: str, next_activity: str):
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_5_continue_covering(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_5_continue_covering = {"_continue_covering", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_5_continue_covering, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_5_continue_covering(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_cover = 0;
PyObject *__pyx_v_last_activity = 0;
PyObject *__pyx_v_next_activity = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_continue_covering (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cover,&__pyx_mstate_global->__pyx_n_u_last_activity,&__pyx_mstate_global->__pyx_n_u_next_activity,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 61, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 61, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 61, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 61, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_continue_covering", 0) < 0) __PYX_ERR(0, 61, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_continue_covering", 1, 3, 3, i); __PYX_ERR(0, 61, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 61, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 61, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 61, __pyx_L3_error)
}
__pyx_v_cover = values[0];
__pyx_v_last_activity = ((PyObject*)values[1]);
__pyx_v_next_activity = ((PyObject*)values[2]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_continue_covering", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 61, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._continue_covering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_activity), (&PyUnicode_Type), 0, "last_activity", 2))) __PYX_ERR(0, 61, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_next_activity), (&PyUnicode_Type), 0, "next_activity", 2))) __PYX_ERR(0, 61, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_4_continue_covering(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_4_continue_covering(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, PyObject *__pyx_v_cover, PyObject *__pyx_v_last_activity, PyObject *__pyx_v_next_activity) {
PyObject *__pyx_v_next_node = NULL;
PyObject *__pyx_v_shortest_path = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._continue_covering", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_next_node);
__Pyx_XDECREF(__pyx_v_shortest_path);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_last_activity, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_next_activity, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
__pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_5_continue_covering, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__continue_cover, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_continue_covering, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+062: next_node = self.pattern.find_node_containing_activity(next_activity)
__pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.pattern); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_next_activity}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find_node_containing_activity, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_next_node = __pyx_t_1; __pyx_t_1 = 0;
+063: if next_node is None:
__pyx_t_4 = (__pyx_v_next_node == Py_None);
if (__pyx_t_4) {
/* … */
goto __pyx_L3;
}
+064: self.__add_log_move(cover, last_activity, next_activity)
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_CoveringSubGraph__add_log_move, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+065: elif self.current_node == next_node:
__pyx_t_1 = PyObject_RichCompare(__pyx_v_self->current_node, __pyx_v_next_node, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* … */ goto __pyx_L3; }
+066: if not self.covering_subpattern.completed_covering:
__pyx_t_4 = (!__pyx_v_self->covering_subpattern->completed_covering);
if (__pyx_t_4) {
/* … */
goto __pyx_L4;
}
+067: self.covering_subpattern.process_covering_step(
__pyx_t_1 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_v_self->covering_subpattern->__pyx_vtab)->process_covering_step(__pyx_v_self->covering_subpattern, ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *)__pyx_v_cover), __pyx_v_last_activity, __pyx_v_next_activity, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+068: cover, last_activity, next_activity)
if (!(likely(((__pyx_v_cover) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cover, __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover))))) __PYX_ERR(0, 68, __pyx_L1_error)
069: #elif is selfloop
+070: elif self.current_node.is_followed_by(next_activity):
__pyx_t_2 = __pyx_v_self->current_node;
__Pyx_INCREF(__pyx_t_2);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_next_activity};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_is_followed_by, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 70, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
/* … */
goto __pyx_L4;
}
+071: self._start_covering_current_node(
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
072: cover, last_activity, next_activity,
+073: self.pattern.pattern_dfg.get_following_activities(
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.pattern), __pyx_mstate_global->__pyx_n_u_pattern_dfg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6);
+074: next_node.activity))
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_next_node, __pyx_mstate_global->__pyx_n_u_activity); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_8}; __pyx_t_5 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_following_activities, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_3 = 0; { PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity, __pyx_t_5}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_start_covering_current_node, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
075: else:
+076: self.__add_log_move(cover, last_activity, next_activity)
/*else*/ {
__pyx_t_5 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_5);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_CoveringSubGraph__add_log_move, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L4:;
077: else:
+078: self.covering_subpattern.skip_to_end(cover, self.trace, last_activity)
/*else*/ {
if (!(likely(((__pyx_v_cover) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cover, __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover))))) __PYX_ERR(0, 78, __pyx_L1_error)
__pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx_base.trace);
__Pyx_INCREF(__pyx_t_1);
((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_v_self->covering_subpattern->__pyx_vtab)->skip_to_end(__pyx_v_self->covering_subpattern, ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *)__pyx_v_cover), ((struct __pyx_obj_16prolothar_common_6models_8eventlog_5trace_Trace *)__pyx_t_1), __pyx_v_last_activity, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+079: shortest_path = self._get_shortest_path(
__pyx_t_5 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_5);
+080: self.current_node.activity, next_node.activity)
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_activity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_next_node, __pyx_mstate_global->__pyx_n_u_activity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_7}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_shortest_path = __pyx_t_1; __pyx_t_1 = 0;
+081: if shortest_path:
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_shortest_path); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 81, __pyx_L1_error) if (__pyx_t_4) { /* … */ goto __pyx_L5; }
+082: self._skip_activities(cover, shortest_path[0],
if (!(likely(((__pyx_v_cover) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cover, __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover))))) __PYX_ERR(0, 82, __pyx_L1_error) __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shortest_path, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 82, __pyx_L1_error) /* … */ __pyx_t_2 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self->__pyx_base.__pyx_vtab)->_skip_activities(__pyx_v_self, ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *)__pyx_v_cover), ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_7), __pyx_v_last_activity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+083: shortest_path[1:-1], last_activity)
__pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_shortest_path, 1, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 1, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (!(likely(PyList_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_7))) __PYX_ERR(0, 83, __pyx_L1_error)
+084: self.current_node = next_node
__Pyx_INCREF(__pyx_v_next_node); __Pyx_GIVEREF(__pyx_v_next_node); __Pyx_GOTREF(__pyx_v_self->current_node); __Pyx_DECREF(__pyx_v_self->current_node); __pyx_v_self->current_node = __pyx_v_next_node;
+085: self._start_covering_current_node(
__pyx_t_7 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_7);
086: cover, last_activity, next_activity,
+087: self.pattern.pattern_dfg.get_following_activities(
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.pattern), __pyx_mstate_global->__pyx_n_u_pattern_dfg); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5);
+088: shortest_path[-2]))
__pyx_t_6 = __Pyx_GetItemInt(__pyx_v_shortest_path, -2L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_6}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_following_activities, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_3 = 0; { PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity, __pyx_t_1}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_start_covering_current_node, __pyx_callargs+__pyx_t_3, (5-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
089: else:
+090: self.__add_log_move(cover, last_activity, next_activity)
/*else*/ {
__pyx_t_1 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_1);
__pyx_t_3 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_CoveringSubGraph__add_log_move, __pyx_callargs+__pyx_t_3, (4-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L5:;
}
__pyx_L3:;
091:
+092: def _start_covering_current_node(
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_7_start_covering_current_node(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_7_start_covering_current_node = {"_start_covering_current_node", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_7_start_covering_current_node, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_7_start_covering_current_node(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_cover = 0;
PyObject *__pyx_v_last_activity = 0;
PyObject *__pyx_v_next_activity = 0;
PyObject *__pyx_v_alternatives = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_start_covering_current_node (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cover,&__pyx_mstate_global->__pyx_n_u_last_activity,&__pyx_mstate_global->__pyx_n_u_next_activity,&__pyx_mstate_global->__pyx_n_u_alternatives,0};
PyObject* values[4] = {0,0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 92, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 4:
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 92, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_start_covering_current_node", 0) < 0) __PYX_ERR(0, 92, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_start_covering_current_node", 1, 4, 4, i); __PYX_ERR(0, 92, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 4)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error)
values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 92, __pyx_L3_error)
}
__pyx_v_cover = values[0];
__pyx_v_last_activity = ((PyObject*)values[1]);
__pyx_v_next_activity = ((PyObject*)values[2]);
__pyx_v_alternatives = ((PyObject*)values[3]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_start_covering_current_node", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._start_covering_current_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_activity), (&PyUnicode_Type), 1, "last_activity", 1))) __PYX_ERR(0, 93, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_next_activity), (&PyUnicode_Type), 0, "next_activity", 2))) __PYX_ERR(0, 93, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alternatives), (&PyList_Type), 0, "alternatives", 2))) __PYX_ERR(0, 94, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_6_start_covering_current_node(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_cover, __pyx_v_last_activity, __pyx_v_next_activity, __pyx_v_alternatives);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_6_start_covering_current_node(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, PyObject *__pyx_v_cover, PyObject *__pyx_v_last_activity, PyObject *__pyx_v_next_activity, PyObject *__pyx_v_alternatives) {
PyObject *__pyx_v_e = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._start_covering_current_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_e);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_next_activity, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_alternatives, __pyx_mstate_global->__pyx_kp_u_List_str) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_7_start_covering_current_node, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__start_covering, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_start_covering_current_node, __pyx_t_3) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
093: self, cover, str last_activity, next_activity: str,
094: alternatives: List[str]):
+095: try:
{
/*try:*/ {
/* … */
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L8_try_end;
__pyx_L3_error:;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
/* … */
__pyx_L5_except_error:;
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L8_try_end:;
}
+096: cover.meta_stream.add_routing_code(
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cover, __pyx_mstate_global->__pyx_n_u_meta_stream); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
+097: self.pattern, self.current_node.pattern,
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_pattern); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7);
+098: frozenset(alternatives), last_activity)
__pyx_t_8 = __Pyx_PyFrozenSet_New(__pyx_v_alternatives); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 98, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 0; { PyObject *__pyx_callargs[5] = {__pyx_t_5, ((PyObject *)__pyx_v_self->__pyx_base.pattern), __pyx_t_7, __pyx_t_8, __pyx_v_last_activity}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add_routing_code, __pyx_callargs+__pyx_t_9, (5-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+099: except KeyError as e:
__pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_10) { __Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._start_covering_current_node", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(0, 99, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_4); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /*try:*/ { /* … */ /*finally:*/ { __pyx_L14_error:; /*exception exit:*/{ __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_ExceptionSwap(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20); if ( unlikely(__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0)) __Pyx_ErrFetch(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17); __Pyx_XGOTREF(__pyx_t_15); __Pyx_XGOTREF(__pyx_t_16); __Pyx_XGOTREF(__pyx_t_17); __Pyx_XGOTREF(__pyx_t_18); __Pyx_XGOTREF(__pyx_t_19); __Pyx_XGOTREF(__pyx_t_20); __pyx_t_10 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename; { __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0; } __Pyx_XGIVEREF(__pyx_t_18); __Pyx_XGIVEREF(__pyx_t_19); __Pyx_XGIVEREF(__pyx_t_20); __Pyx_ExceptionReset(__pyx_t_18, __pyx_t_19, __pyx_t_20); __Pyx_XGIVEREF(__pyx_t_15); __Pyx_XGIVEREF(__pyx_t_16); __Pyx_XGIVEREF(__pyx_t_17); __Pyx_ErrRestore(__pyx_t_15, __pyx_t_16, __pyx_t_17); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14; goto __pyx_L5_except_error; } } } goto __pyx_L5_except_error;
+100: print('###################')
__pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_builtin_print);
__pyx_t_11 = __pyx_builtin_print;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_};
__pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+101: self.pattern.pattern_dfg.plot()
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.pattern), __pyx_mstate_global->__pyx_n_u_pattern_dfg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = __pyx_t_5; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_plot, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 101, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_7); } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+102: print(self.current_node.pattern)
__pyx_t_5 = NULL;
__Pyx_INCREF(__pyx_builtin_print);
__pyx_t_11 = __pyx_builtin_print;
__pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_pattern); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 102, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_12};
__pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 102, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+103: print(self.current_node)
__pyx_t_11 = NULL;
__Pyx_INCREF(__pyx_builtin_print);
__pyx_t_12 = __pyx_builtin_print;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_self->current_node};
__pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 103, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+104: print(alternatives)
__pyx_t_12 = NULL;
__Pyx_INCREF(__pyx_builtin_print);
__pyx_t_11 = __pyx_builtin_print;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_alternatives};
__pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+105: print('###################')
__pyx_t_11 = NULL;
__Pyx_INCREF(__pyx_builtin_print);
__pyx_t_12 = __pyx_builtin_print;
__pyx_t_9 = 1;
{
PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_mstate_global->__pyx_kp_u_};
__pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L14_error)
__Pyx_GOTREF(__pyx_t_7);
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+106: raise e
__Pyx_Raise(__pyx_v_e, 0, 0, 0); __PYX_ERR(0, 106, __pyx_L14_error) }
+107: self.covering_subpattern = self.current_node.pattern.for_covering(
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_pattern); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); /* … */ if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern))))) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF((PyObject *)__pyx_v_self->covering_subpattern); __Pyx_DECREF((PyObject *)__pyx_v_self->covering_subpattern); __pyx_v_self->covering_subpattern = ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_t_8); __pyx_t_8 = 0;
+108: self.trace, last_activity)
__pyx_t_9 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self->__pyx_base.trace), __pyx_v_last_activity};
__pyx_t_8 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_for_covering, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
}
+109: self.covering_subpattern.process_covering_step(
__pyx_t_8 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_v_self->covering_subpattern->__pyx_vtab)->process_covering_step(__pyx_v_self->covering_subpattern, ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *)__pyx_v_cover), __pyx_v_last_activity, __pyx_v_next_activity, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+110: cover, last_activity, next_activity)
if (!(likely(((__pyx_v_cover) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_cover, __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover))))) __PYX_ERR(0, 110, __pyx_L1_error)
111:
+112: cdef _skip_activities(self, Cover cover, str preceding_activity,
static PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph__skip_activities(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover, PyObject *__pyx_v_preceding_activity, PyObject *__pyx_v_skip_activities, PyObject *__pyx_v_last_activity) {
PyObject *__pyx_v_activity = NULL;
PyObject *__pyx_v_pattern = NULL;
PyObject *__pyx_v_alternatives = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._skip_activities", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_activity);
__Pyx_XDECREF(__pyx_v_pattern);
__Pyx_XDECREF(__pyx_v_alternatives);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
113: list skip_activities, str last_activity):
+114: self._skip_preceding_activity = preceding_activity
__Pyx_INCREF(__pyx_v_preceding_activity); __Pyx_GIVEREF(__pyx_v_preceding_activity); __Pyx_GOTREF(__pyx_v_self->_skip_preceding_activity); __Pyx_DECREF(__pyx_v_self->_skip_preceding_activity); __pyx_v_self->_skip_preceding_activity = __pyx_v_preceding_activity;
+115: for activity in skip_activities:
if (unlikely(__pyx_v_skip_activities == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 115, __pyx_L1_error)
}
__pyx_t_1 = __pyx_v_skip_activities; __Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 115, __pyx_L1_error)
#endif
if (__pyx_t_2 >= __pyx_temp) break;
}
__pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
++__pyx_t_2;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_activity, __pyx_t_3);
__pyx_t_3 = 0;
/* … */
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+116: pattern = self.pattern.pattern_dfg.nodes[activity].pattern
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.pattern), __pyx_mstate_global->__pyx_n_u_pattern_dfg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_activity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_pattern); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_4); __pyx_t_4 = 0;
+117: if self._skip_preceding_activity:
__pyx_t_5 = (__pyx_v_self->_skip_preceding_activity != Py_None)&&(__Pyx_PyUnicode_IS_TRUE(__pyx_v_self->_skip_preceding_activity) != 0); if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_5 < 0))) __PYX_ERR(0, 117, __pyx_L1_error) if (__pyx_t_5) { /* … */ goto __pyx_L5; }
+118: alternatives = set(
__pyx_t_6 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_alternatives, ((PyObject*)__pyx_t_6)); __pyx_t_6 = 0;
+119: self.pattern.pattern_dfg.get_following_activities(
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->__pyx_base.pattern), __pyx_mstate_global->__pyx_n_u_pattern_dfg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3);
+120: self._skip_preceding_activity))
__pyx_t_7 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self->_skip_preceding_activity};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_following_activities, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
121: else:
+122: alternatives = set(self.pattern.get_start_activities())
/*else*/ {
__pyx_t_4 = ((PyObject *)__pyx_v_self->__pyx_base.pattern);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_7 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
__pyx_t_6 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_start_activities, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
}
__pyx_t_4 = PySet_New(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_alternatives, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
}
__pyx_L5:;
+123: alternatives.add(pattern.get_activity_name())
__pyx_t_6 = __pyx_v_pattern;
__Pyx_INCREF(__pyx_t_6);
__pyx_t_7 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_activity_name, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_8 = PySet_Add(__pyx_v_alternatives, __pyx_t_4); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+124: cover.meta_stream.add_routing_code(
__pyx_t_3 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11meta_stream_MetaStream *)__pyx_v_cover->meta_stream->__pyx_vtab)->add_routing_code(__pyx_v_cover->meta_stream, ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_t_4), ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_v_pattern), ((PyObject*)__pyx_t_6), __pyx_v_last_activity, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+125: self.pattern, pattern,
__pyx_t_4 = ((PyObject *)__pyx_v_self->__pyx_base.pattern);
__Pyx_INCREF(__pyx_t_4);
if (!(likely(((__pyx_v_pattern) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_pattern, __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern))))) __PYX_ERR(0, 125, __pyx_L1_error)
+126: frozenset(alternatives), last_activity)
__pyx_t_6 = __Pyx_PyFrozenSet_New(__pyx_v_alternatives); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6);
+127: pattern.for_covering(
__pyx_t_9 = __pyx_v_pattern;
__Pyx_INCREF(__pyx_t_9);
+128: self.trace, last_activity).skip_to_end(
__pyx_t_7 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_9, ((PyObject *)__pyx_v_self->__pyx_base.trace), __pyx_v_last_activity};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_for_covering, __pyx_callargs+__pyx_t_7, (3-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_t_6 = __pyx_t_4;
__Pyx_INCREF(__pyx_t_6);
+129: cover, self.trace, last_activity)
__pyx_t_7 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_6, ((PyObject *)__pyx_v_cover), ((PyObject *)__pyx_v_self->__pyx_base.trace), __pyx_v_last_activity};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_skip_to_end, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+130: self._skip_preceding_activity = activity
__pyx_t_3 = __pyx_v_activity;
__Pyx_INCREF(__pyx_t_3);
if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_3))) __PYX_ERR(0, 130, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->_skip_preceding_activity);
__Pyx_DECREF(__pyx_v_self->_skip_preceding_activity);
__pyx_v_self->_skip_preceding_activity = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
+131: self._skip_preceding_activity = None
__Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_skip_preceding_activity); __Pyx_DECREF(__pyx_v_self->_skip_preceding_activity); __pyx_v_self->_skip_preceding_activity = ((PyObject*)Py_None);
132:
+133: def _get_shortest_path_from_sources(self):
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_9_get_shortest_path_from_sources(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_9_get_shortest_path_from_sources = {"_get_shortest_path_from_sources", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_9_get_shortest_path_from_sources, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_9_get_shortest_path_from_sources(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_get_shortest_path_from_sources (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_shortest_path_from_sources", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_shortest_path_from_sources", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_8_get_shortest_path_from_sources(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_8_get_shortest_path_from_sources(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self) {
PyObject *__pyx_v_shortest_shortest_path = NULL;
double __pyx_v_len_of_shortest_shortest_path;
PyObject *__pyx_v_start_activity = NULL;
PyObject *__pyx_v_shortest_path = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._get_shortest_path_from_sources", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_shortest_shortest_path);
__Pyx_XDECREF(__pyx_v_start_activity);
__Pyx_XDECREF(__pyx_v_shortest_path);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_9_get_shortest_path_from_sources, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__get_shortest_p, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_get_shortest_path_from_sources, __pyx_t_3) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+134: shortest_shortest_path = None
__Pyx_INCREF(Py_None);
__pyx_v_shortest_shortest_path = Py_None;
+135: len_of_shortest_shortest_path = float('inf')
__pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_mstate_global->__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error) __pyx_v_len_of_shortest_shortest_path = __pyx_t_1;
+136: for start_activity in self.pattern.get_start_activities():
__pyx_t_3 = ((PyObject *)__pyx_v_self->__pyx_base.pattern); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_start_activities, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 136, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif ++__pyx_t_5; } if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 136, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_start_activity, __pyx_t_2); __pyx_t_2 = 0; /* … */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+137: shortest_path = self._get_shortest_path(
__pyx_t_7 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_7);
+138: start_activity, self.current_node.activity)
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_activity); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_start_activity, __pyx_t_8}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_shortest_path, __pyx_t_2); __pyx_t_2 = 0;
+139: if shortest_path and len(shortest_path) < len_of_shortest_shortest_path:
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_shortest_path); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 139, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L6_bool_binop_done; } __pyx_t_11 = PyObject_Length(__pyx_v_shortest_path); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_t_10 = (__pyx_t_11 < __pyx_v_len_of_shortest_shortest_path); __pyx_t_9 = __pyx_t_10; __pyx_L6_bool_binop_done:; if (__pyx_t_9) { /* … */ }
+140: shortest_shortest_path = shortest_path
__Pyx_INCREF(__pyx_v_shortest_path); __Pyx_DECREF_SET(__pyx_v_shortest_shortest_path, __pyx_v_shortest_path);
+141: len_of_shortest_shortest_path = len(shortest_path)
__pyx_t_11 = PyObject_Length(__pyx_v_shortest_path); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_v_len_of_shortest_shortest_path = __pyx_t_11;
+142: return shortest_shortest_path
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_shortest_shortest_path); __pyx_r = __pyx_v_shortest_shortest_path; goto __pyx_L0;
143:
+144: def _get_shortest_path_from_sources_to_sinks(self):
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_11_get_shortest_path_from_sources_to_sinks(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_11_get_shortest_path_from_sources_to_sinks = {"_get_shortest_path_from_sources_to_sinks", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_11_get_shortest_path_from_sources_to_sinks, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_11_get_shortest_path_from_sources_to_sinks(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_get_shortest_path_from_sources_to_sinks (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_shortest_path_from_sources_to_sinks", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_shortest_path_from_sources_to_sinks", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_10_get_shortest_path_from_sources_to_sinks(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_10_get_shortest_path_from_sources_to_sinks(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self) {
PyObject *__pyx_v_shortest_shortest_path = NULL;
double __pyx_v_len_of_shortest_shortest_path;
PyObject *__pyx_v_start_activity = NULL;
PyObject *__pyx_v_end_activity = NULL;
PyObject *__pyx_v_shortest_path = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._get_shortest_path_from_sources_to_sinks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_shortest_shortest_path);
__Pyx_XDECREF(__pyx_v_start_activity);
__Pyx_XDECREF(__pyx_v_end_activity);
__Pyx_XDECREF(__pyx_v_shortest_path);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_11_get_shortest_path_from_sources_to_sinks, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__get_shortest_p_2, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_get_shortest_path_from_sources_2, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+145: shortest_shortest_path = None
__Pyx_INCREF(Py_None);
__pyx_v_shortest_shortest_path = Py_None;
+146: len_of_shortest_shortest_path = float('inf')
__pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_mstate_global->__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error) __pyx_v_len_of_shortest_shortest_path = __pyx_t_1;
+147: for start_activity in self.pattern.get_start_activities():
__pyx_t_3 = ((PyObject *)__pyx_v_self->__pyx_base.pattern); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_start_activities, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 147, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 147, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif ++__pyx_t_5; } if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 147, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_start_activity, __pyx_t_2); __pyx_t_2 = 0; /* … */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+148: for end_activity in self.pattern.get_end_activities():
__pyx_t_7 = ((PyObject *)__pyx_v_self->__pyx_base.pattern);
__Pyx_INCREF(__pyx_t_7);
__pyx_t_4 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_end_activities, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
__pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7);
__pyx_t_8 = 0;
__pyx_t_9 = NULL;
} else {
__pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
for (;;) {
if (likely(!__pyx_t_9)) {
if (likely(PyList_CheckExact(__pyx_t_7))) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 148, __pyx_L1_error)
#endif
if (__pyx_t_8 >= __pyx_temp) break;
}
__pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_7, __pyx_t_8);
++__pyx_t_8;
} else {
{
Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 148, __pyx_L1_error)
#endif
if (__pyx_t_8 >= __pyx_temp) break;
}
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8));
#else
__pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8);
#endif
++__pyx_t_8;
}
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
} else {
__pyx_t_2 = __pyx_t_9(__pyx_t_7);
if (unlikely(!__pyx_t_2)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 148, __pyx_L1_error)
PyErr_Clear();
}
break;
}
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_end_activity, __pyx_t_2);
__pyx_t_2 = 0;
/* … */
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+149: shortest_path = self._get_shortest_path(start_activity,
__pyx_t_10 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_10);
+150: end_activity)
__pyx_t_4 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_v_start_activity, __pyx_v_end_activity};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__Pyx_XDECREF_SET(__pyx_v_shortest_path, __pyx_t_2);
__pyx_t_2 = 0;
+151: if shortest_path and len(shortest_path) < len_of_shortest_shortest_path:
__pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_shortest_path); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 151, __pyx_L1_error) if (__pyx_t_12) { } else { __pyx_t_11 = __pyx_t_12; goto __pyx_L8_bool_binop_done; } __pyx_t_13 = PyObject_Length(__pyx_v_shortest_path); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 151, __pyx_L1_error) __pyx_t_12 = (__pyx_t_13 < __pyx_v_len_of_shortest_shortest_path); __pyx_t_11 = __pyx_t_12; __pyx_L8_bool_binop_done:; if (__pyx_t_11) { /* … */ }
+152: shortest_shortest_path = shortest_path
__Pyx_INCREF(__pyx_v_shortest_path); __Pyx_DECREF_SET(__pyx_v_shortest_shortest_path, __pyx_v_shortest_path);
+153: len_of_shortest_shortest_path = len(shortest_path)
__pyx_t_13 = PyObject_Length(__pyx_v_shortest_path); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 153, __pyx_L1_error) __pyx_v_len_of_shortest_shortest_path = __pyx_t_13;
+154: return shortest_shortest_path
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_shortest_shortest_path); __pyx_r = __pyx_v_shortest_shortest_path; goto __pyx_L0;
155:
+156: cpdef int skip_to_end(self, Cover cover, Trace trace, str last_covered_activity):
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_13skip_to_end(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_skip_to_end(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover, struct __pyx_obj_16prolothar_common_6models_8eventlog_5trace_Trace *__pyx_v_trace, PyObject *__pyx_v_last_covered_activity, int __pyx_skip_dispatch) {
int __pyx_v_number_of_skipped_activities;
PyObject *__pyx_v_shortest_path_to_sink = NULL;
int __pyx_r;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (
#if !CYTHON_USE_TYPE_SLOTS
unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph &&
__Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
#else
unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
#endif
) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_skip_to_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_13skip_to_end)) {
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_cover), ((PyObject *)__pyx_v_trace), __pyx_v_last_covered_activity};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_6 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
__pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
__pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
}
#endif
}
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.skip_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_shortest_path_to_sink);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_13skip_to_end(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_13skip_to_end = {"skip_to_end", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_13skip_to_end, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_13skip_to_end(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover = 0;
struct __pyx_obj_16prolothar_common_6models_8eventlog_5trace_Trace *__pyx_v_trace = 0;
PyObject *__pyx_v_last_covered_activity = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("skip_to_end (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cover,&__pyx_mstate_global->__pyx_n_u_trace,&__pyx_mstate_global->__pyx_n_u_last_covered_activity,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 156, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 156, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 156, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 156, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "skip_to_end", 0) < 0) __PYX_ERR(0, 156, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("skip_to_end", 1, 3, 3, i); __PYX_ERR(0, 156, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 156, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 156, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 156, __pyx_L3_error)
}
__pyx_v_cover = ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *)values[0]);
__pyx_v_trace = ((struct __pyx_obj_16prolothar_common_6models_8eventlog_5trace_Trace *)values[1]);
__pyx_v_last_covered_activity = ((PyObject*)values[2]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("skip_to_end", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 156, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.skip_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cover), __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover, 1, "cover", 0))) __PYX_ERR(0, 156, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_trace), __pyx_mstate_global->__pyx_ptype_16prolothar_common_6models_8eventlog_5trace_Trace, 1, "trace", 0))) __PYX_ERR(0, 156, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_covered_activity), (&PyUnicode_Type), 1, "last_covered_activity", 1))) __PYX_ERR(0, 156, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_12skip_to_end(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_cover, __pyx_v_trace, __pyx_v_last_covered_activity);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_12skip_to_end(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_5cover_Cover *__pyx_v_cover, struct __pyx_obj_16prolothar_common_6models_8eventlog_5trace_Trace *__pyx_v_trace, PyObject *__pyx_v_last_covered_activity) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_skip_to_end(__pyx_v_self, __pyx_v_cover, __pyx_v_trace, __pyx_v_last_covered_activity, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyLong_From_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.skip_to_end", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_46_CoveringSubGraph__get_set_of_subpattern_names_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_13skip_to_end, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph_skip_to_end, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_skip_to_end, __pyx_t_3) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+157: cdef int number_of_skipped_activities = 0
__pyx_v_number_of_skipped_activities = 0;
+158: if self.covering_subpattern is not None:
__pyx_t_7 = (((PyObject *)__pyx_v_self->covering_subpattern) != Py_None);
if (__pyx_t_7) {
/* … */
goto __pyx_L3;
}
+159: self.covering_subpattern.skip_to_end(
((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_v_self->covering_subpattern->__pyx_vtab)->skip_to_end(__pyx_v_self->covering_subpattern, __pyx_v_cover, __pyx_v_trace, __pyx_v_last_covered_activity, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
160: cover, trace, last_covered_activity)
161:
+162: if len(self.current_node.edges) > 0:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_8 > 0); if (__pyx_t_7) { /* … */ }
+163: shortest_path_to_sink = self._get_shortest_path_to_sinks()
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path_to_sinks, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_v_shortest_path_to_sink = __pyx_t_1;
__pyx_t_1 = 0;
+164: if shortest_path_to_sink is not None:
__pyx_t_7 = (__pyx_v_shortest_path_to_sink != Py_None);
if (__pyx_t_7) {
/* … */
goto __pyx_L5;
}
+165: number_of_skipped_activities = len(shortest_path_to_sink) - 1
__pyx_t_8 = PyObject_Length(__pyx_v_shortest_path_to_sink); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 165, __pyx_L1_error) __pyx_v_number_of_skipped_activities = (__pyx_t_8 - 1);
+166: self._skip_activities(
__pyx_t_4 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self->__pyx_base.__pyx_vtab)->_skip_activities(__pyx_v_self, __pyx_v_cover, ((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_2), __pyx_v_last_covered_activity); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+167: cover, shortest_path_to_sink[0],
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_shortest_path_to_sink, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("str", __pyx_t_1))) __PYX_ERR(0, 167, __pyx_L1_error)
+168: shortest_path_to_sink[1:],
__pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_shortest_path_to_sink, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_t_2))) __PYX_ERR(0, 168, __pyx_L1_error) /* … */ __pyx_mstate_global->__pyx_slice[1] = PySlice_New(__pyx_mstate_global->__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_slice[1])) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_slice[1]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_slice[1]);
169: last_covered_activity)
170: else:
171: #TODO: this can only happen in rare cases. how to deal with it?
+172: pass
/*else*/ {
}
__pyx_L5:;
173: else:
+174: shortest_path_to_sink = self._get_shortest_path_from_sources_to_sinks()
/*else*/ {
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
__pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path_from_sources_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
}
__pyx_v_shortest_path_to_sink = __pyx_t_4;
__pyx_t_4 = 0;
+175: if shortest_path_to_sink is None:
__pyx_t_7 = (__pyx_v_shortest_path_to_sink == Py_None);
if (__pyx_t_7) {
/* … */
goto __pyx_L6;
}
+176: cover.meta_stream.add_routing_code(
__pyx_t_1 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_13cover_streams_11meta_stream_MetaStream *)__pyx_v_cover->meta_stream->__pyx_vtab)->add_routing_code(__pyx_v_cover->meta_stream, ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_t_4), ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_t_2), ((PyObject*)__pyx_t_9), __pyx_v_last_covered_activity, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+177: self.pattern, self.pattern.get_subpatterns()[0].get_activity_name(),
__pyx_t_4 = ((PyObject *)__pyx_v_self->__pyx_base.pattern);
__Pyx_INCREF(__pyx_t_4);
__pyx_t_3 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_v_self->__pyx_base.pattern->__pyx_vtab)->get_subpatterns(__pyx_v_self->__pyx_base.pattern, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (unlikely(__pyx_t_3 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
__PYX_ERR(0, 177, __pyx_L1_error)
}
__pyx_t_9 = __Pyx_GetItemInt_List(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_1 = __pyx_t_9;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_activity_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern))))) __PYX_ERR(0, 177, __pyx_L1_error)
+178: self.__get_set_of_subpattern_names(),
__pyx_t_9 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self->__pyx_base.__pyx_vtab)->_CoveringSubGraph__get_set_of_subpattern_names(__pyx_v_self); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 178, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9);
179: last_covered_activity)
+180: self.pattern.get_subpatterns()[0].for_covering(
__pyx_t_3 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_v_self->__pyx_base.pattern->__pyx_vtab)->get_subpatterns(__pyx_v_self->__pyx_base.pattern, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (unlikely(__pyx_t_3 == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 180, __pyx_L1_error) } __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_t_3, 0, long, 1, __Pyx_PyLong_From_long, 1, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4);
+181: self.trace, last_covered_activity).skip_to_end(
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self->__pyx_base.trace), __pyx_v_last_covered_activity};
__pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_for_covering, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_9 = __pyx_t_2;
__Pyx_INCREF(__pyx_t_9);
+182: cover, self.trace, last_covered_activity)
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[4] = {__pyx_t_9, ((PyObject *)__pyx_v_cover), ((PyObject *)__pyx_v_self->__pyx_base.trace), __pyx_v_last_covered_activity};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_skip_to_end, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
183: else:
+184: number_of_skipped_activities = len(shortest_path_to_sink)
/*else*/ {
__pyx_t_8 = PyObject_Length(__pyx_v_shortest_path_to_sink); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 184, __pyx_L1_error)
__pyx_v_number_of_skipped_activities = __pyx_t_8;
+185: self._skip_activities(cover, None, shortest_path_to_sink,
if (!(likely(PyList_CheckExact(__pyx_v_shortest_path_to_sink))||((__pyx_v_shortest_path_to_sink) == Py_None) || __Pyx_RaiseUnexpectedTypeError("list", __pyx_v_shortest_path_to_sink))) __PYX_ERR(0, 185, __pyx_L1_error) /* … */ __pyx_t_1 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self->__pyx_base.__pyx_vtab)->_skip_activities(__pyx_v_self, __pyx_v_cover, ((PyObject*)Py_None), ((PyObject*)__pyx_v_shortest_path_to_sink), __pyx_v_last_covered_activity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L6:; } __pyx_L3:;
186: last_covered_activity)
187:
+188: self.completed_covering = True
__pyx_v_self->__pyx_base.completed_covering = 1;
+189: return number_of_skipped_activities
__pyx_r = __pyx_v_number_of_skipped_activities; goto __pyx_L0;
190:
+191: cdef frozenset __get_set_of_subpattern_names(self):
static PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph__CoveringSubGraph__get_set_of_subpattern_names(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self) {
PyObject *__pyx_gb_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_46_CoveringSubGraph__get_set_of_subpattern_names_2generator = 0;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._CoveringSubGraph__get_set_of_subpattern_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_gb_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_46_CoveringSubGraph__get_set_of_subpattern_names_2generator);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+192: return frozenset(p.get_activity_name() for p in self.pattern.get_subpatterns())
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_46_CoveringSubGraph__get_set_of_subpattern_names_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) {
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph___pyx_scope_struct__genexpr *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__pyx_cur_scope = (struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph___pyx_scope_struct__genexpr *)__pyx_tp_new_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph___pyx_scope_struct__genexpr(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph___pyx_scope_struct__genexpr, __pyx_mstate_global->__pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__pyx_cur_scope = ((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph___pyx_scope_struct__genexpr *)Py_None);
__Pyx_INCREF(Py_None);
__PYX_ERR(0, 192, __pyx_L1_error)
} else {
__Pyx_GOTREF((PyObject *)__pyx_cur_scope);
}
__pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0;
__Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0);
{
__pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_46_CoveringSubGraph__get_set_of_subpattern_names_2generator, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0]), (PyObject *) __pyx_cur_scope, __pyx_mstate_global->__pyx_n_u_genexpr, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__CoveringSubGra, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc); if (unlikely(!gen)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
}
/* function exit code */
__pyx_L1_error:;
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._CoveringSubGraph__get_set_of_subpattern_names.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_DECREF((PyObject *)__pyx_cur_scope);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_46_CoveringSubGraph__get_set_of_subpattern_names_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("genexpr", 0);
__pyx_L3_first_run:;
if (unlikely(__pyx_sent_value != Py_None)) {
if (unlikely(__pyx_sent_value)) PyErr_SetString(PyExc_TypeError, "can't send non-None value to a just-started generator");
__PYX_ERR(0, 192, __pyx_L1_error)
}
if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 192, __pyx_L1_error) }
if (unlikely(__pyx_cur_scope->__pyx_genexpr_arg_0 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
__PYX_ERR(0, 192, __pyx_L1_error)
}
__pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1);
__pyx_t_2 = 0;
for (;;) {
{
Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
#if !CYTHON_ASSUME_SAFE_SIZE
if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 192, __pyx_L1_error)
#endif
if (__pyx_t_2 >= __pyx_temp) break;
}
__pyx_t_3 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
++__pyx_t_2;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_p);
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
__pyx_t_4 = __pyx_cur_scope->__pyx_v_p;
__Pyx_INCREF(__pyx_t_4);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
__pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_activity_name, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
}
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
__Pyx_XGIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
__pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
__Pyx_Coroutine_ResetAndClearException(__pyx_generator);
/* return from generator, yielding value */
__pyx_generator->resume_label = 1;
return __pyx_r;
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_cur_scope->__pyx_t_0 = 0;
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 192, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
if (__Pyx_PyErr_Occurred()) {
__Pyx_Generator_Replace_StopIteration(0);
__Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
#if !CYTHON_USE_EXC_INFO_STACK
__Pyx_Coroutine_ResetAndClearException(__pyx_generator);
#endif
__pyx_generator->resume_label = -1;
__Pyx_Coroutine_clear((PyObject*)__pyx_generator);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_v_self->__pyx_base.pattern->__pyx_vtab)->get_subpatterns(__pyx_v_self->__pyx_base.pattern, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_46_CoveringSubGraph__get_set_of_subpattern_names_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = __Pyx_PyFrozenSet_New(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
goto __pyx_L0;
/* … */
struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph___pyx_scope_struct__genexpr {
PyObject_HEAD
PyObject *__pyx_genexpr_arg_0;
PyObject *__pyx_v_p;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
};
193:
+194: def _get_shortest_path_to_sinks(self):
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_15_get_shortest_path_to_sinks(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_15_get_shortest_path_to_sinks = {"_get_shortest_path_to_sinks", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_15_get_shortest_path_to_sinks, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_15_get_shortest_path_to_sinks(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_get_shortest_path_to_sinks (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_get_shortest_path_to_sinks", 1, 0, 0, __pyx_nargs); return NULL; }
const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len < 0)) return NULL;
if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_get_shortest_path_to_sinks", __pyx_kwds); return NULL;}
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_14_get_shortest_path_to_sinks(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_14_get_shortest_path_to_sinks(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self) {
PyObject *__pyx_v_shortest_shortest_path = NULL;
double __pyx_v_len_of_shortest_shortest_path;
PyObject *__pyx_v_end_activity = NULL;
PyObject *__pyx_v_shortest_path = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._get_shortest_path_to_sinks", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_shortest_shortest_path);
__Pyx_XDECREF(__pyx_v_end_activity);
__Pyx_XDECREF(__pyx_v_shortest_path);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_15_get_shortest_path_to_sinks, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__get_shortest_p_3, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_get_shortest_path_to_sinks, __pyx_t_3) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+195: shortest_shortest_path = None
__Pyx_INCREF(Py_None);
__pyx_v_shortest_shortest_path = Py_None;
+196: len_of_shortest_shortest_path = float('inf')
__pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_mstate_global->__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L1_error) __pyx_v_len_of_shortest_shortest_path = __pyx_t_1;
+197: for end_activity in self.pattern.get_end_activities():
__pyx_t_3 = ((PyObject *)__pyx_v_self->__pyx_base.pattern); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_end_activities, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_3))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 197, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } __pyx_t_2 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_5); ++__pyx_t_5; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 197, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5)); #else __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); #endif ++__pyx_t_5; } if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error) } else { __pyx_t_2 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 197, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_end_activity, __pyx_t_2); __pyx_t_2 = 0; /* … */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+198: shortest_path = self._get_shortest_path(
__pyx_t_7 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_7);
+199: self.current_node.activity, end_activity)
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_activity); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_v_end_activity}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_shortest_path, __pyx_t_2); __pyx_t_2 = 0;
+200: if shortest_path and len(shortest_path) < len_of_shortest_shortest_path:
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_shortest_path); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) if (__pyx_t_10) { } else { __pyx_t_9 = __pyx_t_10; goto __pyx_L6_bool_binop_done; } __pyx_t_11 = PyObject_Length(__pyx_v_shortest_path); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_t_10 = (__pyx_t_11 < __pyx_v_len_of_shortest_shortest_path); __pyx_t_9 = __pyx_t_10; __pyx_L6_bool_binop_done:; if (__pyx_t_9) { /* … */ }
+201: shortest_shortest_path = shortest_path
__Pyx_INCREF(__pyx_v_shortest_path); __Pyx_DECREF_SET(__pyx_v_shortest_shortest_path, __pyx_v_shortest_path);
+202: len_of_shortest_shortest_path = len(shortest_path)
__pyx_t_11 = PyObject_Length(__pyx_v_shortest_path); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 202, __pyx_L1_error) __pyx_v_len_of_shortest_shortest_path = __pyx_t_11;
+203: return shortest_shortest_path
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_shortest_shortest_path); __pyx_r = __pyx_v_shortest_shortest_path; goto __pyx_L0;
204:
+205: def _get_shortest_path(self, start: str, end: str):
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_17_get_shortest_path(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_17_get_shortest_path = {"_get_shortest_path", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_17_get_shortest_path, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_17_get_shortest_path(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_start = 0;
PyObject *__pyx_v_end = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_get_shortest_path (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_start,&__pyx_mstate_global->__pyx_n_u_end,0};
PyObject* values[2] = {0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 205, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 205, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 205, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_get_shortest_path", 0) < 0) __PYX_ERR(0, 205, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_get_shortest_path", 1, 2, 2, i); __PYX_ERR(0, 205, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 2)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 205, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 205, __pyx_L3_error)
}
__pyx_v_start = ((PyObject*)values[0]);
__pyx_v_end = ((PyObject*)values[1]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_get_shortest_path", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 205, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._get_shortest_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_start), (&PyUnicode_Type), 0, "start", 2))) __PYX_ERR(0, 205, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_end), (&PyUnicode_Type), 0, "end", 2))) __PYX_ERR(0, 205, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_16_get_shortest_path(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_start, __pyx_v_end);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_16_get_shortest_path(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_end) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._get_shortest_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_start, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_end, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
__pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_17_get_shortest_path, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__get_shortest_p_4, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_get_shortest_path, __pyx_t_2) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+206: return self.pattern.compute_shortest_path(start, end)
__Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.pattern); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_start, __pyx_v_end}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_compute_shortest_path, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0;
207:
+208: cdef set _get_next_coverable_activities(self):
static PyObject *__pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph__get_next_coverable_activities(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self) {
PyObject *__pyx_v_coverable_activities = NULL;
PyObject *__pyx_v_edge = NULL;
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._get_next_coverable_activities", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_coverable_activities);
__Pyx_XDECREF(__pyx_v_edge);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+209: if self.covering_subpattern.completed_covering:
if (__pyx_v_self->covering_subpattern->completed_covering) {
/* … */
}
+210: coverable_activities = set()
__pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_coverable_activities = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0;
+211: for edge in self.current_node.edges:
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 211, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3); ++__pyx_t_3; } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 211, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3)); #else __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); #endif ++__pyx_t_3; } if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 211, __pyx_L1_error) PyErr_Clear(); } break; } } __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_1); __pyx_t_1 = 0; /* … */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+212: coverable_activities.update(edge.end.pattern.start_activities())
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_edge, __pyx_mstate_global->__pyx_n_u_end); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_pattern); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_start_activities, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_7 = __Pyx_CallUnboundCMethod1(&__pyx_mstate_global->__pyx_umethod_PySet_Type__update, __pyx_v_coverable_activities, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+213: return coverable_activities
__Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_coverable_activities); __pyx_r = __pyx_v_coverable_activities; goto __pyx_L0;
214: else:
+215: return self.covering_subpattern.get_next_coverable_activities()
/*else*/ {
__Pyx_XDECREF(__pyx_r);
__pyx_t_2 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_v_self->covering_subpattern->__pyx_vtab)->get_next_coverable_activities(__pyx_v_self->covering_subpattern, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L0;
}
216:
+217: def __add_log_move(self, cover, last_activity: str, activity: str):
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_19_CoveringSubGraph__add_log_move(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_19_CoveringSubGraph__add_log_move = {"_CoveringSubGraph__add_log_move", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_19_CoveringSubGraph__add_log_move, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_19_CoveringSubGraph__add_log_move(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_cover = 0;
PyObject *__pyx_v_last_activity = 0;
PyObject *__pyx_v_activity = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_CoveringSubGraph__add_log_move (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cover,&__pyx_mstate_global->__pyx_n_u_last_activity,&__pyx_mstate_global->__pyx_n_u_activity,0};
PyObject* values[3] = {0,0,0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 217, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 3:
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 217, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 2:
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 217, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 217, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_CoveringSubGraph__add_log_move", 0) < 0) __PYX_ERR(0, 217, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_CoveringSubGraph__add_log_move", 1, 3, 3, i); __PYX_ERR(0, 217, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 3)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 217, __pyx_L3_error)
values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 217, __pyx_L3_error)
values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 217, __pyx_L3_error)
}
__pyx_v_cover = values[0];
__pyx_v_last_activity = ((PyObject*)values[1]);
__pyx_v_activity = ((PyObject*)values[2]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("_CoveringSubGraph__add_log_move", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 217, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._CoveringSubGraph__add_log_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_last_activity), (&PyUnicode_Type), 0, "last_activity", 2))) __PYX_ERR(0, 217, __pyx_L1_error)
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_activity), (&PyUnicode_Type), 0, "activity", 2))) __PYX_ERR(0, 217, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_18__add_log_move(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_cover, __pyx_v_last_activity, __pyx_v_activity);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_18__add_log_move(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, PyObject *__pyx_v_cover, PyObject *__pyx_v_last_activity, PyObject *__pyx_v_activity) {
PyObject *__pyx_r = NULL;
/* … */
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph._CoveringSubGraph__add_log_move", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_last_activity, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
if (PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_activity, __pyx_mstate_global->__pyx_n_u_str) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_19_CoveringSubGraph__add_log_move, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph___add_log_move, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph__add_log_move, __pyx_t_3) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+218: cover.add_log_move(last_activity, activity,
__pyx_t_2 = __pyx_v_cover;
__Pyx_INCREF(__pyx_t_2);
+219: self.get_next_coverable_activities())
__pyx_t_3 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.get_next_coverable_activities(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_v_self), 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = 0; { PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_last_activity, __pyx_v_activity, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_add_log_move, __pyx_callargs+__pyx_t_4, (4-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
220:
+221: cpdef bint can_cover(self, str activity):
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_21can_cover(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int __pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_can_cover(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, PyObject *__pyx_v_activity, int __pyx_skip_dispatch) {
PyObject *__pyx_v_next_node = NULL;
int __pyx_r;
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overridden in Python */
else if (
#if !CYTHON_USE_TYPE_SLOTS
unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph &&
__Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
#else
unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
#endif
) {
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
#endif
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_can_cover); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_21can_cover)) {
__pyx_t_3 = NULL;
__Pyx_INCREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__pyx_t_5 = 1;
#if CYTHON_UNPACK_METHODS
if (unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
assert(__pyx_t_3);
PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx__function);
__Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
__pyx_t_5 = 0;
}
#endif
{
PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_activity};
__pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
}
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L0;
}
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
__pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
__pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
}
#endif
}
/* … */
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.can_cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_next_node);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_21can_cover(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_21can_cover = {"can_cover", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_21can_cover, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_21can_cover(PyObject *__pyx_v_self,
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
PyObject *__pyx_v_activity = 0;
#if !CYTHON_METH_FASTCALL
CYTHON_UNUSED Py_ssize_t __pyx_nargs;
#endif
CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("can_cover (wrapper)", 0);
#if !CYTHON_METH_FASTCALL
#if CYTHON_ASSUME_SAFE_SIZE
__pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
#else
__pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
#endif
#endif
__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
{
PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_activity,0};
PyObject* values[1] = {0};
const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 221, __pyx_L3_error)
if (__pyx_kwds_len > 0) {
switch (__pyx_nargs) {
case 1:
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 221, __pyx_L3_error)
CYTHON_FALLTHROUGH;
case 0: break;
default: goto __pyx_L5_argtuple_error;
}
const Py_ssize_t kwd_pos_args = __pyx_nargs;
if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "can_cover", 0) < 0) __PYX_ERR(0, 221, __pyx_L3_error)
for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("can_cover", 1, 1, 1, i); __PYX_ERR(0, 221, __pyx_L3_error) }
}
} else if (unlikely(__pyx_nargs != 1)) {
goto __pyx_L5_argtuple_error;
} else {
values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 221, __pyx_L3_error)
}
__pyx_v_activity = ((PyObject*)values[0]);
}
goto __pyx_L6_skip;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("can_cover", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 221, __pyx_L3_error)
__pyx_L6_skip:;
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.can_cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_activity), (&PyUnicode_Type), 1, "activity", 1))) __PYX_ERR(0, 221, __pyx_L1_error)
__pyx_r = __pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_20can_cover(((struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *)__pyx_v_self), __pyx_v_activity);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
/* function exit code */
goto __pyx_L0;
__pyx_L1_error:;
__pyx_r = NULL;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
goto __pyx_L7_cleaned_up;
__pyx_L0:;
for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
Py_XDECREF(values[__pyx_temp]);
}
__pyx_L7_cleaned_up:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_pf_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_20can_cover(struct __pyx_obj_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph *__pyx_v_self, PyObject *__pyx_v_activity) {
PyObject *__pyx_r = NULL;
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __pyx_f_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_can_cover(__pyx_v_self, __pyx_v_activity, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 221, __pyx_L1_error)
__pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_AddTraceback("prolothar_process_discovery.discovery.proseqo.covering_pattern.covering_subgraph.CoveringSubGraph.can_cover", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* … */
__pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_16CoveringSubGraph_21can_cover, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_CoveringSubGraph_can_cover, NULL, __pyx_mstate_global->__pyx_n_u_prolothar_process_discovery_disc, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_17covering_subgraph_CoveringSubGraph, __pyx_mstate_global->__pyx_n_u_can_cover, __pyx_t_3) < 0) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+222: if self.current_node is None:
__pyx_t_6 = (__pyx_v_self->current_node == Py_None);
if (__pyx_t_6) {
/* … */
}
+223: return self.pattern.contains_activity(activity)
__pyx_t_6 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_7pattern_7pattern_Pattern *)__pyx_v_self->__pyx_base.pattern->__pyx_vtab)->contains_activity(__pyx_v_self->__pyx_base.pattern, __pyx_v_activity, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L1_error)
__pyx_r = __pyx_t_6;
goto __pyx_L0;
+224: elif self.covering_subpattern.can_cover(activity):
__pyx_t_6 = ((struct __pyx_vtabstruct_27prolothar_process_discovery_9discovery_7proseqo_16covering_pattern_16covering_pattern_CoveringPattern *)__pyx_v_self->covering_subpattern->__pyx_vtab)->can_cover(__pyx_v_self->covering_subpattern, __pyx_v_activity, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
if (__pyx_t_6) {
/* … */
}
+225: return True
__pyx_r = 1;
goto __pyx_L0;
226: else:
+227: next_node = \
/*else*/ {
+228: self.pattern.find_node_containing_activity(activity)
__pyx_t_2 = ((PyObject *)__pyx_v_self->__pyx_base.pattern);
__Pyx_INCREF(__pyx_t_2);
__pyx_t_5 = 0;
{
PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_activity};
__pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_find_node_containing_activity, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
}
__pyx_v_next_node = __pyx_t_1;
__pyx_t_1 = 0;
+229: return self._get_shortest_path(
__pyx_t_2 = ((PyObject *)__pyx_v_self);
__Pyx_INCREF(__pyx_t_2);
/* … */
__pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_6;
goto __pyx_L0;
}
+230: self.current_node.activity, next_node.activity)
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->current_node, __pyx_mstate_global->__pyx_n_u_activity); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_next_node, __pyx_mstate_global->__pyx_n_u_activity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = 0; { PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_get_shortest_path, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); }
231:
232: