Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Design preparation for native semantics #44

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6d12b44
add native semantics (WIP)
vmatare May 27, 2020
820e7b8
cmake: fix native semantics integration
vmatare Jan 30, 2021
5765fe7
cmake: rename NATIVE_IMPL -> NATIVE_SEMANTICS
vmatare Jan 30, 2021
c8cfc04
model: cleanup old/unused code
Jul 25, 2021
b714fe9
model: refactor semantics interface
Jul 25, 2021
0187cdb
ReadylogSemantics: adapt to changed semantics interface
Jul 25, 2021
5baa772
execution: minor infrastructure for native semantics
Jul 25, 2021
502ec21
platform: adapt Taptenc semantics to interface changes
Jul 25, 2021
ebd93ec
semantics: adapt native semantics to new interface
Jul 26, 2021
1c71f8a
plan: fix max_reward(...) signature
Sep 15, 2021
6883d97
move ExecutionController::run() into ReadylogContext
Oct 6, 2022
a132723
move Transition semantics impl to ReadylogSemantics
Oct 6, 2022
381f3c9
model: redesign event architecture
Jan 7, 2023
5fc42b5
model: clarify copyability of elements & semantics
Jan 26, 2023
860a7a8
model: fix Reference inheritance
Jan 31, 2023
6588203
execution: fix copying & instantiation of semantics
Jan 31, 2023
3452072
parser: silence boost::phoenix deprecated header warnings
Jan 31, 2023
f86e6d3
readylog: adapt to changed Reference interface
Jan 31, 2023
0ba67a8
cmake: remove gcc-specific compiler flags
Jan 31, 2023
77ca4f2
fix reference ExprT inheritance
Feb 9, 2023
b7bfeab
taptenc: Adapt to new Refernce interface
Feb 9, 2023
9ed9d8a
rename list_expression.* -> list.*
Mar 10, 2023
9fe71f0
move list-related code into list.*
Mar 10, 2023
c2a3483
rename compound_expression.* -> compound.*
Mar 11, 2023
abb5d9d
move FieldAccess stuff into compound.*
Mar 11, 2023
0c12478
readylog: cleanup PL code search logic
Mar 26, 2023
6a1cfb2
workflow: enable gpp tests
vmatare Mar 26, 2023
3735bfe
cmake: fix minor warning
Mar 27, 2023
a83886b
gologpp-test: add eclipse libdir to RPATH
Mar 27, 2023
ada7505
workflows/cmake: test verbosely
vmatare Mar 27, 2023
729b85b
workflows/cmake: explicitly update submodules
vmatare Mar 27, 2023
7b88556
use HTTPS for taptenc submodule
Mar 27, 2023
cafa9f1
workflows/cmake: set 10m timeout on tests
vmatare Mar 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CMake

on:
workflow_dispatch:
#push:
# branches: [ "master" ]
#pull_request:
# branches: [ "master" ]
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand All @@ -26,6 +26,9 @@ jobs:

- name: install-deps
run: sudo apt install libboost-all-dev wget

- name: update submodules
run: git submodule update --force --init --checkout

- name: install eclipse-clp
run: |
Expand All @@ -43,8 +46,8 @@ jobs:
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DBUILD_READYLOG_SEMANTICS=TRUE \
-DBUILD_PARSER=FALSE \
-DBUILD_TESTING=FALSE \
-DBUILD_PARSER=TRUE \
-DBUILD_TESTING=TRUE \

- name: Build
# Build your program with the given configuration
Expand All @@ -54,5 +57,6 @@ jobs:
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
run: ctest -C ${{env.BUILD_TYPE}} -VV
timeout-minutes: 10

6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "external/taptenc"]
path = external/taptenc
url = git@github.com:TarikViehmann/taptenc.git
[submodule "src/semantics/readylog/interpreter"]
path = src/semantics/readylog/interpreter
url = https://github.com/TarikViehmann/taptenc.git
[submodule "src/semantics/readylog/readylog_ecl"]
path = src/semantics/readylog/readylog_ecl
url = https://github.com/MASKOR/readylog.git
143 changes: 126 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# along with golog++. If not, see <https://www.gnu.org/licenses/>.
###########################################################################

project(golog++)
cmake_minimum_required(VERSION 3.0)
project(golog++)

include(CMakeDependentOption)
include(GNUInstallDirs)
Expand Down Expand Up @@ -72,7 +72,8 @@ set(SEMANTICS_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/golog++/semantics)

set(GOLOGPP_VERSION 0.1.0)


file(GLOB_RECURSE GOLOGPP_HEADERS "src/*.h")
add_custom_target(headers SOURCES ${GOLOGPP_HEADERS})

