Earlier quoted context omitted.
Clojure Spec has it https://clojure.org/about/spec#_global_namespaced_names_are_...
To me Clojure Spec is more like IDL or a JSON Schema (or CBOR or Protobuf or etc), but with more "dynamic" stuff as opposed to just sum/product types. It doesn't occupy the same space as, say, TLA+.
Why Specifications Don't Compose
41–50 of 65 posts
Re: Why Specifications Don't Compose
#42Earlier quoted context omitted.
Sure but do you have formal model of such a system that is sound? I think unstated is that LTT is a known, intuitive, and well understood model. Sure you can ad hoc a fix but will it have any rigor?
That's the trade-off. Either you have things simple or expressive. But I'm strong supporter of approach where you start with the semantics you want and work hard to make it work as opposed to simple to implement semantics you don't want because it makes programming harder. I prefer TypeScript approach than C++ one.
Re: Why Specifications Don't Compose
#43This is blatantly false. People are using formal verification tools in hardware design, and they do work and they do compose. Here is a simple verilog code which accomplishes some of what he wants. module Blinker ( input wire clock, output reg state ); always @(posedge clock) state Of course you NEED clock wires to the blinker. Composability comes from the use of assume and assert. You assume that your environment is…
Re: Why Specifications Don't Compose
#44Earlier quoted context omitted.
To me Clojure Spec is more like IDL or a JSON Schema (or CBOR or Protobuf or etc), but with more "dynamic" stuff as opposed to just sum/product types. It doesn't occupy the same space as, say, TLA+.
Clojure Spec is a contract system, which is a common way to write code specifications. You can formally verify it in theory; ACL2, another lisp, is used in formal verification. It's also hard to compose formally-verified code, as Lars talks about in the original link.
Re: Why Specifications Don't Compose
#45Earlier quoted context omitted.
That's the trade-off. Either you have things simple or expressive. But I'm strong supporter of approach where you start with the semantics you want and work hard to make it work as opposed to simple to implement semantics you don't want because it makes programming harder. I prefer TypeScript approach than C++ one.
Then you've left the realm of formal specification of systems, though, so you're entirely outside the scope of the problem.
And it will most likely be somewhere between practical but unsound specification languages and those that come from pure mathematics.
Re: Why Specifications Don't Compose
#46Earlier quoted context omitted.
Then you've left the realm of formal specification of systems, though, so you're entirely outside the scope of the problem.
No. I haven't left anything. I'm just saying that expecting that useful widespread formal specification language will be something as simple as LTT is wildly optimistic and you should expect that it will rather mirror and encompass the complexities and requirements of actual programming, like necessity of composability. And it will most likely be somewhere between practical but unsound specification languages and tho…
Switching to a different notation helps with some of the practical details, but doesn't remove the essential problems that arise in composing specs.
Re: Why Specifications Don't Compose
#47Earlier quoted context omitted.
I read this as the "specifications" in "requirements and specifications" for e.g. software projects. For example, "there should be a button that pulls in new data when clicked". That's generally pretty different from formal/mathematical specifications.
I’d suggest that they are in fact the same thing, and differ only in the level of formality... somewhat akin to the difference between machine code and interpreted scripts.
David Chapman makes a distinction between rational and reasonable behavior, and it’s more like his “making breakfast” example:
Re: Why Specifications Don't Compose
#48Earlier quoted context omitted.
For behavioural correctness of terminating functional programs, you can by and large treat your programs as plain mathematical functions. Then reasoning about them is as easy (or more likely, as hard) as ordinary math. If you want to reason about the performance of functional programs, or about the behaviour of imperative/concurrent programs, then you need more sophisticated techniques. But even in this case, specifi…
But the article doesn't deal with the possibility/impossibility of verification at all. It deals with the fact that (some?) specifications don't compose elegantly. That is, that a sufficient specification for System A and a sufficient specification for System B can't be trivially composed into a sufficient specification for a System C = System A + System B. That's not to say that System C can't be specified, but that…
Re: Why Specifications Don't Compose
#49All this is saying is you can't compose behaviors because we insist on having only one whole state, and only one concept of what 'next' state is. If you can have state with sub-states and 'next' operator that is respective to what sub-state we want to address then this example is easily composable. But then of course you might want to have substates interact with each other so it complicates further. It just looks li…
Sure but do you have formal model of such a system that is sound? I think unstated is that LTT is a known, intuitive, and well understood model. Sure you can ad hoc a fix but will it have any rigor?
Re: Why Specifications Don't Compose
#50Earlier quoted context omitted.
No. I haven't left anything. I'm just saying that expecting that useful widespread formal specification language will be something as simple as LTT is wildly optimistic and you should expect that it will rather mirror and encompass the complexities and requirements of actual programming, like necessity of composability. And it will most likely be somewhere between practical but unsound specification languages and tho…
I used LTL because it's simple enough to explain the core ideas without getting bogged down in affordances and details. It's purely a pedagogical choice, just like how nobody explains the halting problem in terms of Java. Switching to a different notation helps with some of the practical details, but doesn't remove the essential problems that arise in composing specs.