https://github.com/jhu-seclab-cobra/commons-value
The Kotlin library for the basic union value system with serialization implementation for the COBRA platform
https://github.com/jhu-seclab-cobra/commons-value
java kotlin library serialization-library value
Last synced: 2 months ago
JSON representation
The Kotlin library for the basic union value system with serialization implementation for the COBRA platform
- Host: GitHub
- URL: https://github.com/jhu-seclab-cobra/commons-value
- Owner: jhu-seclab-cobra
- License: gpl-2.0
- Created: 2025-04-15T05:24:27.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-13T19:49:20.000Z (3 months ago)
- Last Synced: 2026-04-13T21:36:39.791Z (3 months ago)
- Topics: java, kotlin, library, serialization-library, value
- Language: Kotlin
- Homepage:
- Size: 295 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# COBRA.COMMONS.VALUE
> Common value -- the intermediate representation that gives analysis modules a shared language.
Type-safe IR value system with serialization for the Cobra static analysis engine.
[](https://github.com/jhu-seclab-cobra/commons-value/releases/tag/v0.1.0)
[](https://jitpack.io/#jhu-seclab-cobra/commons-value)
[](https://codecov.io/gh/jhu-seclab-cobra/commons-value)
[](./LICENSE)

## Install
Java 8+. Add the JitPack repository and dependency:
```kotlin
repositories {
maven { url = uri("https://jitpack.io") }
}
dependencies {
implementation("com.github.jhu-seclab-cobra:commons-value:v0.1.0")
}
```
## Usage
```kotlin
import edu.jhu.cobra.commons.value.*
import edu.jhu.cobra.commons.value.serializer.*
val map = MapVal("name" to StrVal("Alice"), "age" to IntVal(30L))
val list = ListVal(StrVal("a"), IntVal(1L), BoolVal.T)
val range = RangeVal(1, 100)
val serializer = DftByteArraySerializerImpl
val bytes = serializer.serialize(map)
val restored = serializer.deserialize(bytes) // MapVal
```
## API
**Primitives** (`IPrimitiveVal`): `StrVal`, `IntVal`, `FloatVal`, `BoolVal`, `NullVal`, `Unsure` (`NumVal` is deprecated)
**Collections** (`ICollectionVal`): `ListVal`, `SetVal`, `MapVal` (String keys), `RangeVal`
**Serializers** (`IValSerializer`): `DftByteArraySerializerImpl` (ByteArray), `DftByteBufferSerializerImpl` (ByteBuffer), `DftCharBufferSerializerImpl` (CharBuffer)
Full type specifications and method details in [docs/design-primitive.md](./docs/design-primitive.md).
## Documentation
- [docs/idea.md](./docs/idea.md) -- concepts, terminology, and system role
- [docs/design-primitive.md](./docs/design-primitive.md) -- primitive type specifications (IntVal, FloatVal, StrVal, BoolVal, NullVal, Unsure)
- [docs/design-collection.md](./docs/design-collection.md) -- collection type specifications (ListVal, SetVal, MapVal, RangeVal)
- [docs/design-serializer.md](./docs/design-serializer.md) -- serializer interface and implementations
## For Agents
Agent-consumable documentation index at [docs/llms.txt](./docs/llms.txt) (llmstxt.org format).
## Citation
If you use this repository in your research, please cite our paper:
```bibtex
@inproceedings{xu2026cobra,
title = {CoBrA: Context-, Branch-sensitive Static Analysis for Detecting Taint-style Vulnerabilities in PHP Web Applications},
author = {Xu, Yichao and Kang, Mingqing and Thimmaiah, Neil and Gjomemo, Rigel and Venkatakrishnan, V. N. and Cao, Yinzhi},
booktitle = {Proceedings of the 48th IEEE/ACM International Conference on Software Engineering (ICSE)},
year = {2026},
address = {Rio de Janeiro, Brazil}
}
```
## License
[GPL-2.0](./LICENSE)