laurent.orseau
2021-1-16 09:37:29

This is very nice! It seems to me it shouldn’t be too hard to accompany at least some refactor rules (such as this one) with a short proof of correctness, maybe under some high level assumptions.

@sorawee do you think that would be feasible, or am I overlooking some difficulty?


notjack
2021-1-16 09:57:50

You mean like, an informal proof written down in comments? Or using some sort of formal theorem prover?


laurent.orseau
2021-1-16 10:31:17

The more formal the merrier, but an informal proof would certainly be a great start


laurent.orseau
2021-1-16 10:31:56

For example, if one expands into the other, or they both (at some point) expand into the same thing, then you’re done


dvanhorn
2021-1-16 14:57:39

Does anyone know how to track down or resolve a Redex pict font issue? I use GH actions (so Ubuntu) to build a scribble document that has Redex rendered picts which use unicode characters like 𝑨. But whatever font redex is using doesn’t seem to render correctly and I get a mystery unicode box instead.


dvanhorn
2021-1-16 14:59:14

shu--hung
2021-1-16 15:00:22

I think one thing to try is to see if (text "UNICODE") or so can work for this text function https://docs.racket-lang.org/pict/Basic_Pict_Constructors.html?q=text#%28def._%28%28lib._pict%2Fmain..rkt%29._text%29%29 then the “style” argument in Redex can be configured using the metafunction-style parameters (ant other *-style parameters)


shu--hung
2021-1-16 15:06:28

Are you using a rewriter here, or the judgment itself has that unicode name?


dvanhorn
2021-1-16 15:11:54

no rewriter (in this case); the relation is named 𝑨. So the complete code here is just @(define-judgment-form A #:mode (𝑨 I O) #:contract (𝑨 e i) [---------- (𝑨 (Int i) i)]) @(centered (render-judgment-form 𝑨))


dvanhorn
2021-1-16 15:22:23

I appreciate the suggestions, but I guess what I am really looking for is some idea on how to fix the problem at the level of the font on this system. I’d rather not change the code.


shu--hung
2021-1-16 15:33:16

From what I tried here, the default font of metafunction-style is 'swiss, which maps to Helvetica by default. This is as far as I find get to.

Sorry I that wasn’t able to offer more help.


dvanhorn
2021-1-16 16:26:34

thank you!


camoy
2021-1-16 16:33:57

As a side note you can set the Redex font style parameters to a comma-separated string of font names and it will use it as a fallback in case earlier ones don’t define a character (just like CSS’s font-family).


jestarray
2021-1-16 16:41:57

windows 10 on racket 8.0 cs snapshot from yesterday


dvanhorn
2021-1-16 19:48:48

ok, it turned out to be pretty tricky to find a font that worked for this, but I was eventually able to install the fonts-stix package and set the metafunction-style to "STIX Two Math" and things work. Phew.


kellysmith12.21
2021-1-16 21:48:24

I’ve noticed that rename-contract doesn’t work on all contracts. For example, (rename-contract boolean? 'foo) appears to do nothing, as the contract prints as boolean? Could someone please clarify this behavior?


notjack
2021-1-17 00:51:31

I wouldn’t be surprised if that’s just a bug


kellysmith12.21
2021-1-17 01:48:43

That’s interesting: only boolean? is unaffected by rename-contract.


notjack
2021-1-17 02:45:15

Does procedure-rename work? Also, is this on Racket CS or on BC?


anything
2021-1-17 02:46:56

Ethereum uses a lower-level encoding called Recursive Length Prefix, or RLP. When a transaction is signed, for example, the bytes signed are the RLP-encoding of the transaction. A nice implementation of the method in ACL2, a theorem prover, has been https://arxiv.org/pdf/2009.13769\|done. I ported it to Racket for personal use: https://pastebin.com/raw/BJz8yJTt The presentation of the code can be found in this PDF. This is a first draft. My next step is to continue to write a Racket library on top of the JSON-RPC supported by Ethereum nodes.


kellysmith12.21
2021-1-17 03:03:09

procedure-rename works on boolean?; I’m using Racket CS


kellysmith12.21
2021-1-17 06:56:51

I’ve discovered that rename-contract doesn’t work as expected, for procedure contracts. Namely, the name reverts to the old ->-based name, after the contract has been attached to a value, then retrieved with value-contract.


kellysmith12.21
2021-1-17 06:57:41

Is this behavior a bug or intended?


kellysmith12.21
2021-1-17 07:43:34

That’s interesting: although the name of the contract returned by value-contract is the old name, the contract still uses the new name in the error message of a contract violation.