{"uid":"cap_qS7Bd5nLPFuYLdUwxVrZ3","slug":"c-polymorphic-subobject-dynamic-cast-resolver-52f12e37","name":"C++ Polymorphic Subobject Dynamic Cast Resolver","description":"An offline C++ polymorphic-inheritance fixture author needs the target SUBOBJECT or null/illformed result for source-subobject-specific downcasts/crosscasts, including repeated and virtual base sharing, without addresses.","url":"https://detect.halowerk.com/v1/F-A-NIGHT-OS-CPP-CAST/cpp-polymorphic-subobject-dynamic-cast?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"artifact":{"type":"object","required":["cpp_dynamic_cast"],"properties":{"cpp_dynamic_cast":{"type":"object","required":["claim","classes","most_derived","queries"],"properties":{"claim":{"type":"number","maximum":1000000000000,"minimum":-1000000000000},"classes":{"type":"array","items":{"type":"object","required":["bases"],"properties":{"bases":{"type":"array","items":{"type":"object","required":["class","virtual"],"properties":{"class":{"type":"number","maximum":1000000000000,"minimum":-1000000000000},"virtual":{"type":"boolean"}},"additionalProperties":false},"maxItems":512}},"additionalProperties":false},"maxItems":512},"queries":{"type":"array","items":{"type":"object","required":["source_class","source_occurrence","target_class"],"properties":{"source_class":{"type":"number","maximum":1000000000000,"minimum":-1000000000000},"target_class":{"type":"number","maximum":1000000000000,"minimum":-1000000000000},"source_occurrence":{"type":"number","maximum":1000000000000,"minimum":-1000000000000}},"additionalProperties":false},"maxItems":512},"most_derived":{"type":"number","maximum":1000000000000,"minimum":-1000000000000}},"additionalProperties":false}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_aqqnyi2nLWVnKFz_dbNU0","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Resolves the target subobject (or null/ill-formed result) for C++ dynamic_cast operations on a specified most-derived object, including downcasts, crosscasts, repeated bases, and virtual base sharing, without using runtime addresses.","exampleAgentPrompt":"I have a C++ class hierarchy where class 0 inherits virtually from class 1 and directly from class 2, and the most-derived object is class 0. Can you resolve what dynamic_cast returns when I cast from a source subobject of class 1 (occurrence 0) to target class 2?","exampleUseCases":[{"title":"Diamond inheritance crosscast verification","prompt":"I'm building a C++ static analyzer and need to know what dynamic_cast returns when casting from class 1 (occurrence 0) to class 3 in a diamond hierarchy where class 0 is most-derived, class 0 inherits virtually from class 1 and class 2, and both class 1 and class 2 inherit from class 3 — tell me if the result is a valid subobject or null."},{"title":"Offline code generator cast resolution","prompt":"For my offline C++ code generator, I have a 5-class hierarchy with repeated non-virtual base class 2 appearing twice under most-derived class 0. Can you resolve the dynamic_cast outcome from source class 2 occurrence 1 to target class 4?"},{"title":"Virtual base sharing downcast check","prompt":"In my C++ toolchain fixture, the most-derived class is 0, which shares a virtual base class 1 with two siblings. I need to know what dynamic_cast from source class 0 occurrence 0 to target class 1 gives — is it a valid subobject or ill-formed?"}],"resultDescription":"Returns, for each submitted query, the resolved target subobject identifier that dynamic_cast would yield at runtime (given the described class hierarchy and most-derived type), or indicates a null or ill-formed result — all computed offline without runtime addresses.","failureModes":["Circular or malformed class hierarchy causes computation error","Query references a class index not defined in the classes array","source_occurrence index exceeds the number of occurrences of that class in the hierarchy","Exceeds maximum of 512 classes or 512 queries per request","Invalid or missing required fields returns schema validation error"],"whenToPreferThis":"Choose this endpoint when you need to resolve C++ dynamic_cast outcomes offline — particularly for static analysis tools, code generators, or test fixture authors who need precise subobject resolution across complex hierarchies involving virtual bases, repeated bases, or diamond inheritance, without a live C++ runtime.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-05T12:18:34.863Z","isFirstParty":false,"canonicalSlug":"c-polymorphic-subobject-dynamic-cast-resolver-52f12e37"}