.. _exs-getting-started: Getting started =============== Native example -------------- The default solver evaluates numeric expressions with the built-in atom and operator registry: .. code-block:: cpp #include int main() { snt::exs::Solver solver; auto result = solver.eval("23 * 34.5 + 4"); result.print(); // 797.5 return 0; } ``eval`` tokenizes the expression, converts operands through ``Atom::from_string``, applies the configured reduction steps, and returns the final atom. Link an application that uses this API against ``snt-exs``. Build and run ------------- Install the C++ package using :doc:`../../installation` with the ``EXS`` module enabled. Save the example above as ``main.cpp`` and create this ``CMakeLists.txt`` in the same directory: .. code-block:: cmake cmake_minimum_required(VERSION 3.22) project(snt_exs_example LANGUAGES C CXX) find_package(snt CONFIG REQUIRED) add_executable(application main.cpp) target_compile_features(application PRIVATE cxx_std_17) target_link_libraries(application PRIVATE snt-exs) Configure with the installed package prefix, build, and run: .. code-block:: console cmake -S . -B build -DCMAKE_PREFIX_PATH=/path/to/snt cmake --build build ./build/application Expected output: .. code-block:: text 797.5 Replace ``/path/to/snt`` with the installation prefix; omit that option if CMake already finds SNT. C is enabled for discovery of HDF5 in packages built with DIP support. See :ref:`cmake-consumer` for package discovery details. Continue with :doc:`Workflows ` for composition graphs and solver customization. The detailed evaluation path is in :doc:`Solver usage and composition graphs `.