<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Alcides Fonseca</title><link>https://wiki.alcidesfonseca.com/</link><description>A Maelstrom of Ideas, Code and Politics</description><atom:link href="https://wiki.alcidesfonseca.com/feeds/all/" rel="self"/><language>en-us</language><lastBuildDate>Fri, 27 Nov 2026 15:54:22 +0000</lastBuildDate><item><title>AI Safety for Builders 2026</title><link>https://wiki.alcidesfonseca.com/blog/ai-safety-for-builders-2026?utm_source=rss_all</link><description>

&lt;p&gt;I am mentoring this edition of [AI Safety for Builders] micro-grants. These grants fund 4 to 6 weeks in developing real AI safety tools. It happens online between the end of December and January. &lt;a href="https://aisafety.builders/mentors/alcides-f"&gt;You can apply until November 30th&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The project I am mentoring is about extending Fronteira, our harness (Claude/Codex/Cursor) firewall that intercepts any external communication and allows or rejects it, based on deterministic behavioral rules.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://wiki.alcidesfonseca.com/blog/lessons-learned-building-fronteira/"&gt;I wrote about the first iteration of Fronteira&lt;/a&gt;, but this work will be based on the second version. While the first prototype was an MCP proxy, the second is an egress plugin in your favorite harness that can better constrain all the actions of the agent.&lt;/p&gt;
&lt;p&gt;The goal for this sprint is to automatically learn useful rules that detect unsafe operations that are presented to the user so they can add new rules.&lt;/p&gt;
&lt;p&gt;If you are interested, apply or reach out to me for more information.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Fri, 27 Nov 2026 15:54:22 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/ai-safety-for-builders-2026?utm_source=rss_all</guid></item><item><title>OpenAI is optimizing for cost</title><link>https://wiki.alcidesfonseca.com/blog/openai-is-optimizing-for-cost?utm_source=rss_all</link><description>

&lt;p&gt;&lt;img alt="Sol and Astra evolution in tokens and cost" src="https://micjm.com/blog/openai-is-in-cost-control-mode/cost-intervals.png"&gt;&lt;/p&gt;
&lt;p&gt;bq. Based on our data, it looks like they’ve been tuned for cost savings. Specifically output tokens per task and reasoning tokens per task have dropped.&lt;/p&gt;
&lt;p&gt;— &lt;a href="https://micjm.com/about/"&gt;Michael Mayer&lt;/a&gt; in &lt;a href="https://micjm.com/blog/openai-is-in-cost-control-mode/"&gt;"OpenAI may be in cost control mode"&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Of course OpenAI is optimizing to reduce tokens (mostly because it also reduces execution time), but for me the conclusion is that OpenAI is already saturated in most benchmarks. The latest models (from both top providers) are not necessarily better in most benchmarks, but they are more optimized.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Fri, 27 Nov 2026 00:42:42 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/openai-is-optimizing-for-cost?utm_source=rss_all</guid></item><item><title>Are we finally solving micro transactions on the web?</title><link>https://wiki.alcidesfonseca.com/blog/micro-transactions-on-the-web?utm_source=rss_all</link><description>

