An Intelligent Assistant for Converting City Requirements to Formal Specification

An Intelligent Assistant for Converting City Requirements to Formal Specification
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

As more and more monitoring systems have been deployed to smart cities, there comes a higher demand for converting new human-specified requirements to machine-understandable formal specifications automatically. However, these human-specific requirements are often written in English and bring missing, inaccurate, or ambiguous information. In this paper, we present City Spec [1], an intelligent assistant system for requirement specification in smart cities. CitySpec not only helps overcome the language differences brought by English requirements and formal specifications, but also offers solutions to those missing, inaccurate, or ambiguous information. The goal of this paper is to demonstrate how CitySpec works. Specifically, we present three demos: (1) interactive completion of requirements in CitySpec; (2) human-in-the-loop correction while CitySepc encounters exceptions; (3) online learning in CitySpec.


💡 Research Summary

The paper presents CitySpec, an intelligent assistant designed to bridge the gap between natural‑language city policy requirements and the formal specifications required by smart‑city monitoring systems. As urban environments become increasingly instrumented, the volume of human‑written requirements—typically expressed in English—has grown, but these texts often suffer from missing, inaccurate, or ambiguous information that makes automatic translation into machine‑readable specifications difficult or impossible. CitySpec addresses this challenge through a four‑component architecture deployed as an online, web‑based service.

The first component is an interactive, conversation‑based interface. Users type a requirement in plain English; the system immediately forwards the text to a backend natural‑language processing pipeline that performs named‑entity recognition (NER) and extracts five key slots: entity (the main object of the requirement), quantifier (the subject or metric), location, time, and condition (numeric bounds or logical constraints). The NER model is a hybrid of BiLSTM‑CRF and BERT, chosen for its strong token‑level classification performance. After extraction, the system presents the provisional slot values to the user for confirmation. If the user accepts, the final formal specification is generated and displayed in two side panels—one showing the extracted keywords, the other showing the complete formal language output.

The second component is a requirement synthesis engine that mitigates data scarcity. By mining a corpus of real city policies, the system builds a vocabulary of semantic terms and a set of syntactic patterns. A controllable synthesis algorithm then generates diverse, plausible requirement variants that are fed into the translation model during training. This synthetic data enriches the model’s exposure to rare constructions and domain‑specific terminology, improving its ability to generalize to unseen inputs.

The third component is the translation model itself. It maps the confirmed slot values onto a predefined formal specification template, inserting mathematical symbols, temporal operators, and logical predicates as needed. Post‑processing steps refine time expressions (e.g., normalizing “between 7 am and 8 am” to a standard interval) and detect negations to avoid semantic inversion. The result is a concise, machine‑understandable specification that can be directly consumed by downstream monitoring engines.

The fourth component implements both short‑term and long‑term online learning. When the system cannot confidently fill a slot—e.g., it fails to infer a time interval—it prompts the user for clarification. The user’s correction is stored temporarily; any subsequent request for the same requirement within the same session reuses this stored answer, providing immediate responsiveness. Upon session termination, the correction undergoes a validation routine (rule‑based checks, anomaly detection) to filter out malicious or erroneous inputs. Validated corrections are then incorporated into the model’s training data during periodic updates, enabling the system to continuously adapt to new policy language, emerging city concepts, or evolving regulatory standards.

The authors demonstrate CitySpec through three use cases. First, they show interactive completion where a well‑specified requirement is automatically parsed, confirmed, and rendered as a formal specification. Second, they illustrate human‑in‑the‑loop correction, where the user amends a mis‑identified location (“buildings” → “all the buildings”) and the system updates its internal representation before final confirmation. Third, they present short‑term and long‑term online learning: a requirement lacking explicit time information triggers a clarification request; the user’s answer is cached for the remainder of the session and later validated for permanent model update.

Empirical observations on a real dataset reveal that 27.6 % of requirements lack location information, 29.1 % miss a proper quantifier, and up to 90 % omit or default to an ambiguous time frame. CitySpec successfully fills these gaps, resolves ambiguities (e.g., interpreting “close to” with a concrete numeric bound), and corrects inaccuracies, thereby enabling downstream monitoring systems to operate on reliable specifications.

In conclusion, CitySpec showcases a practical, human‑centric approach to automating the conversion of city policy requirements into formal specifications. By integrating conversational interaction, controlled data synthesis, a robust translation pipeline, and continuous online learning, the system reduces the expertise barrier for policy makers, accelerates the specification lifecycle, and enhances the reliability of smart‑city monitoring infrastructures. The work is supported by NSF grant CNS‑1952096 and builds upon prior research in spatial‑temporal specification, conflict resolution, and predictive monitoring for cyber‑physical systems.


Comments & Academic Discussion

Loading comments...

Leave a Comment