-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expression->Built-in->Extern #74
Comments
This is a modified version of the schema to allow specification of the extern library and function signature. Issue #74
This class provides a wrapper to handle loading dynamic libraries at runtime and querying symbols from libraries. The cross-platform code relies on Boost DLL library available since 1.61. Unfortunately, since Ubuntu 16.04 has only 1.58 Boost version, dynamic loading is implemented using native Linux/POSIX API. Issue #74
Basic smoke tests are provided to check if the dynamic library loading works on the given platform. Issue #74
This class abstracts extern functions loaded from libraries. The generic interface specifies the return and argument types at compile-time. The arguments are expected to be supplied by expressions. Issue #74
This class completes the 'extern-function' facilities to call any numeric function from external libraries. At API-level, it is now possible to assign any library function for Expressions. For example, basic event probability can be described by some external library function performing Markov chain analysis at mission time. The major drawback of this approach is that external functions cannot supply validation information for their input, so they may fail upon evaluation. In other word, validation is not guaranteed and up to the library user. Issue #74
The path format is validated before passing it to the library loader. The path must be a file path. Issue #74
Initializer constructs and registers all ExternLibrary elements in a model. The dynamic library from all input files must be processed before extracting and referencing extern functions. Validation: - Duplicate libraries - Invalid path format - IOError loading the library (not-found) Issue #74
This hides the type complexity of ExternExpression by moving the expression construction responsibility to ExternFunction concrete types. The base ExternFunction<void> provides polymorphic interface for these purposes, which also allows storage of ExternFunction objects in containers. Issue #74
The implementation follows the MEF proposal for "define-extern-function". This allows any extern C function to be declared in the MEF XML and used later in Expression. The downside is exponential explosion of possible function-interfaces with respect to allowed parameter types and numbers. In particular, the implementation relies on C++ template meta-programming, which heavily slows the build times and increases build memory consumption. The binary size does not increase much with the current implementation. Validation: - Duplicate declarations - Empty return type - Invalid number of parameters exceeding the maximum number - Undefined extern library to lookup the symbol - Undefined extern-function symbol in the reference library Issue #74
This completes the application of 'extern-function' in expressions. Upon application of the extern function to arguments, a new expression representing the result operation is created. Validation: - Invalid number of arguments - Undefined extern function Issue #74
Simple fault tree analysis with extern function as a basic event probability initialized from a MEF XML input file. Issue #74
The report warning-section contains unused elements including external libraries and functions defined in the XML input. Issue #74
Extern library and function features allow execution of arbitrary code from arbitrary libraries. This is unsafe and should be allowed only for trusted input and libraries. By default, the dynamic library loading with XML is disabled. This can only be enabled at command-line (``--allow-extern``) or API. No XML input should be able to subvert and enable this feature. Issue #74
The note about implementation of the proposal is added to opsa-support docs. Issue #74
The proposal open-psa/mef#53 has been implemented. |
Implement external functions if other than already-defined functions needed for analysis.
The text was updated successfully, but these errors were encountered: