3#include <clingo/input/body_literal.hh>
4#include <clingo/input/head_literal.hh>
8namespace CppClingo::Input {
20 return std::tuple{
a_loc = &StmRule::loc_,
a_head = &StmRule::head_,
a_body = &StmRule::body_};
25 : loc_{std::move(
loc)}, head_{std::move(
head)}, body_{std::move(
body)} {}
28 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
30 [[nodiscard]]
auto head() const ->
HdLit const & {
return head_; }
57 a_prio = &TheoryOpDefinition::prio_,
a_type = &TheoryOpDefinition::type_};
65 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
67 [[nodiscard]]
auto op() const ->
String const & {
return *op_; }
69 [[nodiscard]]
auto prio() const ->
int {
return prio_; }
91 a_op_defs = &TheoryTermDefinition::op_defs_};
96 : loc_{std::move(
loc)}, name_{
name}, op_defs_{std::move(
op_defs)} {}
99 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
101 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
141 [[nodiscard]]
auto term() const ->
String const & {
return *term_; }
157 a_rhs = &TheoryAtomDefinition::rhs_,
a_type = &TheoryAtomDefinition::type_};
166 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
168 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
170 [[nodiscard]]
auto arity() const ->
int {
return arity_; }
172 [[nodiscard]]
auto term() const ->
String const & {
return *term_; }
183 std::optional<TheoryRGuardDefinition> rhs_;
207 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
209 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
232 return std::tuple{
a_weight = &OptimizeTuple::weight_,
a_prio = &OptimizeTuple::prio_,
233 a_terms = &OptimizeTuple::terms_};
238 : weight_{std::move(
weight)}, prio_{std::move(priority)}, terms_{std::move(
terms)} {}
241 [[nodiscard]]
auto weight() const ->
Term const & {
return weight_; }
243 [[nodiscard]]
auto prio() const -> std::optional<
Term> const & {
return prio_; }
249 std::optional<Term> prio_;
258 return std::tuple{
a_tuple = &OptimizeElement::tuple_,
a_cond = &OptimizeElement::cond_};
283 return std::tuple{
a_loc = &StmOptimize::loc_,
a_type = &StmOptimize::type_,
a_elems = &StmOptimize::elems_};
288 : loc_{std::move(
loc)}, type_{
type}, elems_{std::move(
elems)} {}
291 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
310 return std::tuple{
a_loc = &StmWeakConstraint::loc_,
a_body = &StmWeakConstraint::body_,
311 a_tuple = &StmWeakConstraint::tuple_};
338 return std::tuple{
a_loc = &StmShow::loc_,
a_term = &StmShow::term_,
a_body = &StmShow::body_};
343 : loc_{std::move(
loc)}, term_(std::move(
term)), body_(std::move(
body)) {}
346 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
348 [[nodiscard]]
auto term() const ->
Term const & {
return term_; }
366 a_arity = &StmShowSig::arity_};
374 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
376 [[nodiscard]]
auto sign() const ->
bool {
return sign_; }
378 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
380 [[nodiscard]]
auto arity() const ->
int {
return arity_; }
395 static constexpr auto attributes() {
return std::tuple{
a_loc = &StmShowNothing::loc_}; }
401 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
414 return std::tuple{
a_loc = &StmProject::loc_,
a_atom = &StmProject::atom_,
a_body = &StmProject::body_};
419 : loc_{std::move(
loc)}, atom_(std::move(
atom)), body_(std::move(
body)) {}
422 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
424 [[nodiscard]]
auto atom() const ->
Term const & {
return atom_; }
442 a_arity = &StmProjectSig::arity_};
450 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
452 [[nodiscard]]
auto sign() const ->
bool {
return sign_; }
454 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
456 [[nodiscard]]
auto arity() const ->
int {
return arity_; }
473 a_arity = &StmDefined::arity_};
481 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
483 [[nodiscard]]
auto sign() const ->
bool {
return sign_; }
485 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
487 [[nodiscard]]
auto arity() const ->
int {
return arity_; }
506 return std::tuple{
a_loc = &StmExternal::loc_,
a_atom = &StmExternal::atom_,
a_body = &StmExternal::body_,
507 a_type = &StmExternal::type_};
512 : loc_{std::move(
loc)}, atom_(std::move(
atom)), body_(std::move(
body)), type_{std::move(
type)} {}
515 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
517 [[nodiscard]]
auto atom() const ->
Term const & {
return atom_; }
521 [[nodiscard]]
auto type() const -> std::optional<
Term> const & {
return type_; }
527 std::optional<Term> type_;
540 [[nodiscard]]
auto src() const ->
Term const & {
return src_; }
542 [[nodiscard]]
auto dst() const ->
Term const & {
return dst_; }
558 return std::tuple{
a_loc = &StmEdge::loc_,
a_edges = &StmEdge::edges_,
a_body = &StmEdge::body_};
563 : loc_{std::move(
loc)}, edges_{std::move(
edges)}, body_{std::move(
body)} {}
566 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
585 return std::tuple{
a_loc = &StmHeuristic::loc_,
a_atom = &StmHeuristic::atom_,
587 a_prio = &StmHeuristic::prio_,
a_type = &StmHeuristic::type_};
592 : loc_{std::move(
loc)}, atom_{std::move(
atom)}, body_{std::move(
body)}, weight_(std::move(
weight)),
593 prio_(std::move(
prio)), type_(std::move(
type)) {}
597 std::move(
loc), std::move(
atom), std::move(
body), std::move(
weight), std::make_optional(std::move(
prio)),
602 std::move(
weight), std::nullopt, std::move(
type)} {}
605 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
607 [[nodiscard]]
auto atom() const ->
Term const & {
return atom_; }
611 [[nodiscard]]
auto weight() const ->
Term const & {
return weight_; }
613 [[nodiscard]]
auto prio() const -> std::optional<
Term> const & {
return prio_; }
615 [[nodiscard]]
auto type() const ->
Term const & {
return type_; }
622 std::optional<Term> prio_;
640 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
642 [[nodiscard]]
auto type() const ->
String const & {
return *type_; }
644 [[nodiscard]]
auto value() const ->
String const & {
return *value_; }
675 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
679 [[nodiscard]]
auto value() const ->
String const & {
return *value_; }
699 : loc_{std::move(
loc)}, name_(
name), args_{
args.begin(),
args.end()} {}
702 : loc_{std::move(
loc)}, name_(
name), args_{std::move(
args)} {}
705 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
707 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
738 : loc_{std::move(
loc)}, type_(
type), name_(
name), value_(std::move(
value)) {}
741 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
745 [[nodiscard]]
auto name() const ->
String const & {
return *name_; }
747 [[nodiscard]]
auto value() const ->
Term const & {
return value_; }
759using ProgramParam = std::pair<SharedString, std::vector<SharedSymbol>>;
770 return std::tuple{
a_loc = &StmParts::loc_,
a_type = &StmParts::type_,
a_elems = &StmParts::elems_};
775 : loc_{std::move(
loc)}, type_(
type), elems_(std::move(
elems)) {}
778 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
813 [[nodiscard]]
auto loc() const ->
Location const & {
return loc_; }
817 [[nodiscard]]
auto value() const ->
String const & {
return *value_; }
The Location of an expression in an input source.
Definition location.hh:44
Class managing the lifetime of a String.
Definition symbol.hh:93
Reference to a string stored in a symbol store.
Definition symbol.hh:18
auto as_string_span(T const &vec) -> StringSpan
Convert a collection of shared strings into a string span.
Definition symbol.hh:196
std::span< String const > StringSpan
A span of strings.
Definition symbol.hh:87