######################################################################################
# The golog++ language metamodel: libgolog++.so
Expand Down Expand Up @@ -100,8 +101,8 @@ set(INTERFACE_SRC
src/model/mapping.cpp
src/model/language.cpp
src/model/types.cpp
src/model/compound_expression.cpp
src/model/list_expression.cpp
src/model/compound.cpp
src/model/list.cpp
src/model/semantics.cpp
src/model/logger.cpp
src/model/name.cpp
Expand All @@ -115,6 +116,7 @@ set(INTERFACE_SRC
src/execution/plan.cpp
src/execution/platform_backend.cpp
src/execution/transformation.cpp
src/execution/event.cpp

src/model/platform/component.cpp
src/model/platform/constraint.cpp
Expand Down Expand Up @@ -155,8 +157,8 @@ install(FILES
src/model/string.h
src/model/mapping.h
src/model/types.h
src/model/compound_expression.h
src/model/list_expression.h
src/model/compound.h
src/model/list.h
src/model/logger.h
src/model/name.h

Expand All @@ -173,6 +175,7 @@ install(FILES
src/execution/plan.h
src/execution/platform_backend.h
src/execution/transformation.h
src/execution/event.h

DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/golog++/execution
)
Expand Down Expand Up @@ -225,10 +228,10 @@ if (${BUILD_PARSER})
src/parser/symbolic_expression.cpp
src/parser/string_expression.cpp
src/parser/domain.cpp
src/parser/compound_expression.cpp
src/parser/compound.cpp
src/parser/mixed_member_access.cpp
src/parser/mapping.cpp
src/parser/list_expression.cpp
src/parser/list.cpp
src/parser/value.cpp

src/parser/platform/clock_formula.cpp
Expand Down Expand Up @@ -262,10 +265,10 @@ if (${BUILD_PARSER})
src/parser/expressions.h
src/parser/symbolic_expression.h
src/parser/domain.h
src/parser/compound_expression.h
src/parser/compound.h
src/parser/mixed_member_access.h
src/parser/mapping.h
src/parser/list_expression.h
src/parser/list.h
src/parser/value.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/golog++/parser
)
Expand Down Expand Up @@ -313,10 +316,9 @@ if (${BUILD_READYLOG_SEMANTICS})
src/semantics/readylog/history.cpp
src/semantics/readylog/reference.cpp
src/semantics/readylog/effect_axiom.cpp
src/semantics/readylog/compound_expression.cpp
src/semantics/readylog/list_expression.cpp
src/semantics/readylog/compound.cpp
src/semantics/readylog/list.cpp
src/semantics/readylog/transition.cpp
src/semantics/readylog/activity.cpp
src/semantics/readylog/plan.cpp
)

Expand Down Expand Up @@ -348,24 +350,31 @@ if (${BUILD_READYLOG_SEMANTICS})
src/semantics/readylog/reference.h
src/semantics/readylog/string.h
src/semantics/readylog/history.h
src/semantics/readylog/compound_expression.h
src/semantics/readylog/list_expression.h
src/semantics/readylog/compound.h
src/semantics/readylog/list.h
src/semantics/readylog/transition.h
src/semantics/readylog/activity.h
src/semantics/readylog/plan.h
src/semantics/readylog/wrap_eclipseclass.h

DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/golog++/semantics/readylog
)

file(
COPY src/semantics/readylog/boilerplate.pl
DESTINATION "${CMAKE_BINARY_DIR}/semantics/readylog"
)
install(FILES
src/semantics/readylog/boilerplate.pl
DESTINATION ${SEMANTICS_INSTALL_DIR}/readylog
)

if (INSTALL_READYLOG_INTERPRETER)
file(
COPY src/semantics/readylog/readylog_ecl
DESTINATION "${CMAKE_BINARY_DIR}/semantics/readylog"
)
install(
DIRECTORY src/semantics/readylog/interpreter
DIRECTORY src/semantics/readylog/readylog_ecl
DESTINATION ${SEMANTICS_INSTALL_DIR}/readylog
)
endif()
Expand All @@ -383,6 +392,89 @@ if (${BUILD_READYLOG_SEMANTICS})
endif()



######################################################################################
# The golog++ native semantics: libnativegolog++.so
######################################################################################

