Download examples/minimal.xml from Snapkitty/hyperkitty-constraint-dsl: direct link, hf CLI and curl.
- Browser
- Download file 1.98 kB
-
https://huggingface.co/Snapkitty/hyperkitty-constraint-dsl/resolve/main/examples/minimal.xml
- Command line
-
hf download hf://Snapkitty/hyperkitty-constraint-dsl/examples/minimal.xml
-
curl -L -o minimal.xml https://huggingface.co/Snapkitty/hyperkitty-constraint-dsl/resolve/main/examples/minimal.xml
1.98 kB
| <!-- | |
| Minimal FormalConstraintDSL example. | |
| Copy this, fill in your domains, and define your constraints. | |
| Run through the XSLT engine to generate executable targets: | |
| xsltproc xslt/polyglot-codegen.xsl examples/minimal.xml | |
| --> | |
| <FormalConstraintDSL version="1.0"> | |
| <Meta> | |
| <System>YOUR_SYSTEM_NAME</System> | |
| <Mode>DETERMINISTIC-CONSTRAINT-BUILD</Mode> | |
| <Output>PROOF_BACKED_ARTIFACT</Output> | |
| <TruthPolicy>STATIC_DECLARATION_ONLY NO_FAKE_RUNTIME_STATE</TruthPolicy> | |
| </Meta> | |
| <Domains> | |
| <DomainSet id="A">Agent1 Agent2 Agent3</DomainSet> | |
| <ForbiddenSet id="F">FakeTelemetry UndefinedState</ForbiddenSet> | |
| <StateSet> | |
| <Valid>Running Idle</Valid> | |
| <Invalid>Zombie Deadlock</Invalid> | |
| </StateSet> | |
| </Domains> | |
| <BooleanKernel> | |
| <Primitive name="NAND"><![CDATA[NAND(a,b) = 1 - ab]]></Primitive> | |
| <Derived name="NOT">NAND(a,a)</Derived> | |
| <Derived name="AND">NAND(NAND(a,b), NAND(a,b))</Derived> | |
| <Derived name="IMPLIES">NAND(NAND(NOT(a),NOT(a)), NAND(b,b))</Derived> | |
| </BooleanKernel> | |
| <AgentModel> | |
| <Agent> | |
| <Field name="id" type="String"/> | |
| <Field name="entropy" refinement="entropy <= 0.20"/> | |
| <Field name="active" type="Boolean"/> | |
| <Field name="trusted" type="Boolean"/> | |
| </Agent> | |
| <Invariant>active(a) => trusted(a)</Invariant> | |
| <Invariant>entropy(a) <= 0.20</Invariant> | |
| </AgentModel> | |
| <ValidityPredicate name="V"> | |
| <Rule><![CDATA[ | |
| V(message) = 1 IFF: | |
| entropy(message) <= 0.20 | |
| AND proof(message) = true | |
| AND active(sender) => trusted(sender) | |
| ]]></Rule> | |
| </ValidityPredicate> | |
| <Pipeline> | |
| <Phase id="1">DefineConstraints</Phase> | |
| <Phase id="2">ValidateAgainstSpec</Phase> | |
| <Phase id="3">GenerateProofArtifact</Phase> | |
| <Constraint>Phase(n+1) requires Complete(Phase n)</Constraint> | |
| </Pipeline> | |
| </FormalConstraintDSL> | |