diff --git a/libwccl/values/bool.cpp b/libwccl/values/bool.cpp
index eb8e2a8198a7b2848d9b82804b739bf6ce37cc27..f1d25313b0bf1e0fe89b69fef962af453c443324 100644
--- a/libwccl/values/bool.cpp
+++ b/libwccl/values/bool.cpp
@@ -1,7 +1,15 @@
 #include <libwccl/values/bool.h>
+#include <sstream>
 
 namespace Wccl {
 
 const char* Bool::type_name = "Bool";
 
+std::string Bool::var_repr(const std::string &var_name)
+{
+	std::stringstream ss;
+	ss << "$b" << var_name;
+	return ss.str();
+}
+
 } /* end ns Wccl */
diff --git a/libwccl/values/position.cpp b/libwccl/values/position.cpp
index 329c65a8770132125d3b4be1335ded35ad6bee35..074f7b3377b31eede23ce789a6b89dff3456af08 100644
--- a/libwccl/values/position.cpp
+++ b/libwccl/values/position.cpp
@@ -18,4 +18,11 @@ std::string Position::to_raw_string() const
 	}
 }
 
+std::string Position::var_repr(const std::string &var_name)
+{
+	std::stringstream ss;
+	ss << "$" << var_name;
+	return ss.str();
+}
+
 } /* end ns Wccl */
diff --git a/libwccl/values/strset.cpp b/libwccl/values/strset.cpp
index 02489f4b73f958d8610013e59b93cea4a376772a..133b2333db4b48c54dd394f24cb61a40b998bdf3 100644
--- a/libwccl/values/strset.cpp
+++ b/libwccl/values/strset.cpp
@@ -31,8 +31,8 @@ bool StrSet::intersects(const StrSet &other) const {
 	//need to actually compute it to check if it's empty.
 	//Doing it like below sounds faster than, say, sorting
 	//the sets and using set_intersection.
-	//it's faster to iterate through the smaller set and check in
-	//the larger than it is to do the opposite, hence the &?: below
+	//It's faster to iterate through the smaller set and check in
+	//the larger than it is to do the opposite, hence the &?: below.
 	const set_t& smaller = size() < other.size() ? set_ : other.set_;
 	const set_t& bigger = size() < other.size() ? other.set_ : set_;
 	foreach (const UnicodeString& u, smaller) {
@@ -56,4 +56,11 @@ bool StrSet::is_subset_of(const StrSet &other) const
 	return true;
 }
 
+std::string StrSet::var_repr(const std::string &var_name)
+{
+	std::stringstream ss;
+	ss << "$s" << var_name;
+	return ss.str();
+}
+
 } /* end ns Wccl */
diff --git a/libwccl/values/tset.cpp b/libwccl/values/tset.cpp
index 8b1090ed02651b477976e95eb44b8e26f43cc015..01a8a0a7b366b66063ee79a37383ec29869daff7 100644
--- a/libwccl/values/tset.cpp
+++ b/libwccl/values/tset.cpp
@@ -15,6 +15,13 @@ std::string TSet::to_string(const Corpus2::Tagset& tagset) const
 	return tagset.tag_to_symbol_string(tag_);
 }
 
+std::string TSet::var_repr(const std::string &var_name)
+{
+	std::stringstream ss;
+	ss << "$t" << var_name;
+	return ss.str();
+}
+
 void TSet::insert_symbol(const Corpus2::Tagset& tagset, const std::string& s)
 {
 	tag_.combine_with(tagset.parse_symbol(s));
diff --git a/libwccl/values/value.h b/libwccl/values/value.h
index c6456514a3c40479c6c2f6bf9857930a4f6a772e..e7cee0fdec0ab5da360b99c6b1d0ead105384384 100644
--- a/libwccl/values/value.h
+++ b/libwccl/values/value.h
@@ -5,7 +5,8 @@
 
 #define WCCL_VALUE_PREAMBLE \
 static const char* type_name; \
-const char* get_type_name() const { return type_name; }
+const char* get_type_name() const { return type_name; } \
+static std::string var_repr(const std::string &var_name);
 
 
 namespace Wccl {
@@ -35,7 +36,7 @@ public:
 
 	/**
 	 * String representation of the Value that does not require a tagset,
-	 * might be incompleta and/or contain internal info.
+	 * might be incomplete and/or contain internal info.
 	 *
 	 * Prefer to_string(tagset).
 	 */