Skip to content

Commit

Permalink
Merge pull request #330 from zkFold/TurtlePU/UPLC-prototype
Browse files Browse the repository at this point in the history
UPLC converter prototype
  • Loading branch information
vlasin authored Nov 6, 2024
2 parents 8b87a7f + 454e290 commit ebc1f7d
Show file tree
Hide file tree
Showing 19 changed files with 779 additions and 321 deletions.
1 change: 1 addition & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages:
symbolic-cardano
symbolic-examples
zkfold-ledger
zkfold-uplc

optimization: 2

Expand Down
7 changes: 1 addition & 6 deletions symbolic-base/src/ZkFold/Symbolic/Data/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{-# LANGUAGE UndecidableInstances #-}

module ZkFold.Symbolic.Data.Class (
SomeData (..),
SymbolicData (..),
) where

Expand All @@ -12,7 +11,7 @@ import Data.Functor ((<$>))
import Data.Functor.Rep (Representable (..))
import Data.Kind (Type)
import Data.Type.Equality (type (~))
import Data.Typeable (Proxy (..), Typeable)
import Data.Typeable (Proxy (..))
import GHC.Generics (U1 (..), (:*:) (..), (:.:) (..))

import ZkFold.Base.Algebra.Basic.Number (KnownNat)
Expand All @@ -34,10 +33,6 @@ class SymbolicData x where
-- | Restores `x` from the circuit's outputs.
restore :: (Support x -> Context x (Layout x)) -> x

-- A wrapper for `SymbolicData` types.
data SomeData c where
SomeData :: (Typeable t, SymbolicData t, Context t ~ c) => t -> SomeData c

instance SymbolicData (c (f :: Type -> Type)) where
type Context (c f) = c
type Support (c f) = Proxy c
Expand Down
7 changes: 2 additions & 5 deletions symbolic-base/src/ZkFold/Symbolic/Data/Maybe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{-# LANGUAGE UndecidableInstances #-}

module ZkFold.Symbolic.Data.Maybe (
Maybe, maybe, just, nothing, fromMaybe, isNothing, isJust, find
Maybe, maybe, just, nothing, fromMaybe, fromJust, isNothing, isJust, find
) where

import Data.Function ((.))
Expand All @@ -25,7 +25,7 @@ import ZkFold.Symbolic.Data.Bool
import ZkFold.Symbolic.Data.Class
import ZkFold.Symbolic.Data.Conditional

data Maybe context x = Maybe (Bool context) x
data Maybe context x = Maybe { isJust :: Bool context, fromJust :: x }
deriving stock
( Haskell.Functor
, Haskell.Foldable
Expand Down Expand Up @@ -63,9 +63,6 @@ fromMaybe a (Maybe (Bool h) t) = restore $ \i ->
isNothing :: Symbolic c => Maybe c x -> Bool c
isNothing (Maybe h _) = not h

isJust :: Maybe c x -> Bool c
isJust (Maybe h _) = h

instance
( HApplicative c
, SymbolicData x
Expand Down
70 changes: 0 additions & 70 deletions symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC.hs

This file was deleted.

43 changes: 0 additions & 43 deletions symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Builtins.hs

This file was deleted.

55 changes: 0 additions & 55 deletions symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Inference.hs

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Term.hs

This file was deleted.

63 changes: 0 additions & 63 deletions symbolic-cardano/src/ZkFold/Symbolic/Cardano/UPLC/Type.hs

This file was deleted.

6 changes: 0 additions & 6 deletions symbolic-cardano/symbolic-cardano.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ library
ZkFold.Symbolic.Cardano.Types.OutputRef
ZkFold.Symbolic.Cardano.Types.Transaction
ZkFold.Symbolic.Cardano.Types.Value
ZkFold.Symbolic.Cardano.UPLC
ZkFold.Symbolic.Cardano.UPLC.Builtins
ZkFold.Symbolic.Cardano.UPLC.Inference
ZkFold.Symbolic.Cardano.UPLC.Inference.Internal
ZkFold.Symbolic.Cardano.UPLC.Term
ZkFold.Symbolic.Cardano.UPLC.Type
build-depends:
base >= 4.9 && < 5,
containers < 0.7,
Expand Down
5 changes: 5 additions & 0 deletions zkfold-uplc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Revision history for zkfold-uplc

## 0.1.0.0 -- YYYY-mm-dd

* First version. Released on an unsuspecting world.
Loading

0 comments on commit ebc1f7d

Please sign in to comment.