&lt;p&gt;I've previously written about how I believe &lt;a href="https://wiki.alcidesfonseca.com/blog/on-copyright-and-ai/"&gt;the open web is dying&lt;/a&gt;. Maybe one solution to prevent it, and to save &lt;a href="https://wiki.alcidesfonseca.com/blog/its-the-end-of-anonymity-in-open-source-as-we-know-it/"&gt;anonymity on the web&lt;/a&gt; is to finally fix the micro-payment that &lt;a href="https://reallifemag.com/paid-in-full/"&gt;no-one ever solved&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Disclaimer: I started developing during the Web 1.0 age (a.k.a. dotCom era) and substantially improved my engineering skills during the Web 2.0 movement. I completely skipped all the Web 3.0 craze (unless you count the original &lt;a href="https://alcidesfonseca.com/presentations/2008-microsoft-popup-future-of-web.pdf"&gt;Web 3.0 — the Semantic Web&lt;/a&gt;) not necessarily because of technical limitations, but because of the community around it. Now that everyone moved to AI, I think we can look at blockchain again, with more sober eyes.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://wiki.alcidesfonseca.com/blog/the-internet-isnt-closed/"&gt;Agents have the potential multiply the web traffic by a thousand fold or more.&lt;/a&gt; As an early example in software engineering (the early adopters of autonomous AIs), git traffic has increased &lt;a href="https://github.blog/engineering/architecture-optimization/inside-githubs-new-git-storage-architecture/"&gt;in Github&lt;/a&gt; and at &lt;a href="https://www.anthropic.com/research/redesigning-source-control"&gt;Anthropic&lt;/a&gt; and &lt;a href="https://openai.com/index/scaling-git-at-openai/"&gt;OpenAI&lt;/a&gt; so much they all needed new infrastructure to handle this increased load. &lt;a href="https://blog.pragmaticengineer.com/the-pulse-is-github-still-best-for-ai-native-development/"&gt;The same is happening all across the industry.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="AI-generated illustration for a small robotic agent buying a webpage from Brave" src="https://wiki.alcidesfonseca.com/media/images/microtransactions_web.png"&gt;&lt;/p&gt;
&lt;p&gt;As agents become the UI for the whole internet, many service providers lose their ad-based income and become unsustainable. I applaud Brave's initiative to change the economics and start charging for agent access (although I believe it will spill over to human access as well).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Pricing follows Brave’s published API rates: LLM Context, an API designed specifically for providing search context for agents, will cost $0.005 ($5 per 1,000). Additionally, web (search for humans), news, image, video, and local endpoints will also be available for $0.005 ($5 per 1,000). Gas fees for transacting on the Base blockchain will be covered for a limited time. Since each request carries its own payment, a Brave Search API account is no longer needed to use the service.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;— &lt;a href="https://brave.com/blog/search-api-agentic-payments/"&gt;The Brave Search API now accepts agentic payments via the x402 protocol&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Anonymous (as anonymous as blockchain can be) payments may solve the problem of the anonymous internet. You no longer need to create user accounts and prove you are human. As long as you pay for the service it does not matter. Except for &lt;a href="https://wiki.alcidesfonseca.com/blog/age-verification-in-operating-systems-and-the-internet/"&gt;age verification, which is still a problem&lt;/a&gt;. But it solves the lack of monetization of past-user-facing services that are now MCP providers and APIs. And at the same time it might also help prevent DDoS attacks from LLM crawlers, such as the ones this website has been suffering from (Hello dear Singaporean bots!).&lt;/p&gt;
&lt;p&gt;Brave will be using the &lt;a href="https://x402.org"&gt;x402 protocol&lt;/a&gt;, which I was unaware of, despite knowing &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/402"&gt;the 402 error code&lt;/a&gt;. That protocol is not yet widespread, but if bigger players start adopting it, maybe with an Apple Pay-like authorization prompt guard railing agentic purchases, we might see it succeed soon.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Fri, 13 Nov 2026 10:09:37 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/micro-transactions-on-the-web?utm_source=rss_all</guid></item><item><title>A review of Djinnlang</title><link>https://wiki.alcidesfonseca.com/research/review/a-review-of-djinnlang?utm_source=rss_all</link><description>

&lt;p&gt;As I'm losing my faith in organized peer review, &lt;a href="https://wiki.alcidesfonseca.com/blog/being-an-incentive-being-an-obstacle-being-values/"&gt;I've decided to take matters in my own hands&lt;/a&gt; and I'm doing distributed, post-publication peer-review.&lt;/p&gt;
&lt;p&gt;Today's paper is &lt;a href="https://arxiv.org/pdf/2609.23954v1"&gt;Djinnlang: Higher-Level Programming by Unambiguous Specification with an LLM in the Compiler&lt;/a&gt; by &lt;a href="https://henniger.dev"&gt;Simon Henniger&lt;/a&gt;, &lt;a href="https://people.seas.harvard.edu/~chong/"&gt;Stephen Chong&lt;/a&gt; and &lt;a href="https://namin.seas.harvard.edu"&gt;Nada Amin&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://wiki.alcidesfonseca.com/blog/full-stack-verification-is-the-new-trend/"&gt;In a time that people are relying on LLM agents to implement and verify their code&lt;/a&gt;, it is natural that people think of implementation source code as the new assembly: it will never be read, just produced by the new compilers, LLMs.&lt;/p&gt;
&lt;p&gt;Djinn takes this approach: users only write specifications, and the compiler will write the source code and verify it. This part is not news.&lt;/p&gt;
&lt;p&gt;The part that I found interesting that hadn't occurred to me is the unambiguity property of the specification (&lt;em&gt;not the code's&lt;/em&gt;). If a specification allows for two implementations that return different values, the specification is wrong. Of course, if two implementations (say quick and merge sort) yield the same results, then the specification is correct and the compiler will produce a working implementation and verify it. If it can, because LLMs produce no guarantees, unlike classical compilers.&lt;/p&gt;
&lt;p&gt;The paper then goes on to separate functions, procedures and relations, similarly to how &lt;a href="https://lean-lang.org/doc/reference/latest/The-Type-System/Functions/"&gt;Lean has partial&lt;/a&gt;, &lt;a href="http://ucsd-progsys.github.io/liquidhaskell-tutorial/Tutorial_06_Measure_Bool.html"&gt;liquid types have measures&lt;/a&gt; and &lt;a href="https://ucsd-progsys.github.io/liquidhaskell-tutorial/Tutorial_11_Case_Study_Pointers.html"&gt;handle monads&lt;/a&gt;. These are details that are interesting only to those implementing a similar system, but not crucial to the main idea.&lt;/p&gt;
&lt;p&gt;Overall, I think the idea of functional determinism is interesting for a specification. We actually need more techniques to validate the consistency of specifications, since that's how a lot of programming might be done in the near future.&lt;/p&gt;
&lt;p&gt;But as someone who has been implementing &lt;a href="https://wiki.alcidesfonseca.com/blog/how-to-express-intent-in-aeon/"&gt;a language that allows users to only write specifications&lt;/a&gt;, I'm not sure we only care about functional correctness, and that mainstream developers will write specifications as opposed to natural language. Despite my language supporting expressing logic-based requirements, examples, tests, property-based testing, and optimization metrics, I'm more and more convinced no one will read them. In the whole Requirements-Archicture-Design-Implementation-Testing/Verification-Validation, I think humans will stay at Requirements and Validation level, and everything else will be automated.&lt;/p&gt;
&lt;p&gt;Overall impression: excellent idea of making specification unambiguous as a requirement. I would probably reduce the paper to two pages (intro and Figure 1 focused on the max_is_unambiguous). I don't see much value for the overall audience in the rest of the paper. It can be a technical annex or documentation in the repo for those of us implementing these approaches. Shorter and more focused papers are better and take nothing away from the core idea.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Thu, 12 Nov 2026 13:27:53 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/research/review/a-review-of-djinnlang?utm_source=rss_all</guid></item><item><title>Jailbreaking for kids</title><link>https://wiki.alcidesfonseca.com/blog/jailbreaking-for-kids?utm_source=rss_all</link><description>

