Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
NonlinearVariableSymbol.h
Go to the documentation of this file.
1
6/*
7 * This file is part of Algorithms library toolkit.
8 * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
9
10 * Algorithms library toolkit is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14
15 * Algorithms library toolkit is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19
20 * You should have received a copy of the GNU General Public License
21 * along with Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#pragma once
25
26#include <core/normalize.hpp>
28
29namespace alphabet {
30
35template < class SymbolType = DefaultSymbolType >
40 SymbolType m_symbol;
41
42public:
47 explicit NonlinearVariableSymbol ( SymbolType symbol );
48
54 const SymbolType & getSymbol ( ) const &;
55
61 SymbolType && getSymbol ( ) &&;
62
70 auto operator <=> ( const NonlinearVariableSymbol & other ) const {
71 return m_symbol <=> other.m_symbol;
72 }
73
81 bool operator == ( const NonlinearVariableSymbol & other ) const {
82 return m_symbol == other.m_symbol;
83 }
84
94 return out << "(NonlinearVariableSymbol " << instance.getSymbol ( ) << ")";
95 }
96};
97
98template < class SymbolType >
100}
101
102template < class SymbolType >
104 return m_symbol;
105}
106
107template < class SymbolType >
109 return std::move ( m_symbol );
110}
111
112} /* namespace alphabet */
113
114namespace core {
115
116template < class SymbolType >
117struct normalize < alphabet::NonlinearVariableSymbol < SymbolType > > {
119 return alphabet::NonlinearVariableSymbol < > ( alphabet::SymbolNormalize::normalizeSymbol ( std::move ( value ).getSymbol ( ) ) );
120 }
121};
122
123} /* namespace core */
124
Represents the nonlinear variable symbol used in a nonlinear tree pattern.
Definition: NonlinearVariableSymbol.h:36
auto operator<=>(const NonlinearVariableSymbol &other) const
Definition: NonlinearVariableSymbol.h:70
friend ext::ostream & operator<<(ext::ostream &out, const NonlinearVariableSymbol< SymbolType > &instance)
Definition: NonlinearVariableSymbol.h:93
NonlinearVariableSymbol(SymbolType symbol)
Creates a new instance of the nonlinear variable with some underlying base symbol.
Definition: NonlinearVariableSymbol.h:99
const SymbolType & getSymbol() const &
Definition: NonlinearVariableSymbol.h:103
bool operator==(const NonlinearVariableSymbol &other) const
Definition: NonlinearVariableSymbol.h:81
static DefaultSymbolType normalizeSymbol(SymbolType &&symbol)
Definition: SymbolNormalize.h:68
Definition: ostream.h:14
Definition: BarSymbol.cpp:12
typename T::SymbolType SymbolType
Definition: ReachableStates.h:176
Definition: normalize.hpp:10
static alphabet::NonlinearVariableSymbol< > eval(alphabet::NonlinearVariableSymbol< SymbolType > &&value)
Definition: NonlinearVariableSymbol.h:118
Definition: normalize.hpp:13