Explorar el Código

add vm.pism file

narodnik hace 5 años
padre
commit
89eb6e8c27
Se han modificado 2 ficheros con 31 adiciones y 1 borrados
  1. 28 0
      proofs/vm.pism
  2. 3 1
      scripts/pism.vim

+ 28 - 0
proofs/vm.pism

@@ -0,0 +1,28 @@
+contract input_spend
+    param x
+    private x2
+    private x3
+    public input
+start
+    set x2 x
+    mul x2 x
+
+    set x3 x2
+    mul x3 x
+constraint
+    lc0_add x
+    lc1_add x
+    lc2_add x2
+    enforce
+
+    lc0_add x2
+    lc1_add x
+    lc2_add x3
+    enforce
+
+    lc0_add input
+    lc1_add 1
+    lc2_add x3
+    enforce
+end
+

+ 3 - 1
scripts/pism.vim

@@ -12,9 +12,10 @@ if exists('b:current_syntax')
     finish
 endif
 
-syn keyword sapviKeyword constant contract start end
+syn keyword sapviKeyword constant contract start end constraint
 "syn keyword sapviAttr
 syn keyword sapviType FixedGenerator BlakePersonalization PedersenPersonalization ByteSize U64 Fr Point Bool Scalar BinarySize
+syn keyword sapviFunctionKeyword enforce
 syn match sapviFunction "^[ ]*[a-z_0-9]* "
 syn match sapviComment "#.*$"
 syn match sapviNumber ' \zs\d\+\ze'
@@ -29,6 +30,7 @@ hi def link sapviPreproc    PreProc
 hi def link sapviPreproc2   PreProc
 hi def link sapviType       Type
 hi def link sapviFunction   Function
+hi def link sapviFunctionKeyword Function
 hi def link sapviComment    Comment
 hi def link sapviNumber     Constant
 hi def link sapviConst      Constant