&lt;p&gt;Pamela Fox published &lt;a href="https://pamelafox.github.io/my-py-talks/impact-of-ai-on-cs-ed/#/27"&gt;her slide deck on what we need to change in the way we teach CS&lt;/a&gt; all across the  different age ranges, starting from primary school and going up to the university degree.&lt;/p&gt;
&lt;p&gt;Some of my colleagues were in disbelief that she included "Understanding how AI works" as a primary school objective.&lt;/p&gt;
&lt;p&gt;Just like you can't prevent teenagers from lying about their birthdate and getting access to porn, you will not be able to prevent kids from using AI models, especially if Big Tech has their way with it and every product in your household is infused with a chatbot/agent.&lt;/p&gt;
&lt;p&gt;The best way to make AI safe for kids is through education. You need to teach kids how AI works, and what its limits are and what you can do safely or not.&lt;/p&gt;
&lt;p&gt;Dale Lane has this awesome project called &lt;a href="https://machinelearningforkids.co.uk"&gt;Machine Learning for Kids&lt;/a&gt; where kids can write ML and AI applications using a scratch-like programming environment.&lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/crLL-yEntcM?si=D0XE-BeKolU4sJUf" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""&gt;&lt;/iframe&gt;

&lt;p&gt;In today's video, Dale goes through jailbreaking, where the agent is supposed to keep a password protected, and the user tries different things to extract that password from a weak-willed agent.&lt;/p&gt;
&lt;p&gt;So yes, you can teach primary school kids how AI works. And we should be doing this right now, not in a couple of years.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Tue, 10 Nov 2026 09:38:23 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/jailbreaking-for-kids?utm_source=rss_all</guid></item><item><title>Can you leave a 5 star review?</title><link>https://wiki.alcidesfonseca.com/blog/can-you-leave-a-5-star-review?utm_source=rss_all</link><description>

&lt;p&gt;&lt;img alt="Wizard of Id's take on reviews" src="https://cdn.alphacomedy.com/16/2026/11_05_26_bf135851531d6c20a4b534392204dcae.jpg"&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.creators.com/read/wizard-of-id/11/26/425860"&gt;Wizard of Id&lt;/a&gt; pulls a &lt;a href="https://www.imdb.com/title/tt5497778/"&gt;Black Mirror&lt;/a&gt;.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Sat, 07 Nov 2026 12:49:50 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/can-you-leave-a-5-star-review?utm_source=rss_all</guid></item><item><title>Full-stack verification is the new trend</title><link>https://wiki.alcidesfonseca.com/blog/full-stack-verification-is-the-new-trend?utm_source=rss_all</link><description>

