Skip to content

Commit

Permalink
plutus-core: sizeOfInteger; succ-integer
Browse files Browse the repository at this point in the history
  • Loading branch information
nishantjr committed Dec 7, 2018
1 parent 0ca81c6 commit 02577e3
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
1 change: 1 addition & 0 deletions lib/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def test_typing(input):
test('t/sum-list.plc')
test('t/sum.plc')
test('t/fact.plc')
test('t/succ-integer.plc')

# Typing tests
# ------------
Expand Down
1 change: 1 addition & 0 deletions plutus-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module PLUTUS-CORE-SYNTAX-BASE
syntax BuiltinName ::= BinaryBuiltin | UnaryBuiltin
syntax UnaryBuiltin ::= "sha2_256" | "sha3_256"
| "sizeOfInteger"
syntax BinaryBuiltin ::= "addInteger" | "subtractInteger"
| "multiplyInteger" | "divideInteger"
| "remainderInteger"
Expand Down
39 changes: 22 additions & 17 deletions t/succ-integer.plc
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
(program 1.0.0
(abs
s
(size)
(lam
i
[(con integer) s]
[
[ { (builtin addInteger) s } i ]
[
[ {
(abs
s
(size)
(lam
i
[(con integer) s]
[
{ { (builtin resizeInteger) (con 1) } s }
[ { (builtin sizeOfInteger) s } i ]
[ { (builtin addInteger) s } i ]
[
[
{ { (builtin resizeInteger) (con 1) } s }
[ { (builtin sizeOfInteger) s } i ]
]
(con 1 ! 1)
]
]
(con 1 ! 1)
]
]
)
)
)
)
)
(con 1)
}
(con 1 ! 3)
]
)
11 changes: 11 additions & 0 deletions t/succ-integer.plc.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<generatedTop>
<k>
( con 1 ! 4 )
</k>
<env>
.Map
</env>
<store>
.Map
</store>
</generatedTop>

0 comments on commit 02577e3

Please sign in to comment.