--- /dev/null
+(* contexts *****************************************************************)
+
+type svar_context = (MathQL.svar * MathQL.resource_set) list
+
+type rvar_context = (MathQL.rvar * MathQL.resource) list
+
+type group_context = (MathQL.rvar * MathQL.attribute_group) list
+
+type vvar_context = (MathQL.vvar * MathQL.value) list
+
+
+type context = {svars: svar_context; (* contesto delle svar *)
+ rvars: rvar_context; (* contesto delle rvar *)
+ groups: group_context; (* contesto dei gruppi *)
+ vvars: vvar_context (* contesto delle vvar introdotte con let-in *)
+ }
+
+let upd_svars c s =
+ {svars = s; rvars = c.rvars; groups = c.groups; vvars = c.vvars}
+
+let upd_rvars c s =
+ {svars = c.svars; rvars = s; groups = c.groups; vvars = c.vvars}
+
+let upd_groups c s =
+ {svars = c.svars; rvars = c.rvars; groups = s; vvars = c.vvars}
+
+let upd_vvars c s =
+ {svars = c.svars; rvars = c.rvars; groups = c.groups; vvars = s}
+
+