&lt;p&gt;There have been several recent announcements about formal verification of software and hardware, both using AI and for AI systems:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.harmonic.fun/"&gt;Harmonic&lt;/a&gt; announced last week that they are using &lt;a href="https://www.harmonic.fun/news/aristotle-software-hardware-verification/"&gt;their agent Aristotle for scalable verification of both software and hardware&lt;/a&gt;. For example, in a C library for big-number arithmetic, it was able to fix bugs and prove that a faster version was equivalent to the original. The person whose work I particularly follow in this area is &lt;a href="https://satnam6502.github.io/bio/"&gt;Satnam Singh&lt;/a&gt;, who has worked on hardware verification for several years.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://sf-tensor.com/"&gt;SF-Tensor&lt;/a&gt; announced that they were &lt;a href="https://sf-tensor.com/engineering/formalizing-ptx"&gt;formalizing NVIDIA’s PTX language&lt;/a&gt; in Lean to prove the correctness of GPU kernels. SF-Tensor was founded by three brothers at the age of 19, after they had completed their BSc degrees at 16 while attending high school.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://andtruth.com/"&gt;&amp;amp;Truth&lt;/a&gt; &lt;a href="https://andtruth.com/press/andtruth-emerges-from-stealth/"&gt;came out of stealth&lt;/a&gt;, announcing plans to use Lean to prove the correctness of AI-generated software. Key people involved include &lt;a href="https://engineering.stanford.edu/people/clark-barrett"&gt;Clark Barrett&lt;/a&gt;, known for his work on cvc5 and CSLib; &lt;a href="https://ilyasergey.net"&gt;Ilya Sergey&lt;/a&gt;, known for Veil and his work on verification using separation logic; and &lt;a href="https://sebasti.a.nullri.ch"&gt;Sebastian Ullrich&lt;/a&gt;, Lean’s second-in-command.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://theorem.dev/"&gt;Theorem.&lt;/a&gt; and &lt;a href="https://www.anthropic.com/"&gt;Anthropic&lt;/a&gt; worked together on &lt;a href="https://www.anthropic.com/research/formal-verification"&gt;verifying open-source software running on a RISC-V processor&lt;/a&gt;. Their work covered encode–decode round-tripping, idempotence, algebraic laws, differential testing, self-consistency, and equivalence to reference implementations. They also proved &lt;a href="https://theorem.dev/blog/proving-agent-sandboxes/"&gt;isolation properties of a sandbox built on the xv6 academic kernel&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://autoresearch.inc/blog/"&gt;AutoResearch.inc&lt;/a&gt; has also &lt;a href="https://x.com/deepmatmul/status/2118066073626939706?a=UP1uXguDuLKCI3pGUeY&amp;amp;s=46"&gt;announced they have verified 7 web assembly tools&lt;/a&gt; down to ELF and sys calls (on x86-64 and RISC-V).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The common factor in these announcements is the goal of achieving full-stack formalization, either across the software stack or across a combination of software and hardware. In the past, verification was performed only on a small core of the software or on a simplified model of the actual software.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Verification Alternatives Diagram _ ai generated" src="/media/images/verification_diagram.png"&gt;&lt;/p&gt;
&lt;p&gt;For reference, AWS’s access-control language, Cedar, had a Rust implementation running in production and a reference implementation—first in Dafny and later in Lean—that was verified for correctness.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;One approach would be to develop Cedar entirely in Lean, compile to C, and deploy the generated C code in production. In addition to the formal model, we would write an optimized and full-featured implementation (which handles errors and messages more carefully, provides parsers for various formats, etc.) in Lean, and then prove the two equivalent. A key benefit of this approach is that we would formally verify—rather than just test—the equivalence of the deployed code and model. But there are significant downsides to writing production applications in Lean and deploying its generated C code. Lean is a new programming language, so it has a limited developer pool and lacks useful libraries available in mainstream languages. Debugging a failure might necessitate stepping through the generated C code and mapping it back to the Lean source, requiring expertise in C and Lean. Doing so could be particularly difficult if the failure is due to an interaction between handwritten code and Lean-generated C code. In addition, C is a memory-unsafe language, so a bug in the Lean compiler could lead to security issues.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;— &lt;a href="https://arxiv.org/html/2407.01688v1"&gt;How We Built Cedar: A Verification-Guided Approach&lt;/a&gt; (April 2024)&lt;/p&gt;
&lt;p&gt;Over the past year, I have been talking about liquid types as my personal preference for program verification. Liquid types are a restricted form of value-dependent types whose constraints can be checked automatically using &lt;a href="https://wiki.alcidesfonseca.com/blog/another-puzzle-z3/"&gt;SMT solvers&lt;/a&gt;. This is my sweet spot: you get much of the benefit of an expressive type system in which you can express properties such as &lt;a href="https://liquid-java.github.io/"&gt;typestate&lt;/a&gt;, preventing methods from being called when an object is in the wrong state—for example, calling &lt;code&gt;read()&lt;/code&gt; after &lt;code&gt;close()&lt;/code&gt;. And it comes at a much lower cost, especially because you do not have to write the proofs: the SMT solver takes care of that.&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="Liquid types are less expressive than full dependent types" src="https://wiki.alcidesfonseca.com/media/images/language_spectrum.png"&gt;&lt;/p&gt;
&lt;p&gt;Until a few months ago, this trade-off was very important: very few people in the world had the expertise and time to undertake the full verification of a large open-source project (props to the &lt;a href="https://sel4.systems"&gt;seL4&lt;/a&gt; folks!). Frontier models’ superhuman ability to generate proofs has since eroded this moat, and subsidized token prices make this the perfect time to conduct these experiments. I have to admit that the image above, which I used in my recent slides, might no longer make sense. It might become relevant again when token prices rise—probably to reflect their actual costs—and we need to save time and tokens while still verifying properties we care about, without going all the way down to the machine-code level.&lt;sup id="fnref:2"&gt;&lt;a class="footnote-ref" href="#fn:2"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Right now, if we pursue full-stack verification, we might need to write code in a verification-first language like Lean. Dafny and my own &lt;a href="https://github.com/alcides/aeon"&gt;aeon&lt;/a&gt; could be candidates, but Lean’s functional programming model and the substantial funding the project receives make it the ideal candidate. Rocq enthusiasts might not like it, but extracting executable code to OCaml is not such a significant advantage in the real world.&lt;/p&gt;
&lt;p&gt;But we need Lean to improve. Above all, we need faster type checking and a much better optimizer. That’s the part that &lt;a href="https://bend2.dev/notes/what-is-bend2/"&gt;Bend2&lt;/a&gt; got right from the start—the next mainstream language will require both verification and speed.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;Using proof combinators, you can use LiquidHaskell to achieve the same expressive power as Lean. Conversely, you can use Lean with only the &lt;code&gt;grind&lt;/code&gt; tactic to achieve the same lower cost as liquid types. Here, I am considering each as it is typically used.&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;I am convinced that people will not read the source code and will instead rely on new techniques to establish confidence in the generated code.&amp;#160;&lt;a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Wed, 04 Nov 2026 23:59:50 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/full-stack-verification-is-the-new-trend?utm_source=rss_all</guid></item><item><title>How to express intent in aeon</title><link>https://wiki.alcidesfonseca.com/blog/how-to-express-intent-in-aeon?utm_source=rss_all</link><description>

