I’d really love to know if anyone knows of literat...
# thinking-together
o
I’d really love to know if anyone knows of literature on generating examples in mathematically robust ways. It’s hard to search for literature on this because of how Google interprets the query. I know there’s work here in formal language theory, as it’s usually straightforward to generate a sentence given a formal grammar. But I really want to know what work has been done in a more general context of mathematical structures. Questions like ” what is the simplest example of structure X” or “smallest example that can be differentiated from the others” or “simplest counter-example”. I know there’s work on example-driven programming and the like, which I assume would have some relevance, but I’ve had no luck finding much. I just have to assume that this is a question that some mathematicians somewhere have asked before.
Also, there was a talk I watched ages ago, don’t remember the context, it demonstrated a system that automatically generated the smallest possible example of an input that would break a test. I think it was probably from the functional programming folks and may have been in the context of its type system. It was super neat. Does anyone know what I’m talking about and where I might find it?
👀 1
g
is this for testing? you might find a something with quickcheck or its related research.
👍 1
o
Not for testing, looking for theoretical work as the question is relevant to my current research. QuickCheck might be what I saw before! I’ll check it out.
From the QuickCheck wiki:
assertions are written about logical properties that a function should fulfill. Then QuickCheck attempts to generate a test case that falsifies such assertions. Once such a test case is found, QuickCheck tries to reduce it to a minimal failing subset by removing or simplifying input data
totally in line with the stuff I’m looking for, thanks!
g
This reminds me of Barliman

https://www.youtube.com/watch?v=er_lLvkklsk

❤️ 1
a
Besides Quickcheck, I thought of model-checking software like Z3 (very easy to play with in Python!), Alloy, MiniZinc, maybe even TLA+. I haven't used the latter three (which are not an exhaustive list either), but they seem to be very powerful.
j
I would add Lean4 to the counter-example-finding list.
j
k
"Property-based testing" is the more general keyword to search for. QuickCheck is its best-known implementation, but theoretical work doesn't necessarily refer to it.
🙏 1
o
Hopefully ‘property-based testing’ can help me find relevant research. It still seems slightly off what I’m looking for, but it’s closer. I’m less interested in programming languages here, and hoping there’s some more general mathematical work along these lines. I’d love to have a framework to talk about things like “a tree with a branching factor of 5”, “a partially ordered set”, “a directed graph containing a subgraph that is equivalent to a binary tree” and to talk about these general kinds of structures and properties with some formal notion(s) of “examples”.
a
It sounds to me like you want to use a model-checker too. If you give one a program and a condition, they're designed to give you example states the program can get into that satisfy the condition, but they're more general than that. If you input a model that describes graphs generally, and encode a condition that corresponds to "branching factor of 5" then a model-checker will give you an example of such a graph. Many examples, if you ask for them!
🙏 1
k
Something else that might be useful is L-systems (https://en.wikipedia.org/wiki/L-system), used mainly for simulating plant growth.
BTW, I am currently exploring this space as well in the context of my digital scientific notation Leibniz. Its context definitions are meant to be minimal and thus small, so generating random terms from them could well turn out useful for understanding a scientific model.
j
Also quickspec and symbolic execution come to mind as relevant (https://hackage.haskell.org/package/quickspec-2.1.5/docs/QuickSpec.html)
k
I didn't know QuickSpec, which looks very relevant, thanks!