Skip to content

Pure Production

Authors
Joe Starr, Ph.D. image

Joe Starr, Ph.D.

I specialize in computational knot theory. I’m also a professional embedded software engineer.

What Is a Pure Production?

A pure production models the basic productions seen in our abstract examples. When executed a replacement or terminal string is selected at random from the configured array of options.

Using a Pure Production

Configuring

A pure production contains two configurable lists one for replacement strings and one for terminal strings. Each list must be configured with at least one string.

Warning!

In line with the PDGL portability and memory goals the strings must be less than a fixed size of length DEFS_PDGL_MAX_STRING_SIZE.

Examples

Single Option

[[production]]
name = "entry"
type = "pure"
replacements = ["%{prod}"]
terminals = [""]

[[production]]
name = "prod"
type = "pure"
replacements = ["replacement"]
terminals = [""]

Recursive

[[production]]
name = "entry"
type = "pure"
replacements = ["%{entry}"]
terminals = ["Stack Full"]

Multiple Options

[[production]]
name = "entry"
type = "pure"
replacements = ["%{prod}"]
terminals = [""]

[[production]]
name = "prod"
type = "pure"
replacements = ["1", "2", "3"]
terminals = [""]

Production Schema

{
    "$id": "pure-production_schema",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
        },
        "type": {
            "type": "string",
            "const": "pure"
        },
        "replacements": {
            "type": "array",
            "items": { "type": "string", "minLength": 0, "maxLength": 3000 },
            "minLength": 1
        },
        "terminals": {
            "type": "array",
            "items": { "type": "string", "minLength": 0, "maxLength": 3000 },
            "minLength": 1
        }
    },
    "additionalProperties": false,
    "minProperties": 4
}