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

crucible-llvm-syntax: Concrete syntax for Crucible-LLVM #1113

Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5aeddeb
crucible-syntax: Export parsing helpers for positive nats
langston-barrett Oct 31, 2023
4aa29f4
crucible-syntax: Allow passing parser hooks to `doParseCheck`
langston-barrett Oct 31, 2023
8a351b4
crucible-llvm-syntax: Concrete syntax for Crucible-LLVM
langston-barrett Oct 31, 2023
24d5da1
crucible-llvm-syntax: Allow arbitrary widths in pointer types
langston-barrett Oct 31, 2023
3367f5b
crucible-llvm-syntax: Remove dead code
langston-barrett Oct 31, 2023
63caae5
crucible-llvm-syntax: Fix warnings in test suite
langston-barrett Oct 31, 2023
1b2122a
crucible-llvm-syntax: Parse pointer type as an atom name, not a string
langston-barrett Oct 31, 2023
826112a
crucible-llvm-syntax: Add null pointer statement
langston-barrett Oct 31, 2023
4229b6f
crucible-llvm-syntax: Simplify parsing of pointer types
langston-barrett Oct 31, 2023
3d7ced7
crucible-llvm-syntax: README
langston-barrett Oct 31, 2023
2c6c89c
crucible-llvm-syntax: Fix hlint warnings
langston-barrett Oct 31, 2023
7b4c01e
crucible-llvm-syntax: Syntax for all LLVM expressions
langston-barrett Oct 31, 2023
cae6232
crucible-llvm-syntax: Syntax for LLVM alloca statement
langston-barrett Oct 31, 2023
42e85c3
crucible-llvm-syntax: Syntax for LLVM load, store statements
langston-barrett Oct 31, 2023
7022ffa
crucible-llvm-syntax: Additional documentation
langston-barrett Nov 1, 2023
00bf64e
crucible-llvm-syntax: Remove redundant `do`
langston-barrett Nov 1, 2023
dd5af77
crucible-llvm-syntax: Add haddock
langston-barrett Nov 1, 2023
30fbe47
crucible-llvm-syntax: README tweaks
langston-barrett Nov 1, 2023
a7a96a5
crucible-llvm-syntax: README typo
langston-barrett Nov 1, 2023
c9674d0
crucible-llvm-syntax: `BV` -> `Bitvector`
langston-barrett Nov 1, 2023
5c340c8
crucible-llvm-syntax: Improve error messages with `describe`
langston-barrett Nov 1, 2023
f4b2c4f
crucible-llvm-syntax: Add golden test files to extra-source-files
langston-barrett Nov 1, 2023
abac7c9
ci: Tweak syntax of hlint command
langston-barrett Nov 1, 2023
bb3501b
crucible-llvm-syntax: Add type signature for GHC 8.10 compatibility
langston-barrett Nov 1, 2023
18e4db9
crucible-llvm-syntax: Fix README typo
langston-barrett Nov 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
crucible-llvm-syntax: README tweaks
  • Loading branch information
langston-barrett committed Nov 1, 2023
commit 30fbe476f45c03e3798613bca3b892cb8cf072bd
17 changes: 10 additions & 7 deletions crucible-llvm-syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ statements:

**Types**:

- `(Ptr n)` for a positive numeral `n` represents the type of LLVM pointers that are `n` bits wide. For example `(Ptr 8)` is the type of bytes.
- `(Ptr n)` for a positive numeral `n` represents the type of LLVM pointers that are `n` bits wide; for example `(Ptr 8)` is the type of bytes

**Primitive atoms**:

- `none : Alignment`: no alignment
- `i8 : LLVMType`
- `i16 : LLVMType`
- `i32 : LLVMType`
- `i64 : LLVMType`
- `ptr : LLVMType`
- `i8 : LLVMType`: [LLVM docs][int-type], corresponds to Crucible-LLVM's `IntType 8 :: MemType`
- `i16 : LLVMType`: [LLVM docs][int-type], corresponds to Crucible-LLVM's `IntType 16 :: MemType`
- `i32 : LLVMType`: [LLVM docs][int-type], corresponds to Crucible-LLVM's `IntType 32 :: MemType`
- `i64 : LLVMType`: [LLVM docs][int-type], corresponds to Crucible-LLVM's `IntType 64 :: MemType`
- `ptr : LLVMType`: [LLVM docs][ptr-type], corresponds to Crucible-LLVM's `IntType 64 :: PtrOpaqueType`
langston-barrett marked this conversation as resolved.
Show resolved Hide resolved

[int-type]: https://llvm.org/docs/LangRef.html#integer-type
[ptr-type]: https://llvm.org/docs/LangRef.html#pointer-type

**Statements**:

If the numeral representing `w` the pointer width and `n` is an arbitrary numeral,

- `ptr : Nat -> Bitvector w -> Ptr w`: construct a pointer from a block and offset
- `ptr : Nat -> Bitvector n -> Ptr n`: construct a pointer from a block and offset
- `ptr-block : Ptr n -> Nat`: get the block number of a pointer
- `ptr-offset : Ptr n -> Bitvector n`: get the offset of a pointer
- `ptr-ite : Bool -> Ptr n -> Ptr n -> Ptr n`: if-then-else for pointers
Expand Down
Loading