/**
* Type rule for binary operators (bag.union_max, bag.union_disjoint,
* bag.inter_min bag.difference_subtract, bag.difference_remove) to check
- * if the two arguments are of the same sort.
+ * if the two arguments are bags of the same sort.
*/
struct BinaryOperatorTypeRule
{
}; /* struct BinaryOperatorTypeRule */
/**
- * Type rule for binary operator bag.subbag to check if the two arguments have
- * the same sort.
+ * Type rule for binary operator bag.subbag to check if the two arguments are
+ * bags of the same sort.
*/
struct SubBagTypeRule
{
}; /* struct BagMakeTypeRule */
/**
- * Type rule for bag.is_singleton to check the argument is of a bag.
+ * Type rule for (bag.is_singleton B) to check the argument B is a bag.
*/
struct IsSingletonTypeRule
{
}; /* struct IsSingletonTypeRule */
/**
- * Type rule for (as bag.empty (Bag ...))
+ * Type rule for (as bag.empty (Bag T)) where T is a type
*/
struct EmptyBagTypeRule
{
}; /* struct EmptyBagTypeRule */
/**
- * Type rule for (bag.card ..) to check the argument is of a bag.
+ * Type rule for (bag.card B) to check the argument B is a bag.
*/
struct CardTypeRule
{
}; /* struct CardTypeRule */
/**
- * Type rule for (bag.choose ..) to check the argument is of a bag.
+ * Type rule for (bag.choose B) to check the argument B is a bag.
*/
struct ChooseTypeRule
{
namespace theory {
namespace sets {
+/**
+ * Type rule for binary operators (set.union, set.inter_min, set.minus) to check
+ * if the two arguments are sets of the same sort.
+ */
struct SetsBinaryOperatorTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
-
static bool computeIsConst(NodeManager* nodeManager, TNode n);
};
+/**
+ * Type rule for binary operator set.subset to check if the two arguments are
+ * sets of the same sort.
+ */
struct SubsetTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for binary operator set.member to check the sort of the first
+ * argument matches the element sort of the given set.
+ */
struct MemberTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (set.singleton (SetSingletonOp t) x) to check the sort of x
+ * matches the sort t.
+ */
struct SingletonTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
static bool computeIsConst(NodeManager* nodeManager, TNode n);
};
+/**
+ * Type rule for (as set.empty (Set T)) where T is a type
+ */
struct EmptySetTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (bag.card A) to check the argument A is a set.
+ */
struct CardTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (set.complement A) to check the argument A is a set.
+ */
struct ComplementTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (as set.universe (Set T)) where T is a type
+ */
struct UniverseSetTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (set.comprehension ((x1 T1) ... (xn Tn)) predicate body)
+ * that checks x1 ... xn are bound variables, predicate is a boolean term,
+ * and computes the type (Set T) where T is the type of body
+ */
struct ComprehensionTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (set.choose A) to check the argument A is a set.
+ */
struct ChooseTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (set.is_singleton A) to check the argument A is a set.
+ */
struct IsSingletonTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for (set.insert e1 ... en A) that checks the sorts of e1, ..., en
+ * match the element sort of the set A
+ */
struct InsertTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
}; /* struct SetMapTypeRule */
+/**
+ * Type rule for binary operators (rel.join, rel.product) to check
+ * if the two arguments are relations (set of tuples).
+ * For arguments A of type (Set (Tuple A1 ... Am)) and B of type
+ * (Set (Tuple B1 ... Bn)):
+ * - (rel.product A B): it computes the type (Set (Tuple (A1 ... Am B1 ... Bn)).
+ * - (rel.join A B) it checks that m, n > 1 and Am = B1 and computes the type
+ * (Set (Tuple (A1 ... Am-1 B2 ... Bn)).
+ */
struct RelBinaryOperatorTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for unary operator (rel.transpose A) to check that A is a relation
+ * (set of Tuples). For an argument A of type (Set (Tuple A1 ... An))
+ * it reveres A1 ... An and computes the type (Set (Tuple An ... A1)).
+ */
struct RelTransposeTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for unary operator (rel.tclosure A) to check that A is a binary
+ * relation of type (Set (Tuple T T)), where T is a type
+ */
struct RelTransClosureTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for operator (rel.join_image A c) that checks A is a binary
+ * relation of type (Set (Tuple T T)), where T is a type, and c is an integer
+ * term (in fact c should be a non-negative constant, otherwise a logic
+ * exception is thrown TheorySetsPrivate::preRegisterTerm).
+ */
struct JoinImageTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);
};
+/**
+ * Type rule for unary operator (rel.iden A) to check that A is a unary relation
+ * of type (Set (Tuple T)) and computes the type (Set (Tuple T T)) for the
+ * identity
+ */
struct RelIdenTypeRule
{
static TypeNode computeType(NodeManager* nodeManager, TNode n, bool check);