Skip to content

GlobalAllocs in configuration #533

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion kmir/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kmir"
version = "0.3.121"
version = "0.3.122"
description = ""
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion kmir/src/kmir/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from typing import Final

VERSION: Final = '0.3.121'
VERSION: Final = '0.3.122'
12 changes: 11 additions & 1 deletion kmir/src/kmir/kdist/mir-semantics/kmir.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ function map and the initial memory have to be set up.

```k
// #init step, assuming a singleton in the K cell
rule <k> #init(_NAME:Symbol _ALLOCS:GlobalAllocs FUNCTIONS:FunctionNames ITEMS:MonoItems TYPES:TypeMappings)
rule <k> #init(_NAME:Symbol ALLOCS:GlobalAllocs FUNCTIONS:FunctionNames ITEMS:MonoItems TYPES:TypeMappings)
=>
#execFunction(#findItem(ITEMS, FUNCNAME), FUNCTIONS)
</k>
<functions> _ => #mkFunctionMap(FUNCTIONS, ITEMS) </functions>
<memory> _ => #mkMemoryMap(ALLOCS) </memory>
<start-symbol> FUNCNAME </start-symbol>
<types> _ => #mkTypeMap(.Map, TYPES) </types>
<adt-to-ty> _ => #mkAdtMap(.Map, TYPES) </adt-to-ty>
Expand Down Expand Up @@ -108,7 +109,16 @@ they are callee in a `Call` terminator within an `Item`).
The function _names_ and _ids_ are not relevant for calls and therefore dropped.

```k
syntax Address ::= "Address" "(" Int ")"

rule #mkMemoryMap(Globals) => #accumMemory(.Map, Address(1), Globals)

rule #accumMemory(Acc, _, .GlobalAllocs) => Acc
rule #accumMemory(Acc, Address(INDEX), Global REST) => #accumMemory(Acc (Address(INDEX) |-> Global), Address(INDEX +Int 1), REST)

syntax Map ::= #mkFunctionMap ( FunctionNames, MonoItems ) [ function, total ]
| #mkMemoryMap ( GlobalAllocs ) [ function, total ]
| #accumMemory ( Map, Address, GlobalAllocs ) [ function, total ]
| #accumFunctions ( Map, Map, FunctionNames ) [ function, total ]
| #accumItems ( Map, MonoItems ) [ function, total ]

Expand Down
5 changes: 2 additions & 3 deletions kmir/src/kmir/kdist/mir-semantics/rt/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ module KMIR-CONFIGURATION
<stack> .List </stack>
// function store, Ty -> MonoItemFn
<functions> .Map </functions>
// heap
<memory> .Map </memory> // FIXME unclear how to model
// FIXME where do we put the "GlobalAllocs"? in the heap, presumably?
// heap, Address(Int) -> ( GlobalAlloc | Data? )
<memory> .Map </memory>
<start-symbol> symbol($STARTSYM:String) </start-symbol>
// static information about the base type interning in the MIR
<types> .Map </types>
Expand Down
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.121
0.3.122
Loading