option(BUILD_NATIVE_SEMANTICS "Build the native golog++ semantics" OFF)
if (${BUILD_NATIVE_SEMANTICS})
set(NATIVE_SRC
src/semantics/native/action.cpp
src/semantics/native/variable.cpp
src/semantics/native/value.cpp
src/semantics/native/domain.cpp
src/semantics/native/arithmetic.cpp
src/semantics/native/execution.cpp
src/semantics/native/fluent.cpp
src/semantics/native/formula.cpp
src/semantics/native/procedural.cpp
src/semantics/native/scope.cpp
src/semantics/native/semantics.cpp
src/semantics/native/utilities.cpp
src/semantics/native/string.cpp
src/semantics/native/history.cpp
src/semantics/native/reference.cpp
src/semantics/native/effect_axiom.cpp
src/semantics/native/compound.cpp
src/semantics/native/list.cpp
src/semantics/native/transition.cpp
)

link_directories(${ECLIPSE_LIBRARY_DIRS})
add_library(nativegolog++ SHARED ${NATIVE_SRC})
target_compile_definitions(nativegolog++ PUBLIC
-DECLIPSE_DIR=\"${ECLIPSE_DIR}\"
-DUSES_NO_ENGINE_HANDLE
-DSEMANTICS_INSTALL_DIR=\"${CMAKE_INSTALL_PREFIX}/${SEMANTICS_INSTALL_DIR}\"
)
target_include_directories(nativegolog++ PUBLIC ${ECLIPSE_INCLUDE_DIRS})
target_link_libraries(nativegolog++ golog++ ${ECLIPSE_LIBRARIES} stdc++fs)
set_property(TARGET nativegolog++ PROPERTY CXX_STANDARD 14)
set_property(TARGET nativegolog++ PROPERTY SOVERSION ${GOLOGPP_VERSION})
install(TARGETS nativegolog++ DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
src/semantics/native/semantics.h
src/semantics/native/formula.h
src/semantics/native/effect_axiom.h
src/semantics/native/variable.h
src/semantics/native/value.h
src/semantics/native/domain.h
src/semantics/native/arithmetic.h
src/semantics/native/procedural.h
src/semantics/native/scope.h
src/semantics/native/fluent.h
src/semantics/native/action.h
src/semantics/native/execution.h
src/semantics/native/utilities.h
src/semantics/native/reference.h
src/semantics/native/string.h
src/semantics/native/history.h
src/semantics/native/compound.h
src/semantics/native/list.h
src/semantics/native/transition.h

DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/golog++/semantics/native
)

get_target_property(NATIVEGPP_CXXFLAGS_L nativegolog++ INTERFACE_COMPILE_OPTIONS)
set(NATIVEGPP_CXXFLAGS "-I${ECLIPSE_INCLUDE_DIRS}")
if (${NATIVEGPP_CXXFLAGS_L})
foreach(i IN LISTS ${NATIVEGPP_CXXFLAGS_L})
set(NATIVEGPP_CXXFLAGS "${NATIVEGPP_CXXFLAGS} ${i}")
endforeach()
endif()
set(NATIVEGPP_LDFLAGS "${ECLIPSE_LDFLAGS}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/nativegolog++.pc.in ${CMAKE_CURRENT_BINARY_DIR}/nativegolog++.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/nativegolog++.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()



######################################################################################
# The taptenc semantics for platform modeling
######################################################################################

if (BUILD_TAPTENC_SEMANTICS)
set(TAPTENC_SRC
external/taptenc/src/constraints/constraints.cpp
Expand Down Expand Up @@ -461,6 +553,7 @@ set(GPP_TESTS

if (BUILD_PARSER AND BUILD_READYLOG_SEMANTICS)
include(CTest)
enable_testing()

add_executable(gologpp-test src/tests/gologpp-test.cpp)
if (USE_LIBASAN)
Expand All @@ -469,6 +562,7 @@ if (BUILD_PARSER AND BUILD_READYLOG_SEMANTICS)

set(TEST_LIBS ${TEST_LIBS} boost_filesystem boost_program_options parsegolog++ readylog++)
target_link_libraries(gologpp-test ${TEST_LIBS})
set_target_properties(gologpp-test PROPERTIES BUILD_RPATH ${ECLIPSE_LIBRARY_DIRS})

if (BUILD_TAPTENC_SEMANTICS)
target_link_libraries(gologpp-test taptenc-golog++)
Expand All @@ -487,3 +581,18 @@ if (BUILD_PARSER AND BUILD_READYLOG_SEMANTICS)
endif()



if (${BUILD_NATIVE_SEMANTICS})
set(NATIVE_TEST_SRC
src/tools/nativegpp-test.cpp)
add_executable(nativegpp-test ${NATIVE_TEST_SRC})
target_link_libraries(nativegpp-test nativegolog++ parsegolog++)
set_property(TARGET nativegpp-test PROPERTY CXX_STANDARD 14)

if (USE_LIBASAN)
target_link_libraries(nativegpp-test asan)
endif()

install(TARGETS nativegpp-test RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

Loading