Skip to content
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

Closed
wants to merge 7 commits into from
Closed

Updates spec with new builtins, etc. #182

wants to merge 7 commits into from

Conversation

BekaValentine
Copy link

No description provided.

Copy link
Contributor

@effectfully effectfully left a 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\)\\\\
Copy link
Contributor

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}
Copy link
Contributor

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}\\
Copy link
Contributor

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?

Copy link
Author

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?

Copy link
Contributor

@michaelpj michaelpj Oct 13, 2018

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.

Copy link
Contributor

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}\\
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Author

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. :(

Copy link
Contributor

@effectfully effectfully Oct 15, 2018

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.

Copy link
Author

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.

Copy link
Contributor

@mchakravarty mchakravarty left a 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 #-}
Copy link
Contributor

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?

Copy link
Author

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}\\
Copy link
Contributor

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?

Copy link
Author

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}\\
Copy link
Contributor

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}\\
Copy link
Contributor

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.

@michaelpj
Copy link
Contributor

What is this waiting on?

@BekaValentine
Copy link
Author

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).

zeme-iohk pushed a commit that referenced this pull request Jun 9, 2022
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants