-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates spec with new builtins, etc. #182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are some preliminary comments, I'll probably add more once I build the spec.
@@ -30,112 +30,116 @@ | |||
|
|||
$unitval$ & \(\abs{\alpha}{\typeK{}}{\lam{x}{\alpha}{x}}\)\\\\ | |||
|
|||
$boolean$ & \(\forall \alpha :: \star.\ \alpha \to \alpha \to \alpha\)\\\\ | |||
$boolean$ & \(\forall \alpha :: \star.\ (unit \to \alpha) \to (unit \to \alpha) \to \alpha\)\\\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the implementation we dropped units and use forall a. a -> a -> a
and instantiate it with () -> a
.
\begin{landscape} | ||
\thispagestyle{empty} | ||
\begin{figure*} | ||
\hspace{-8.5cm}Let $txh$ be the transaction hash, $bnum$ be the block number, and $btime$ be the block time, all as global parameters to normalization.\vspace{1em} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we removed btime
?
& & & \wrap{\alpha}{S}{M} & \textrm{fix type's wrap}\\ | ||
\textrm{Term} & L,M,N & ::= & x & \textrm{variable}\\ | ||
& & & \con{cn} & \textrm{constant}\\ | ||
& & & \abs{\alpha}{K}{M} & \textrm{type abstraction}\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we agreed on value restriction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the abstraction? Yes, but then we unagreed because it was causing problems for @michaelpj?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, on the call where we discussed we concluded that it makes erasure easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So yeah, we're keeping the value restriction for now.
& & & \funT{A}{B} & \textrm{function type}\\ | ||
& & & \allT{\alpha}{K}{A} & \textrm{polymorphic type}\\ | ||
& & & \fixT{\alpha}{A} & \textrm{fixed point type}\\ | ||
& & & \lamT{\alpha}{K}{A} & \textrm{$\lambda$ abstraction}\\ | ||
& & & \appT{A}{B} & \textrm{function application}\\ | ||
& & & \conT{tcn} & \textrm{builtin type}\\ | ||
\textrm{Type Value} & R,S,T & ::= & \funT{S}{T} & \textrm{function type}\\ | ||
& & & \conT{tcn}{A} & \textrm{type constant}\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain what this A
is about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's for alignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which A
? There are many in the diff that I can see. :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the last shown line (I normally mean the last line if I do not specify one explicitly), i.e. the "type constant" case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I've reorgged the way builtins and constants work, so now type constants are just a name and a size (the A
arg). I would have added a signature component for them too but all type constants take size args only. If you think having a signature system would be better, let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I only had a quick look, but something is strange with this PR. It, for example, deletes docs/fomega/src/AlgTypes.hs
and touches some other files that have nothing to do with the spec. I think, something might have gone wrong in the git massaging.
@@ -1,167 +0,0 @@ | |||
{-# LANGUAGE GADTs #-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you deleting this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must have updated my fork before the most recent branch of the IOHK repo. :(
\texttt{multiplyInteger} & \forall s :: size.\ integer_s \to integer_s \to integer_s & s!i_0 , s!i_1 & s!(i_0 * i_1) & -2^{8s-1} \leq i_0 * i_1 < 2^{8s-1}\\ | ||
\texttt{divideInteger} & \forall s :: size.\ integer_s \to integer_s \to integer_s & s!i_0 , s!i_1 & s!(\operatorname{div}\ i_0\ i_1) & i_1 \not= 0\\ | ||
\texttt{remainderInteger} & \forall s :: size.\ integer_s \to integer_s \to integer_s & s!i_0 , s!i_1 & s!(\operatorname{mod} \ i_0 \ i_1) & i_1 \not= 0\\ | ||
\texttt{addInteger} & \sig{s :: size}{integer_s, integer_s}{integer_s} & s & s!i_0 , s!i_1 & s!(i_0 + i_1) & -2^{8s-1} \leq i_0 + i_1 < 2^{8s-1}\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any efficiency sacrifices in taking the size as an argument? Or is this just rewriting the LaTeX?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure what you mean; can you elaborate on precisely what change or precise part of the spec you're referring to?
& & & \funT{A}{B} & \textrm{function type}\\ | ||
& & & \allT{\alpha}{K}{A} & \textrm{polymorphic type}\\ | ||
& & & \fixT{\alpha}{A} & \textrm{fixed point type}\\ | ||
& & & \lamT{\alpha}{K}{A} & \textrm{$\lambda$ abstraction}\\ | ||
& & & \appT{A}{B} & \textrm{function application}\\ | ||
& & & \conT{tcn} & \textrm{builtin type}\\ | ||
\textrm{Type Value} & R,S,T & ::= & \funT{S}{T} & \textrm{function type}\\ | ||
& & & \conT{tcn}{A} & \textrm{type constant}\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's for alignment.
@@ -9,9 +9,9 @@ | |||
\begin{figure*} | |||
\centering | |||
\[\begin{array}{lrclr} | |||
\textrm{Type Frame} & f & ::= & \inFunTLeft{\_}{A} & \textrm{left arrow}\\ | |||
\textrm{Type Frame} & f & ::= & \inConT{tcn}{\_} & \textrm{type constant}\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we remove inFixT
? I thought it was agreed that not normalizing inside (fix a _)
was bad, and I think some of the proofs depend on being able to normalize inside them.
What is this waiting on? |
Partially clarifications from others, partially figuring out how to make sure this merges correctly. I'm going to make a new PR (I've wiped the entire repo this was pointing to so I'm not sure if this will even merge now). |
* SCP-3081 added chain-index queries for transactions at address 1. Added queries to chain index. a. Query `TxOutRef`s at address. b. Find `ChainIndexTx`s for a list of `TxId`s. 2. Tested manually. * SCP-3081 added chain-index queries to plutus-contract 1. Added new queries from plutus-chain-index query effect to plutus-contract. 2. Added functions to query transaction history at address. a. `txsAt` b. `txoRefsAt` c. `txsFromTxIds` 3. Manually tested. * SCP-3081 added missing export * SCP-3081 removed lint * SCP-3081 added new query functions to request handler * SCP-3081 added chain-index queries to plutus-pab * SCP-3081 address and txs queries rebased to latest main 1. OpenApi support for `TxoRefsAtAddress` and `TxsFromTxIds`. 2. Wrapped paged response for `TxoRefsAtAddressRequest`. 3. Retested, with spot-check comparisons against db-sync. * fixed stylish haskell * fixed type mapping to purescript generated Co-authored-by: Sjoerd Visscher <[email protected]>
No description provided.