@classmethod
def prolog_query(cls, query):
    """Run prolog query without specifying trial"""
    cls.init_cli()
    id_to_instance = {}
    cache = set()
    no_cache = set()
    for inst in cls.get_instances():
        id_to_instance[inst.trial.id] = inst
        (cache if inst.use_cache else no_cache).add(inst.trial.id)
    retract_ids = no_cache - cache
    for tid in retract_ids:
        id_to_instance[tid].retract()
    return cls.prolog_cli.query(query)