&lt;p&gt;I started developing &lt;a href="https://github.com/alcides/aeon"&gt;Aeon&lt;/a&gt; back in 2018 as a playground for program synthesis. Holes (&lt;code&gt;?x&lt;/code&gt;) are valid expression in aeon (&lt;code&gt;def f (i:Int) : Int := i * 2 + ?x&lt;/code&gt; compiles successfully and, when ?x is evaluated at runtime, it opens a repl asking the user for the right expression). However, the main advantage of holes is when you run the aeon compiler with "--synthesizer", it tries to find a suitable expression for the holes in your program. This blog post covers the different methods you have to describe what you want a function to do. We've decided on the function-level for the specification as it is the most normal public (and private) API of your code.&lt;/p&gt;
&lt;h1&gt;Basic Types&lt;/h1&gt;
&lt;p&gt;Aeon is a (very strongly) typed language, so you always need to write the types of top-level functions.&lt;sup id="fnref:1"&gt;&lt;a class="footnote-ref" href="#fn:1"&gt;1&lt;/a&gt;&lt;/sup&gt; As such, all proposed candidate expressions to replace &lt;code&gt;?hole&lt;/code&gt; need to type-check. So writing &lt;code&gt;Int&lt;/code&gt; as the return type already specifies something about the missing code.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def double (x:Int) : Int := ?hole
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img alt="Synthesis menu in VSCode for this simple hole" src="https://wiki.alcidesfonseca.com/media/images/aeon_synth.png"&gt;&lt;/p&gt;
&lt;h1&gt;Liquid Types&lt;/h1&gt;
&lt;p&gt;Aeon supports liquid types by refining a basic type with a predicate. In the case below we refine the returning type of the function &lt;code&gt;Int&lt;/code&gt; with the predicate that it needs to be equal to twice the value of &lt;code&gt;x&lt;/code&gt;. Because Liquid Types can refer to other values in the program (such as function arguments), they are (value-)dependent types, but following a different discipline than the (full) dependent types you find in Lean, Rocq or Idris. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def double (x:Int) : {r:Int | r == x + x} := ?hole
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So far, this definition covers both Refinement Types and Liquid Types. The main distinction of the two is that the refinements in Liquid Types need to be drawn from a decidable logic, so an SMT solver can give you a definitive answer of whether it type checks or not.&lt;/p&gt;
&lt;p&gt;Liquid types guide synthesis directly in approaches such as &lt;a href="https://cseweb.ucsd.edu/~npolikarpova/publications/pldi16.pdf"&gt;Synquid&lt;/a&gt; and &lt;a href="https://arxiv.org/abs/2605.13456"&gt;Liquid Tree Automata&lt;/a&gt;. In Aeon, their logical predicates can also be translated into constraints for SMT solving with &lt;a href="https://www.microsoft.com/en-us/research/publication/z3-an-efficient-smt-solver/"&gt;Z3&lt;/a&gt;, &lt;a href="https://www.cis.upenn.edu/~alur/SyGuS13.pdf"&gt;syntax-guided synthesis (SyGuS)&lt;/a&gt;, &lt;a href="https://arxiv.org/abs/2209.03602"&gt;polynomial synthesis&lt;/a&gt;, and &lt;a href="https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.CP.2023.3"&gt;OR-Tools’ CP-SAT solver&lt;/a&gt;. Liquid Types are also used in our &lt;a href="https://link.springer.com/chapter/10.1007/978-3-030-58115-2_2"&gt;own custom synthesis algorithms that combine evolutionary search and liquid types&lt;/a&gt;.&lt;/p&gt;
&lt;h1&gt;Natural language documentation&lt;/h1&gt;
&lt;p&gt;Aeon also supports AeonDoc, using the &lt;code&gt;@doc&lt;/code&gt; decorator to annotate a natural-language description of the function. We can take this documentation as input to a synthesis method (currently, only LLM-based synthesizers support @doc). This documentation complements any type that constrains the hole already.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@doc(&amp;quot;Doubles the input.&amp;quot;)
def double (x:Int) : Int := ?hole
&lt;/code&gt;&lt;/pre&gt;
&lt;h1&gt;Examples or test cases.&lt;/h1&gt;
&lt;p&gt;Aeon supports the decorator &lt;code&gt;@example&lt;/code&gt; that takes a boolean predicate about the execution of the final synthesized function.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@example(double 3 = 6)
@example(double 5 = 10)
def double (x:Int) : Int := ?hole
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Input–output examples guide many synthesis approaches: automata-based methods such as &lt;a href="https://arxiv.org/abs/1710.07740"&gt;AFTA&lt;/a&gt; use them to prune spaces of candidate programs; top-down methods such as &lt;a href="https://www.cis.upenn.edu/~stevez/papers/OZ15.pdf"&gt;Myth&lt;/a&gt; or &lt;a href="https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeRegressor.html"&gt;Decision Trees&lt;/a&gt; propagate examples into smaller synthesis subproblems; and bottom-up methods such as &lt;a href="https://arxiv.org/abs/2007.14381"&gt;BUSTLE&lt;/a&gt; compose programs from smaller expressions evaluated on those examples. Examples also define fitness functions for &lt;a href="https://www.cs.hamilton.edu/~thelmuth/Pubs/2015-GECCO-benchmark-suite.pdf"&gt;genetic programming&lt;/a&gt; and provide training data for &lt;a href="https://www.routledge.com/Classification-and-Regression-Trees/Breiman-Friedman-Olshen-Stone/p/book/9780412048418"&gt;decision-tree learning&lt;/a&gt;, which learns conditional rules mapping inputs to outputs.&lt;/p&gt;
&lt;p&gt;Decision Trees and Genetic Programming, coming from the Machine Learning backgrounds, assume that some examples might be wrong so they are more permissive. Other methods typically search for a solution that covers all examples. In this case, only noise-supporting methods can handle contradictory examples.&lt;/p&gt;
&lt;p&gt;Because writing examples can be tedious, you can use CSV data directly or through an auxiliary file (&lt;code&gt;@csv_data("1.0,2.0\n3.0,6.0\n4.0,8.0")&lt;/code&gt; or &lt;code&gt;@csv_file("double.csv")&lt;/code&gt;.&lt;/p&gt;
&lt;h1&gt;Optimization goals&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;@minimize_int(abs $ (double 4) - (4 * 2))
@minimize_int(abs $ (double 5) - (5 * 2))
def double (x:Int) : {r:Int | r = x + x} := ?hole
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Aeon supports multiple maximize and minimize decorators to express optimization goals. We might know a given ideal target for the minimization criteria or not (for open problems). This example is the former, where you cannot have a value lower than 0. However, if you were to maximize the return value of a function that returns prime numbers, you would have no target value.&lt;/p&gt;
&lt;p&gt;When multiple objectives are set, we consider this a multi-objective optimization problem and each algorithm typically returns the &lt;a href="https://en.wikipedia.org/wiki/Pareto_frontier"&gt;Pareto set&lt;/a&gt;, containing solutions that no other candidate is better in all axis. Genetic Programming and OR-Tools solvers have these features built-in. Recent Genetic Programming approaches have recommended &lt;a href="https://lexicase.ai"&gt;Lexicase-selection&lt;/a&gt; instead of a Pareto tournament, but my own experience does not confirm this recommendation. If you are going to evaluate all objectives, then lexicase selection might make sense, but because tournaments only evaluate one objective for few good candidates, it ends up being more computational cheaper, and more time is left for exploration.&lt;/p&gt;
&lt;p&gt;A big advantage of examples and optimization constraints over liquid types is that you can write any aeon expression that you want (such as multiplication of variables &lt;code&gt;i*j&lt;/code&gt;). Because Liquid Types are limited to decidable theories, you cannot write&lt;sup id="fnref:2"&gt;&lt;a class="footnote-ref" href="#fn:2"&gt;2&lt;/a&gt;&lt;/sup&gt; this multiplication and other types of expressions and you are limited to linear integer arithmetic, arrays, uninterpreted functions and other SMT theories.&lt;/p&gt;
&lt;h1&gt;Property-based Tests&lt;/h1&gt;
&lt;p&gt;Property-based testing is the idea that instead of writing concrete input and output examples, you write properties that relate them, and have random inputs generated to validate those properties. For me, it is very similar, if not the same, as &lt;a href="https://en.wikipedia.org/wiki/Metamorphic_testing"&gt;Metamorphic testing&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def double (x:Int) : Int := ?hole

@property(100)
def prop_double_is_bigger (x:Int | x &amp;gt; 0) : Bool := double x &amp;gt; x
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In this example, the body of the double function will have to work with 100 randomly-generated inputs and return a value that complies with the state property every single time.&lt;/p&gt;
&lt;h1&gt;Results&lt;/h1&gt;
&lt;p&gt;You can either run aeon on the command line, selecting the synthesizer method with &lt;code&gt;-s&lt;/code&gt; (&lt;code&gt;python -m aeon multi_objective.ae -s gp --budget 10&lt;/code&gt;), or use an LSP editor to ask the compiler to synthesize using a particular method. If you are using VSCode, you have an extra interface to explore program synthesis.&lt;/p&gt;
&lt;p&gt;&lt;img alt="VSCode UI for synthesizer programs" src="https://wiki.alcidesfonseca.com/media/images/aeon_full_vscode.png"&gt;&lt;/p&gt;
&lt;p&gt;The first specification yielded &lt;code&gt;def double (x:Int) : Int := 1&lt;/code&gt;, which matches exactly what we asked it to return: an Integer. When using the other specifications we got a variety of solutions: &lt;code&gt;x+x&lt;/code&gt;, &lt;code&gt;2*x&lt;/code&gt; and &lt;code&gt;x+x+0&lt;/code&gt;. But this is with a very simple specification that I would assume any synthesizer should be able to generate. Larger examples are left to the reader (or to the next blog post).&lt;/p&gt;
&lt;h1&gt;Non-functional requirements&lt;/h1&gt;
&lt;p&gt;All of the intent that we have expressed for far was related to functional correctness. But software developers know that non-functional properties can be equally important in some projects. As such, we are adding support for different forms of expressing quality properties. In particular, we already support &lt;code&gt;@minimize_cputime(expression)&lt;/code&gt; and &lt;code&gt;@minimize_energy(expression)&lt;/code&gt; for minimizing execution time and energy consumption respectively. Despite this support, the example above is too simple and trivial that the measurement overhead is many times that of the execution. I would only recommend using these advanced decorators for larger programs.&lt;/p&gt;
&lt;p&gt;And aeon also supports other properties, you just need to write the code that translates the candidate function into a measure of that quality, using the example or optimization decorators. &lt;/p&gt;
&lt;p&gt;Happy synthesizing!&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;This restriction comes from &lt;a href="https://doi.org/10.1561/2500000032"&gt;Liquid Types&lt;/a&gt;.&amp;#160;&lt;a class="footnote-backref" href="#fnref:1" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:2"&gt;
&lt;p&gt;Actually you can, but you will get a warning. This is an UX improvement we are making based on &lt;a href="https://dl.acm.org/doi/10.1145/3729327"&gt;our paper on challenges of Liquid Types adoption&lt;/a&gt;.&amp;#160;&lt;a class="footnote-backref" href="#fnref:2" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Tue, 03 Nov 2026 13:35:15 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/how-to-express-intent-in-aeon?utm_source=rss_all</guid></item><item><title>Habitação Insustentável em Portugal</title><link>https://wiki.alcidesfonseca.com/blog/habitacao-insustentavel-em-portugal?utm_source=rss_all</link><description>

&lt;p&gt;A realidade da habitação em Portugal é completamente fora deste mundo. A minha geração e a mais nova não consegue pagar o custo que a habitação tem sido nas grandes cidades, nem no Algarve.&lt;/p&gt;
&lt;p&gt;O &lt;a href="https://www.linkedin.com/in/ivobernardo"&gt;Ivo Bernardo&lt;/a&gt; fez &lt;a href="https://thedatajourney.substack.com/p/the-housing-crisis-in-europe-part"&gt;uma análise da situação da habitação em Portugal&lt;/a&gt;, baseado em números públicos de uma variedade de fontes.&lt;/p&gt;
&lt;p&gt;&lt;img alt="Data on Housing costs, considering cost of living" src="https://substackcdn.com/image/fetch/$s_!cmrC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69189565-1c3f-4a9d-9dd5-222815c97d3f_1491x658.png"&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Public housing: this is where the data sides most with the protesters. Social rental housing is 1.1% of dwellings in Portugal, against an EU average of 8%. At €150,000 per home, 3% financing and public land, a cost-rent home in Lisbon breaks even at about €10.9/m² a month, 35% below the city’s median new rent. It can almost pay for itself exactly where it’s needed most. Remember the €1.74 billion NHR cost in 2024? That’s roughly 11,600 of those homes. In one year.&lt;/li&gt;
&lt;li&gt;Vacant homes: worth chasing, in the right places. The 100,000-plus recoverable homes in pressure municipalities are real.&lt;/li&gt;
&lt;li&gt;Limiting investment funds: I can’t back it or reject it, because the data doesn’t exist. Before we legislate, we need to measure.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;— &lt;a href="https://thedatajourney.substack.com/p/the-housing-crisis-in-europe-part"&gt;The housing crisis in Europe pt1&lt;/a&gt; by Ivo Bernardo&lt;/p&gt;
&lt;p&gt;Por sua vez, o &lt;a href="https://joaotome.com"&gt;João Tomé&lt;/a&gt; usa também dados reais para &lt;a href="https://joaotome.com/data-stories/casas-vazias"&gt;analisar a questão das casas vazias&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Em 2021, quase 249 mil casas estavam vagas por outros motivos, fora do mercado, em edifícios sem necessidade de reparação ou apenas com reparações ligeiras. Os dados ajudam a localizar uma possibilidade de resposta à falta de habitação. Ainda não dizem quantas dessas portas se podem abrir. As experiências de outros países ajudam a escolher o que tentar: apoiar obras, gerir o arrendamento e reforçar a oferta nas zonas com procura.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;— &lt;a href="https://joaotome.com/data-stories/casas-vazias"&gt;Quantas casas vazias podem voltar a ter gente?&lt;/a&gt; por João Tomé&lt;/p&gt;
&lt;p&gt;O artigo inclui ainda uma tabela com referências para medidas que foram implementadas noutros países e os resultados.&lt;/p&gt;
&lt;p&gt;De ambos os estudos, a minha conclusão é que precisamos de mais construção e reabilitação, precisamos de melhores números e acompanhamento da situação e, sobretudo, precisamos de descentralizar a população nas grandes áreas metropolitanas.&lt;/p&gt;
&lt;p&gt;Infelizmente, manifestações de tendas dão-me pouca confiança que algo vá mudar. Mas termos novas iniciativas políticas que trabalhem estes desafios parece-me algo com maior probabilidade de funcionar. &lt;a href="https://pt.euronews.com/2026/10/26/lista-de-estudantes-vence-eleicoes-servias-num-terramoto-politico-vucic-admite-derrota"&gt;O resultado na Sérvia de um movimento estudantil ganhar as eleições inspira-me confiança&lt;/a&gt;, mas não podemos ter a taxa de abstenção que tem sido habitual no nosso país.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Tue, 27 Oct 2026 14:26:59 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/habitacao-insustentavel-em-portugal?utm_source=rss_all</guid></item><item><title>Training people in AI Safety</title><link>https://wiki.alcidesfonseca.com/blog/training-people-in-ai-safety?utm_source=rss_all</link><description>

&lt;p&gt;As AI technology gets adopted at a never-seen pace, we also need more people to work on AI Safety to make sure that AI applications are actually safe and aligned.&lt;/p&gt;
&lt;p&gt;Because AI generates content and decisions faster than humans, this is a very interesting research problem: humans cannot verify AI alone, so we need smarter technology to do it.&lt;/p&gt;
&lt;p&gt;In the interview below &lt;a href="https://ryankidd.ai"&gt;Ryan Kidd&lt;/a&gt;, the CEO of &lt;a href="https://www.matsprogram.org"&gt;MATS&lt;/a&gt;, talks about the efforts they (and others) are doing to train people in AI Safety. Throughout the conversation he also addresses how many of these AI Safety companies/non-profits have been founded, and even goes into neural networks vs evolutionary algorithms. &lt;/p&gt;
&lt;iframe width="560" height="315" src="https://www.youtube.com/embed/fqCKS6U3S68?si=sddWbMSErDEF6HsH" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""&gt;&lt;/iframe&gt;

&lt;p&gt;But &lt;a href="http://wiki.alcidesfonseca.com/tag/ai-safety"&gt;AI Safety&lt;/a&gt; is a very large umbrella that encompasses soft skills like Policy Making and writing &lt;a href="https://huggingface.co/docs/hub/en/model-cards"&gt;Model Cards&lt;/a&gt; to more technical challenges like &lt;a href="https://already-clean.goodfire.com"&gt;interpreting neural networks&lt;/a&gt; or &lt;a href="https://wiki.alcidesfonseca.com/blog/lessons-learned-building-fronteira/"&gt;building guardrails&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;a href=""&gt;Ankur Pandey&lt;/a&gt; argues that &lt;a href="https://abnormaltech.substack.com/p/the-case-for-building-ai-safety-tools"&gt;AI Safety training is not focusing on building tools&lt;/a&gt; and that's probably where the gains are for society. I actually believe existing researchers from technical domains (like formal verification) are equipped to build the tools, they just need funding and support. As an example, &lt;a href="https://www.harmonic.fun"&gt;Harmonic&lt;/a&gt; has been doing interesting stuff recently and I know they recruited the right people.&lt;/p&gt;
&lt;p&gt;Unfortunately for those of us who do not want to relocate, many of these AI Safety companies are in-person in Berkeley, DC, Cambridge, NYC and London (with India and Singapore also investing in these areas). If I was funding these efforts, I would hire remotely and I would try to get funding from NATO/EU/UNESCO and other multinational organizations.&lt;/p&gt;
&lt;p&gt;As for training, I think we should make sure that all universities offer an AI Safety course at least at the Masters level, but here I am, daydreaming again.&lt;/p&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Alcides Fonseca</dc:creator><pubDate>Tue, 27 Oct 2026 12:36:05 +0000</pubDate><guid>https://wiki.alcidesfonseca.com/blog/training-people-in-ai-safety?utm_source=rss_all</guid></item></channel></rss>