Documentation

LambdaS.DeclarationSolverExamples

Executable declaration checks at the semantic boundaries #

These examples run DeclSolver.check, DeclSolver.solve, and DeclSolver.conversionExact on small unit systems chosen to separate consistency from global completeness and to exercise exact irrational output. Each namespace sets up its own UnitSys:

Each check is a #guard, and allChecks and report run the same computations in the native executable, which exits nonzero on failure. Length.linkedFactor_returned and Root.rootFactor_returned prove what the solver returns; Length.linkedFactor_correct and Root.rootFactor_correct prove the returned factor equal to the conversion factor in every satisfying real valuation, independently of the solver's chosen free magnitudes.

unit meter = (1250/381) foot: redundant with link, and consistent.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    unit foot = (1/3) meter: conflicts with link.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              conversionExact from foot to meter returns linkedFactor, the exact factor built from the coefficient witness ![1].

              The returned factor equals the foot-to-meter conversion factor in every valuation satisfying link.

              A dimensionless generator satisfying u = 2/u has magnitude sqrt(2).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  conversionExact from unit to the dimensionless unit returns rootFactor, the exact factor built from the coefficient witness ![1/2].

                  The returned factor equals the conversion factor from unit to 1 in every valuation satisfying selfDecl.

                  The equations have a solution, but equating independent dimensions is illegal.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Three length units linked through a compound rational-power right-hand side, so that the radical a conversion needs is derived rather than declared.

                    a = 2 · (b·c)^(1/2).

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      b = 2 · c.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        a = 3 · c, which contradicts the other two: they force a/c = 2^(3/2).

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          Both declared ratios together span the kernel of dim.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            log(a/c) = (3/2) log 2, cleared to log 8 / 2.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              log(a/b) = (1/2) log 2.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                The contradiction is decided exactly: 2 log 3 − log 8 = log (9/8) ≠ 0.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  With viaMean alone, b/c is undetermined, so the global check rejects the system.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    With viaMean alone, the factor from a to meanBC, which that declaration fixes, is still extracted exactly: radicand 2, degree 1.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      With viaMean alone, the undetermined factor from a to c is refused rather than assigned the solver's free choice.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          A one-dimensional wavefunction amplitude carries a half-power of inverse length. A rational declared factor between nanometer and meter then yields a radical factor between the amplitude units. Section 3 of our paper cites exactAmplitude.

                                          nm = 10^(-9) m.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            nm^(-1/2) to m^(-1/2) multiplies by 10^(9/2): radicand 10^9, degree 2.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For

                                              All declaration regressions, also evaluated by the native artifact executable.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For

                                                A compact runtime reading identifying the declaration checks.

                                                Instances For