ScratchLens: Lens-Parametric Behavioral Equivalence for Scratch Programs
- URL: http://arxiv.org/abs/2606.15817v2
- Date: Tue, 16 Jun 2026 02:56:17 GMT
- Title: ScratchLens: Lens-Parametric Behavioral Equivalence for Scratch Programs
- Abstract summary: ScratchLens makes behavioral equivalence explicit through a taxonomy of causal divergence phenomena and observation lenses.<n>It compiles Scratch projects into a causal IR of typed resources and semantic transactions, canonicalizes renamings, guards, and procedure bodies, quotients same-trigger with Mazurkiewicz trace normal forms.<n>On a VM-witnessed mutation corpus from real Scratch projects, ScratchLens decides all validated pairs and makes 0/158 false-equivalence claims on witnessed-different pairs.
- Score: 2.054408744752205
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Two Scratch programs can be syntactically far apart-renamed variables, split scripts, extracted custom blocks, or reordered initialization-and still behave identically; a one-block edit, such as replacing a blocking broadcast with an asynchronous one, can create divergences visible only under specific schedules. Deciding behavioral equivalence is central to automated feedback, grading support, and repair validation, yet tree differencing is too strict and single-run dynamic comparison is unsound for concurrent, random, and timing-dependent behavior. We observe that equivalence for block-based programs is lens-parametric: final state, frame traces, monitors, event causality, and debug traces induce different observation relations. ScratchLens makes this explicit through a taxonomy of causal divergence phenomena and observation lenses. It compiles Scratch projects into a causal IR of typed resources and semantic transactions, canonicalizes renamings, guards, and procedure bodies, quotients same-trigger concurrency with Mazurkiewicz trace normal forms, separates program order from races, and handles residual frontiers through SMT obligations and VM-backed counterexample-guided refinement. Conclusive verdicts carry evidence: equivalence by bijection and trace quotient, difference by a typed witness, and unresolved cases remain unknown. On a VM-witnessed mutation corpus from real Scratch projects, ScratchLens decides all 444 validated pairs and makes 0/158 false-equivalence claims on witnessed-different pairs under strict scoring. Structural, dynamic-only, and LLM baselines fail on the classes predicted by the taxonomy; ablations quantify the contribution of partial-order reduction and lens parametricity; and targeted scenarios expose ambiguous-mutant divergences missed by random testing.
Related papers
- QILP-0: Constructing Observational Declarative Twins of Quantum Circuits [0.0]
This paper introduces QXymb, a general framework for constructing observational declarative twins of quantum circuits.<n>We develop QILP-0, its first complete order-0, which constructs a finite multi-valued propositional logic program from observed circuit behaviour.<n>In every reported relation, the induced QILP-0 theory achieves complete, conflict-free reconstruction with strict accuracy equal to one.
arXiv Detail & Related papers (2026-09-01T10:46:42Z) - CofactVLA: Deconfounding Vision-Language-Action Models via Counterfactual Intervention [48.20065816234311]
Vision-Language-Action (VLA) models have driven significant progress in robotic manipulation, yet they struggle with the vision-override phenomenon.<n>We propose CofactVLA, a novel causal intervention framework.<n>We show that CofactVLA establishes a new state-of-the-art across diverse simulation benchmarks.
arXiv Detail & Related papers (2026-08-05T02:58:41Z) - Amortized Interventional Forecasting for Multivariate CIR Processes [2.918919242459813]
Mean-reverting dynamics are pervasive in finance.<n>CIR models capture only emphcorrelated co-movement, not emphcausal influence between series.
arXiv Detail & Related papers (2026-08-04T14:17:35Z) - SchedCheck: Schedule-Robustness Analysis for Event-Driven Block Programs [2.054408744752205]
Block-based languages such as Scratch let beginners assemble interactive programs from sprites and scripts.<n>We show that such programs contain schedule-sensitive behaviors whose observable result depends on an execution order the language leaves open.<n>We formalize the schedule space a Scratch virtual machine can realize as the permutations of the initial executable-target order.
arXiv Detail & Related papers (2026-07-01T08:41:53Z) - Towards Human-Like Interactive Speech Recognition With Agentic Correction and Semantic Evaluation [53.844308305341166]
We propose textbfAgentic ASR, a closed-loop framework that combines a single-pass ASR front-end with semantic correction, intent routing, and reasoning-based editing.<n> Experiments on multilingual, named-entity-intensive, and code-switching benchmarks show that iterative interaction consistently reduces semantic errors.
arXiv Detail & Related papers (2026-05-28T06:23:31Z) - When Rule Violations Are Rare: Chimera Training for Logical Anomaly Detection [56.362776482614976]
We study anomaly detection in a setting where constraints are given as logical rules over learned visual concepts.<n>We propose a neural rule evaluator that compiles each constraint into a directed acyclic graph and learns feature-aware subtree gates.<n>Across CLEVRER, OpenImages, and VidOR, the resulting evaluator improves rule-level anomaly AUROC over independent-events and same-image semantic-training baselines.
arXiv Detail & Related papers (2026-05-25T02:52:36Z) - CasualSynth: Generating Structurally Sound Synthetic Data [44.80087038178069]
Large Language Models (LLMs) generate realistic synthetic data but offer no guarantee that their outputs respect the causal mechanisms governing the target domain.<n>We introduce Causal Synth, a framework that decouples causal structure generation from semantic realization, yielding synthetic data that is both causally valid and linguistically rich.
arXiv Detail & Related papers (2026-05-17T16:21:01Z) - FACTOR: Counterfactual Training-Free Test-Time Adaptation for Open-Vocabulary Object Detection [63.91351553178842]
FACTOR is a training-free Test-time adaptation for Open-vocabulary object detection.<n>It quantifies attribute sensitivity, semantic relevance, and prediction variation to selectively suppress attribute-dependent predictions.<n>Experiments on PASCAL-C, COCO-C, and FoggyCityscapes show that FACTOR consistently outperforms prior TTA methods.
arXiv Detail & Related papers (2026-05-05T02:31:18Z) - PRISM: A Dual View of LLM Reasoning through Semantic Flow and Latent Computation [15.91920027845529]
PRISM (Probabilistic Reasoning Inspection through Semantic and Implicit Modeling) is a framework and diagnostic tool for jointly analyzing both levels.<n>It uncovers systematic patterns in the reasoning process, showing that failed trajectories are more likely to become trapped in unproductive verification loops.<n> PRISM makes these behaviors observable and analyzable rather than relying solely on final-task accuracy.
arXiv Detail & Related papers (2026-03-24T03:31:53Z) - ConsistencyChecker: Tree-based Evaluation of LLM Generalization Capabilities [14.13459302125202]
evaluating consistency in large language models (LLMs) is crucial for ensuring reliability.<n>Traditional self-consistency methods often miss subtle semantic changes in natural language and functional shifts in code or equations.<n>We propose ConsistencyChecker, a tree-based evaluation framework designed to measure consistency through sequences of reversible transformations.
arXiv Detail & Related papers (2025-06-14T07:18:33Z) - Representation Learning Preserving Ignorability and Covariate Matching for Treatment Effects [18.60804431844023]
Estimating treatment effects from observational data is challenging due to hidden confounding.<n>A common framework to address both hidden confounding and selection bias is missing.
arXiv Detail & Related papers (2025-04-29T09:33:56Z) - Deconfounding Scores: Feature Representations for Causal Effect
Estimation with Weak Overlap [140.98628848491146]
We introduce deconfounding scores, which induce better overlap without biasing the target of estimation.
We show that deconfounding scores satisfy a zero-covariance condition that is identifiable in observed data.
In particular, we show that this technique could be an attractive alternative to standard regularizations.
arXiv Detail & Related papers (2021-04-12T18:50:11Z) - Tractable Inference in Credal Sentential Decision Diagrams [116.6516175350871]
Probabilistic sentential decision diagrams are logic circuits where the inputs of disjunctive gates are annotated by probability values.
We develop the credal sentential decision diagrams, a generalisation of their probabilistic counterpart that allows for replacing the local probabilities with credal sets of mass functions.
For a first empirical validation, we consider a simple application based on noisy seven-segment display images.
arXiv Detail & Related papers (2020-08-19T16:04:34Z) - Unsupervised Feature Learning by Cross-Level Instance-Group
Discrimination [68.83098015578874]
We integrate between-instance similarity into contrastive learning, not directly by instance grouping, but by cross-level discrimination.
CLD effectively brings unsupervised learning closer to natural data and real-world applications.
New state-of-the-art on self-supervision, semi-supervision, and transfer learning benchmarks, and beats MoCo v2 and SimCLR on every reported performance.
arXiv Detail & Related papers (2020-08-09T21:13:13Z) - CausalVAE: Structured Causal Disentanglement in Variational Autoencoder [52.139696854386976]
The framework of variational autoencoder (VAE) is commonly used to disentangle independent factors from observations.
We propose a new VAE based framework named CausalVAE, which includes a Causal Layer to transform independent factors into causal endogenous ones.
Results show that the causal representations learned by CausalVAE are semantically interpretable, and their causal relationship as a Directed Acyclic Graph (DAG) is identified with good accuracy.
arXiv Detail & Related papers (2020-04-18T20:09:34Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.