<div dir="ltr"><div class="gmail_extra">This is how C# does it - <a href="https://msdn.microsoft.com/en-us/library/dd264808(v=vs.110).aspx">https://msdn.microsoft.com/en-us/library/dd264808(v=vs.110).aspx</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">There is a language called WhyML which has it buildin - <a href="http://why3.lri.fr/doc-0.80/manual004.html">http://why3.lri.fr/doc-0.80/manual004.html</a>. Another such language is: <a href="http://whiley.org/">http://whiley.org/</a> and Ada (Spark subset) : <a href="https://en.wikipedia.org/wiki/SPARK_(programming_language)">https://en.wikipedia.org/wiki/SPARK_(programming_language)</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">In F* see section on &quot;Statically checked assertions&quot; - <a href="https://www.fstar-lang.org/tutorial/">https://www.fstar-lang.org/tutorial/</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">This can give a better idea on available syntax and how this can be adopted to Swift.</div></div>