cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Constrained.Solver

Synopsis

Documentation

ifTraceBoolString → a → a Source #

hasAddsRep era t → s t → Typed (HasConstraint Adds (s t)) Source #

Is there an Adds instance for t

isAddsType ∷ ∀ era t. Rep era t → Bool Source #

hasCountRep era t → s t → Typed (HasConstraint Count (s t)) Source #

Is there an Count instance for t

isCountType ∷ ∀ era t. Rep era t → Bool Source #

sameRepRep era i → Rep era j → Typed (i :~: j) Source #

simplifyAtTypeEra era ⇒ Rep era s → Term era t → Typed s Source #

Simplify and return with evidence that expr has type s

simplifySet ∷ (Ord rng, Era era) ⇒ Rep era rng → Term era y → Typed (HasConstraint Ord (Set rng)) Source #

simplifyListEra era ⇒ Rep era rng → Term era y → Typed (HasConstraint Eq [rng]) Source #

isMapVarName era → Sum era c → Bool Source #

Is the Sum a variable (of a map). Only SumMap and Project store maps.

exactlyOne ∷ (a → Bool) → [a] → Bool Source #

projOnDom ∷ ∀ era a dom rng. Ord dom ⇒ Set a → Lens' dom a → Rep era dom → Rep era rng → Gen (Map dom rng) Source #

Make a generator for a Map type when there is a Projection from the domain of the map. This has been superceeded by the RelLens RelSpec

atLeastAdds c ⇒ Rep era c → c → Gen c Source #

solveMap ∷ ∀ dom rng era. Era era ⇒ V era (Map dom rng) → Pred era → Typed (MapSpec era dom rng) Source #

solveMapSummands ∷ (Era era, Adds c) ⇒ c → c → [String] → OrdCondV era (Map dom rng) → c → [Sum era c] → Typed (RngSpec era rng) Source #

We are solving for a (V era (Map d r)). This must occurr exactly once in the [Sum era c] That can only happen in a (RngSum cond c) or a (RngProj cond rep c) constructor of Sum Because we don't know if c can have negative values, we do the summation as an Integer

solveMaps ∷ (Era era, Ord dom) ⇒ V era (Map dom rng) → [Pred era] → Typed (MapSpec era dom rng) Source #

solveSet ∷ ∀ era a. Era era ⇒ V era (Set a) → Pred era → Typed (SetSpec era a) Source #

Given a variable: v1, with a Set type, compute a SetSpec which describes the constraints implied by the Pred predicate

solveSetsEra era ⇒ V era (Set a) → [Pred era] → Typed (SetSpec era a) Source #

solveSum ∷ ∀ era t. (Adds t, Era era) ⇒ V era t → Pred era → Typed (AddsSpec t) Source #

solveSums ∷ (Adds t, Era era) ⇒ V era t → [Pred era] → Typed (AddsSpec t) Source #

summandAsIntAdds c ⇒ Sum era c → Typed Int Source #

genSumAdds x ⇒ Sum era x → Rep era x → x → Subst era → Gen (Subst era) Source #

summandsAsInt ∷ (Adds c, Era era) ⇒ [Sum era c] → Typed Int Source #

sameVV era s → V era t → Typed (s :~: t) Source #

unique2Adds c ⇒ V era t → (Int, Bool, [Name era]) → Sum era c → Typed (Int, Bool, [Name era]) Source #

intSumWithUniqueVAdds c ⇒ V era t → [Sum era c] → Typed (Int, Bool) Source #

Check that there is exactly 1 occurence of v, and return the sum of the other terms in ss which should all be constants.

solveListEra era ⇒ V era [a] → Pred era → Typed (ListSpec era a) Source #

Given a variable: v1, with a List type, compute a ListSpec which describes the constraints implied by the Pred predicate

solveListsEra era ⇒ V era [a] → [Pred era] → Typed (ListSpec era a) Source #

genCountCount t ⇒ V era t → [Pred era] → Typed (Gen t) Source #

Combine solving an generating for a variable with a Counts instance

data Update t where Source #

Used in solving Projections

Constructors

Update ∷ s → Lens' t s → Update t 

update ∷ t → [Update t] → t Source #

anyToUpdateRep era t1 → AnyF era t2 → Typed (Update t1) Source #

isIfPred era → Bool Source #

dispatch ∷ ∀ t era. (HasCallStack, Era era) ⇒ V era t → [Pred era] → Typed (Gen t) Source #

Dispatch on the type of the variable v1 being solved.

genOrFailEra era ⇒ BoolEither [String] (Subst era) → ([Name era], [Pred era]) → Gen (Either [String] (Subst era)) Source #

genOrFailListEra era ⇒ BoolEither [String] (Subst era) → [([Name era], [Pred era])] → Gen (Either [String] (Subst era)) Source #

genDependGraphBoolProof era → DependGraph era → Gen (Either [String] (Subst era)) Source #

solveOneVarEra era ⇒ Subst era → ([Name era], [Pred era]) → Gen (Subst era) Source #

Solve for one variable, and add its solution to the substitution

toolChainSubEra era ⇒ Proof era → OrderInfo → [Pred era] → Subst era → Gen (Subst era) Source #

toolChainEra era ⇒ Proof era → OrderInfo → [Pred era] → Subst era → Gen (Env era) Source #