Ben Pfaff
Ben Pfaff
The following program: ``` input relation X(x: bit, y: bit) output relation Y(x: bit, y: bit, z: bit) Y(x, y, x
I consistently get the following linker error on two different Fedora systems with tip of master: ``` /home/bpfaff/.stack/programs/x86_64-linux/ghc-tinfo6-8.8.4/lib/ghc-8.8.4/unix-2.7.2.2/libHSunix-2.7.2.2.a(Files.o):ghc_2.c:function ghczuwrapperZC1ZCunixzm2zi7zi2zi2ZCSystemziPosixziFilesZCmknod: error: undefined reference to '__xmknod' ``` It works OK if I...
The following program: ``` function f(): string { "mystring" } output relation X(x: string) X("${f}"). ``` yields this output: ``` X: X{.x = ""}: +1 ``` Of course, what I...
The following binds `s` twice to different elements of the tuple inside the `match`: ``` function foo(a: string, b: string): string { match ((a, b)) { (s, s) -> s...
String interpolation in DDlog requires inner quotation marks to be backslashed, like this: ``` "${foo(\"bar\")}" ``` Other languages tend to use a different syntax that can avoid the need for...
It could be expressed as `for (value in set)` or `for (value in FlatMap(set))` if the former seems too terse for some reason.
Rust has a syntactic construct "if let": https://doc.rust-lang.org/stable/rust-by-example/flow_control/if_let.html. This would be useful in DDlog as well. It would simplify commonly found patterns in OVN like this: ``` match (set_nth(acl.name, 0))...
The following code: ``` relation X(a: Option, b: Set, c: string) relation Y(d: string) for (X(a, b, c)) { Some{var d} = match (a) { Some{_} -> set_nth(b, 0), None...
I initially found it surprising that there's nothing that goes after a relation declaration to terminate it or to separate it from the next declaration. Even now, I occasionally find...
In DDlog, as in Datalog, variable declarations are often implicit. Sometimes this can lead to pitfalls. For example, it has happened to me a couple of times that I deleted...