hobbes
a language, embedded compiler, and runtime for efficient dynamic expression evaluation, data storage and analysis
constraints.H
Go to the documentation of this file.
1 /******
2  * constraints : eliminate redundant constraints (avoid redundant and costly unqualification)
3  ******/
4 
5 #ifndef HOBBES_LANG_CONSTRAINTS_HPP_INCLUDED
6 #define HOBBES_LANG_CONSTRAINTS_HPP_INCLUDED
7 
8 #include <hobbes/lang/type.H>
9 #include <hobbes/lang/typemap.H>
10 #include <set>
11 
12 namespace hobbes {
13 
14 // we may need to perform unification when simplifying constraints
15 class MonoTypeUnifier;
16 
17 // represent a set of unique constraints for efficient uniqueness determination
19 public:
20  ConstraintSet();
21 
22  // add a constraint to the set
23  // if the constraint is entailed by the set already, unify anything necessary in the input constraint and add nothing
24  void insert(const TEnvPtr&, const ConstraintPtr&, MonoTypeUnifier*);
25  Constraints constraints() const;
26 private:
28  CSet csts;
29 };
30 
31 void typeSeqForm(const ConstraintPtr&, MonoTypes*);
32 
33 }
34 
35 #endif
void typeSeqForm(const ConstraintPtr &, MonoTypes *)
Definition: constraints.C:13
CSet csts
Definition: constraints.H:28
type_map< ConstraintPtr > CSet
Definition: constraints.H:27
Definition: boot.H:7
void insert(const TEnvPtr &, const ConstraintPtr &, MonoTypeUnifier *)
Definition: constraints.C:37
Definition: typeinf.H:29
Constraints constraints() const
Definition: constraints.C:72
std::vector< ConstraintPtr > Constraints
Definition: type.H:35
std::shared_ptr< TEnv > TEnvPtr
Definition: type.H:80
ConstraintSet()
Definition: constraints.C:20
Definition: constraints.H:18
std::shared_ptr< Constraint > ConstraintPtr
Definition: type.H:33
std::vector< MonoTypePtr > MonoTypes
Definition: type.H:72