CREATE OR REPLACE FUNCTION rsubstruct_query(mol, mol)
RETURNS bool
PARALLEL SAFE
AS 'MODULE_PATHNAME', 'mol_rsubstruct_query'
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR <<@ (
	LEFTARG = mol,
	RIGHTARG = mol,
	PROCEDURE = rsubstruct_query(mol, mol),
	COMMUTATOR = '@>>',
	RESTRICT = contsel,
	JOIN = contjoinsel
);

CREATE OR REPLACE FUNCTION substruct_query(mol, qmol)
RETURNS bool
PARALLEL SAFE
AS 'MODULE_PATHNAME', 'mol_substruct_query'
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR @>> (
	LEFTARG = mol,
	RIGHTARG = qmol,
	PROCEDURE = substruct_query(mol, mol),
	COMMUTATOR = '<<@',
	RESTRICT = contsel,
	JOIN = contjoinsel
);

CREATE OR REPLACE FUNCTION rsubstruct_query(qmol, mol)
RETURNS bool
PARALLEL SAFE
AS 'MODULE_PATHNAME', 'mol_rsubstruct_query'
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR <<@ (
	LEFTARG = qmol,
	RIGHTARG = mol,
	PROCEDURE = rsubstruct_query(qmol, mol),
	COMMUTATOR = '@>>',
	RESTRICT = contsel,
	JOIN = contjoinsel
);

CREATE OR REPLACE FUNCTION substruct_query(mol, mol)
RETURNS bool
PARALLEL SAFE
AS 'MODULE_PATHNAME', 'mol_substruct_query'
LANGUAGE C STRICT IMMUTABLE;
CREATE OPERATOR @>> (
	LEFTARG = mol,
	RIGHTARG = mol,
	PROCEDURE = substruct_query(mol, mol),
	COMMUTATOR = '<<@',
	RESTRICT = contsel,
	JOIN = contjoinsel
);
