def make_slim_provenance_dict(model_type, slim_generation,
        stage='late', spatial_dimensionality='', spatial_periodicity='',
        separate_sexes=False, nucleotide_based=False):
    """
    Returns a dictionary encoding provenance information for a SLiM tree sequence.
    """
    document = {
        "schema_version": "1.0.0",
        "software": {
            "name" : "SLiM",
            "version": "3.3.2"
            },
        "parameters": {
            "command": ['pyslim'],
            "model_type": model_type,
            "stage": stage,
            "spatial_dimensionality": spatial_dimensionality,
            "spatial_periodicity": spatial_periodicity,
            "separate_sexes": separate_sexes,
            "nucleotide_based": nucleotide_based,
            },
        "environment": {},
        "metadata": {
            "individuals": {
                "flags": {
                    "16": {
                        "name" : "SLIM_TSK_INDIVIDUAL_ALIVE",
                        "description" : "the individual was alive "
                              + "at the time the file was written",
                          },
                    "17": {
                        "name" : "SLIM_TSK_INDIVIDUAL_REMEMBERED",
                        "description" : "the individual was requested "
                              + "by the user to be permanently remembered",
                          },
                    "18": {
                        "name" : "SLIM_TSK_INDIVIDUAL_RETAINED",
                        "description" : "the individual was requested "
                              + "by the user to be retained only if its "
                              + "nodes continue to exist in the tree sequence",
                          },
                }
            }
        },
        "slim": {
            "file_version": "0.4",
            "generation": slim_generation,
            "model": ""
            }
    }
    return document