mm0 | Metamath Zero specification language | Serialization library
kandi X-RAY | mm0 Summary
kandi X-RAY | mm0 Summary
Metamath Zero is a language for writing specifications and proofs. Its emphasis is on balancing simplicity of verification and human readability of the specification. That is, it should be easy to see what exactly is the meaning of a proven theorem, but at the same time the language is as pared down as possible to minimize the number of complications in potential verifiers. The language was inspired by Metamath and Lean, two proof languages at opposite ends of a spectrum. Metamath Zero aims to be Metamath without the verification gaps. It is interpretable as a subset of HOL, but with checking times comparable to Metamath. On the other hand, because there is no substitute for human appraisal of the definitions and the endpoint theorems themselves, the specification format is designed to be clear and straightforward, and visually resembles Lean. We embrace the difference between fully explicit proofs that are verified by a trusted verifier, and proof scripts that are used by front-end tools like Lean to generate proofs. Metamath Zero is focused on the proof side, with the expectation that proofs will not be written by hand but rather compiled from a more user friendly but untrusted language. So MM0 proofs tend to be very verbose and explicit (but not repetitive, because that is a performance issue). The goal of this project is to build a formally verified (in MM0) verifier for MM0, down to the hardware, to build a strong trust base on which to build verifiers for more mainstream languages or other verified programs. This has lead to a number of subprojects that are contained in this repository.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mm0
mm0 Key Features
mm0 Examples and Code Snippets
Community Discussions
Trending Discussions on mm0
QUESTION
I was given the following task:
Given two arrays with 16 elements: NIZA RESW 16 and NIZB RESW 16
store in the third array (NIZC RESW 16) the following values: NIZC[i]=NIZA[i]+NIZB[i] using MMX instructions and compiling it with NASM
This is what I got so far:
...ANSWER
Answered 2021-Nov-25 at 00:50Does anybody know why it only stores 4 elements out of 16?
Because you let your MMX instructions only operate on the first 4 array elements. You need a loop to process all 16 array elements.
Your task description doesn't say it, but I see you sign-extend the values from NIZC before printing, so you seem expecting signed results. I also see that you use PADDQ
to operate on 4 word-sized inputs. This will then not always give correct results! eg. If NIZA[0]=-1
and NIZB[0]=5
, then you will get NIZC[0]=4
but there will have happened a carry from the first word into the second word, leaving NIZC[1]
wrong. This will not happen if you use the right version of the packed addition: PADDW
.
You got lucky with the size errors on mov [NIZA+esi], eax
and mov [NIZB+esi], eax
. Because NIZA and NIZB follow each other in memory in the same order that you assign to them, no harm was done. If NIZB would have been placed before NIZA, then assigning NIZB[15] would have corrupted NIZA[0].
Below is a partial rewrite where I used an input subroutine in order to not have to repeat myself.
QUESTION
I use gdb info registers
to see all the registers, but I don't see MMX registers.
My CPU is Xeon Platinum 8163, a modern Xeon cpu that supports SSE and MMX. So i think its a gdb problem(if i am right).
Why does gdb not support showing mmx register while mmx register should be of same importance level compared to basic registers and sse registers.
...ANSWER
Answered 2021-Jun-24 at 04:27The MMX registers don't have their own separate architectural state; they alias the x87 registers st0..st7. (Intel did this so OSes wouldn't to special support to save/restore the MMX state on context switch via FXSAVE/FXRSTOR). That's different from all the other registers.
But I think this is a GDB bug, not an intentional decision to not expose the MMX state except via the x87 state. info reg mmx
tab-completes but prints nothing. (GDB 10.1 on x86-64 Arch GNU/Linux)
Even when running a program with the FPU in MMX state (after executing movd mm0, eax
for example), it still doesn't tab complete. In fact, even p $mm0
just prints void (because that GDB variable name isn't recognized as being tied to an MMX register).
You can see the MMX state via i r float
e.g. after mov eax, 231
/ movd mm0, eax
,
QUESTION
I've been playing with the example from this presentation (slide 41).
It performs alpha blending as far as I'm concerned.
...ANSWER
Answered 2020-Dec-27 at 23:37You can broadcast alpha
to 64-bit using scalar multiply with 0x0001000100010001ULL
before copying to an MM reg. Another option would be to just zero-extend the 8-bit integer to 32-bit for movd
, then pshufw
to replicate it.
There were also various safety problems with your asm.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mm0
mm0-rs: An MM0/MM1 server written in Rust. See mm0-rs/README.md.
vscode-mm0: VSCode plugin for MM0/MM1 syntax highlighting, with advanced features enabled via an LSP server (either mm0-hs or mm0-rs). See vscode-mm0/README.md.
mm0-c: A bare bones MM0 verifier, intended for formalization. See mm0-c/README.md.
mm0-hs: Haskell verifier and toolchain, see mm0-hs/README.md. Deprecated, but contains most of the translations.
mm0-lean: A collection of lean scratch files and minor formalizations. See mm0-lean/README.md.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page