Starting with just types, we will seek top unknowns as goals.
import $cp.bin.`provingground-core-jvm-a6ae52a.fat.jar`
import $cp.$
import provingground._ , interface._, HoTT._, learning._
import provingground._ , interface._, HoTT._, learning._
repl.pprinter() = {
val p = repl.pprinter()
p.copy(
additionalHandlers = p.additionalHandlers.orElse {
translation.FansiShow.fansiHandler
}
)
}
val terms = FiniteDistribution.unif[Term](Type, Unit, Zero, Star)
val typs = FiniteDistribution.unif[Typ[Term]](Type, Unit, Zero)
val ts = TermState(terms, typs)
terms: FiniteDistribution[Term] = FiniteDistribution( Vector( Weighted(π° , 0.25), Weighted(Unit, 0.25), Weighted(Zero, 0.25), Weighted(Star, 0.25) ) ) typs: FiniteDistribution[Typ[Term]] = FiniteDistribution( Vector( Weighted(π° , 0.3333333333333333), Weighted(Unit, 0.3333333333333333), Weighted(Zero, 0.3333333333333333) ) ) ts: TermState = TermState( FiniteDistribution( Vector( Weighted(π° , 0.25), Weighted(Unit, 0.25), Weighted(Zero, 0.25), Weighted(Star, 0.25) ) ), FiniteDistribution( Vector( Weighted(π° , 0.3333333333333333), Weighted(Unit, 0.3333333333333333), Weighted(Zero, 0.3333333333333333) ) ), Vector(), FiniteDistribution(Vector()), FiniteDistribution(Vector()), Empty )
import monix.execution.Scheduler.Implicits.global
val lp = LocalProver(ts).sharpen(10)
val thmsT = lp.theoremsByStatement
val thmsF = thmsT.runToFuture
import monix.execution.Scheduler.Implicits.global
lp: LocalProver = LocalProver(
TermState(
FiniteDistribution(
Vector(
Weighted(π° , 0.25),
Weighted(Unit, 0.25),
Weighted(Zero, 0.25),
Weighted(Star, 0.25)
)
),
FiniteDistribution(
Vector(
Weighted(π° , 0.3333333333333333),
Weighted(Unit, 0.3333333333333333),
Weighted(Zero, 0.3333333333333333)
)
),
Vector(),
FiniteDistribution(Vector()),
FiniteDistribution(Vector()),
Empty
),
TermGenParams(
0.1,
0.1,
0.1,
0.1,
0.1,
0.05,
0.05,
0.05,
0.0,
0.0,
0.0,
0.0,
0.3,
0.7,
0.5,
0.0,
...
thmsT: monix.eval.Task[FiniteDistribution[Typ[Term]]] = Map(
FlatMap(
Map(
Async(<function2>, false, true, true),
provingground.learning.LocalProver$$Lambda$2760/368487092@670c538f,
0
),
provingground.learning.LocalProver$$Lambda$2761/1658847093@473b622e
),
provingground.learning.LocalProverStep$$Lambda$2762/303319596@364600a4,
0
)
thmsF: monix.execution.CancelableFuture[FiniteDistribution[Typ[Term]]] = Success(
FiniteDistribution(
Vector(
Weighted((Zero β (π° β Unit)), 3.0497390746605195E-4),
Weighted((Zero β (Zero β Unit)), 4.356770106657885E-4),
Weighted((Zero β (Unit β Unit)), 4.356770106657885E-4),
Weighted((π° β (Zero β Unit)), 2.688606639440138E-4),
Weighted((π° β (π° β Unit)), 1.8820246476080962E-4),
Weighted((π° β (Unit β Unit)), 2.688606639440138E-4),
Weighted(β(@a : π° ){ (@a β Unit) }, 3.4567799649944635E-4),
Weighted((Unit β (Unit β Unit)), 4.3567701066578866E-4),
Weighted((Unit β (Zero β Unit)), 4.3567701066578866E-4),
Weighted((Unit β (π° β Unit)), 3.04973907466052E-4),
Weighted(π° , 0.41378006453846056),
Weighted(UnitΓπ° , 0.006307547629305582),
Weighted((π° β Unit), 0.009476178164047663),
Weighted((Zero β Unit), 0.015196691774522063),
Weighted((π° ΓZero β Unit), 1.6475595324836717E-4),
Weighted(((Zero β Unit) β Unit), 3.873991333137281E-4),
Weighted(((π° β Unit) β Unit), 2.886934634346448E-4),
Weighted((β(@a : { @a } β Unit), 2.1182908274790062E-4),
Weighted((UnitΓZero β Unit), 2.0476811332297058E-4),
Weighted((UnitΓUnit β Unit), 2.0476811332297058E-4),
Weighted((ZeroΓπ° β Unit), 2.0476811332297058E-4),
Weighted((ZeroΓUnit β Unit), 2.0476811332297058E-4),
Weighted((π° Γπ° β Unit), 1.6475595324836717E-4),
Weighted(((Zero β Zero) β Unit), 3.873991333137281E-4),
Weighted(((π° β Zero) β Unit), 2.886934634346448E-4),
Weighted((Unit β Unit), 0.01650481911361812),
Weighted((UnitΓπ° β Unit), 2.0476811332297058E-4),
Weighted(((Unit β Unit) β Unit), 3.873991333137281E-4),
Weighted(((Unit β Zero) β Unit), 3.873991333137281E-4),
Weighted((ZeroΓZero β Unit), 2.0476811332297058E-4),
Weighted(((Zero β π° ) β Unit), 3.873991333137281E-4),
Weighted(((π° β π° ) β Unit), 2.474515400868384E-4),
Weighted(((Unit β π° ) β Unit), 2.905493499852961E-4),
Weighted((π° ΓUnit β Unit), 1.6475595324836717E-4),
Weighted((β(@a : π° ){ @a } β Unit), 3.7117731013025767E-4),
Weighted(β(@a : { @a }, 0.005079885089552229),
...
val unknownsT = lp.unknownStatements.map(_.entropyVec.map(_.elem)).memoize
val unF = unknownsT.runToFuture
unknownsT: monix.eval.Task[Vector[Typ[Term]]] = Async(
<function2>,
false,
true,
true
)
unF: monix.execution.CancelableFuture[Vector[Typ[Term]]] = Success(
Vector(
β(@a : π° ){ @a },
(Unit β (Unit β Zero)),
(Zero β β(@a : π° ){ @a }),
(Unit β β(@a : π° ){ @a }),
(π° β β(@b : π° ){ @b }),
β(@a : π° ){ (Zero β @a) },
β(@a : π° ){ (Unit β @a) },
(Unit β (π° β Zero)),
β(@a : (Unit β π° )){ @a(Star) },
(π° β (Unit β Zero)),
β(@a : π° ){ @aΓ@a },
β(@a : { (@a β @a) },
β(@a : π° ){ (π° β @a) },
(Unit β UnitΓZero),
(Zero β UnitΓZero),
(Unit β ZeroΓπ° ),
(Zero β ZeroΓπ° ),
(Unit β UnitΓπ° ),
(Zero β UnitΓπ° ),
(Zero β ZeroΓZero),
(Unit β ZeroΓZero),
(Zero β ZeroΓUnit),
(Unit β ZeroΓUnit),
(Unit β UnitΓUnit),
(Zero β UnitΓUnit),
(Zero β β(@a : { @a }),
(Unit β β(@a : { @a }),
(ZeroΓUnit β Zero),
(ZeroΓπ° β Zero),
(UnitΓZero β Zero),
(ZeroΓZero β Zero),
(π° β β(@b : { @b }),
β(@a : π° ){ @aΓπ° },
β(@a : π° ){ @aΓZero },
β(@a : π° ){ @aΓUnit },
β(@a : π° ){ ZeroΓ@a },
β(@a : π° ){ UnitΓ@a },
...
def seekGoals(typ: Typ[Term]) = lp.addGoals(typ -> 0.5, negate(typ) -> 0.5).successes
defined function seekGoals
def topGoals(n: Int) = (0 until n).map{j => unknownsT.flatMap(v => seekGoals(v(j)))}
defined function topGoals
val top20 = topGoals(20)
top20.map(_.runToFuture)
top20: collection.immutable.IndexedSeq[monix.eval.Task[Vector[(Typ[Term], Double, FiniteDistribution[Term])]]] = Vector(
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@2d492f74
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@7e3c63c4
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@120460a6
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@7ffc7409
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@27a2b914
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@3a9dcc67
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@bad8ac2
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@17edfb82
),
FlatMap(
Async(<function2>, false, true, true),
ammonite.$sess.cmd12$Helper$$Lambda$3573/1199703190@25359a72
),
FlatMap(
...
res13_1: collection.immutable.IndexedSeq[monix.execution.CancelableFuture[Vector[(Typ[Term], Double, FiniteDistribution[Term])]]] = Vector(
Success(
Vector(
(
β(@a : { (@a β Zero) },
0.5,
FiniteDistribution(
Vector(
Weighted((Zero , rec_{ Zero ; Zero }), 0.009912434376452174),
Weighted((Zero , (@a : Zero) β¦ @a), 0.009912434376452174)
)
)
)
)
),
Success(
Vector(
(
((Unit β (Unit β Zero)) β Zero),
0.5,
FiniteDistribution(
Vector(
Weighted(
(@a : (Unit β (Unit β Zero))) β¦ @a(Star)(Star),
0.0191661641766036
)
)
)
)
)
),
Success(
Vector(
(
(Zero β β(@a : π° ){ @a }),
0.5,
FiniteDistribution(
Vector(Weighted(rec_{ Zero ; β(@a : π° ){ @a } }, 0.02524248658291313))
)
)
)
),
Success(
Vector(
(
((Unit β β(@a : π° ){ @a }) β Zero),
0.5,
FiniteDistribution(
Vector(
Weighted(
(@a : (Unit β β(@a : π° ){ @a })) β¦ @a(Star)(Zero),
0.0191661641766036
)
)
)
)
)
),
Success(
Vector(
(
((π° β β(@b : π° ){ @b }) β Zero),
0.5,
FiniteDistribution(
Vector(
Weighted(
(@a : (π° β β(@b : π° ){ @b })) β¦ @a(Unit)(Zero),
0.0095830820883018
),
Weighted(
(@a : (π° β β(@b : π° ){ @b })) β¦ @a(Zero)(Zero),
0.0095830820883018
)
)
)
)
)
),
Success(
Vector(
(
β(@a : π° ){ (Zero β @a) },
0.5,
FiniteDistribution(
Vector(Weighted((@a : π° ) β¦ rec_{ Zero ; @a }, 0.02216424605959186))
)
)
)
),
Success(
Vector(
(
β(@a : { ((Unit β @a) β Zero) },
0.5,
FiniteDistribution(
Vector(
Weighted(
(Zero , (@a : (Unit β Zero)) β¦ @a(Star)),
0.01982316937709552
)
)
)
)
)
),
Success(
Vector(
(
((Unit β (π° β Zero)) β Zero),
0.5,
FiniteDistribution(
Vector(
Weighted(
(@a : (Unit β (π° β Zero))) β¦ @a(Star)(Zero),
0.0095830820883018
),
Weighted(
(@a : (Unit β (π° β Zero))) β¦ @a(Star)(Unit),
0.0095830820883018
)
)
)
)
)
),
Success(
Vector(
(
β(@a : { (@a(Star) β Zero) },
0.5,
FiniteDistribution(
Vector(
Weighted(
((@a : Unit) β¦ Zero , rec_{ Zero ; Zero }),
0.004946099629479799
),
Weighted(
((@a : Unit) β¦ Zero , (@a : Zero) β¦ @a),
0.004946099629479799
),
Weighted(
(rec_{ Unit ; π° }(Zero) , (@a : Zero) β¦ @a),
0.004946099629479799
),
Weighted(
(rec_{ Unit ; π° }(Zero) , rec_{ Zero ; Zero }),
0.004946099629479799
)
)
)
)
)
),
Success(
Vector(
(
((π° β (Unit β Zero)) β Zero),
0.5,
FiniteDistribution(
Vector(
Weighted(
(@a : (π° β (Unit β Zero))) β¦ @a(Unit)(Star),
0.0095830820883018
),
Weighted(
(@a : (π° β (Unit β Zero))) β¦ @a(Zero)(Star),
0.0095830820883018
)
)
)
)
)
),
Success(
Vector(
(
β(@a : { (@a β Zero) + (@a β Zero) },
0.5,
FiniteDistribution(
Vector(
Weighted(
(Zero , FirstIncl(PlusTyp((Zero) β (Zero),(Zero) β (Zero)),rec(Zero)(Zero))),
0.005120352121428702
),
Weighted(
(Zero , ScndIncl(PlusTyp((Zero) β (Zero),(Zero) β (Zero)),rec(Zero)(Zero))),
0.005120352121428702
),
Weighted(
(Zero , ScndIncl(PlusTyp((Zero) β (Zero),(Zero) β (Zero)),(`@a : Zero) β¦ (`@a))),
0.004791232567119057
),
Weighted(
(Zero , FirstIncl(PlusTyp((Zero) β (Zero),(Zero) β (Zero)),(`@a : Zero) β¦ (`@a))),
0.004791232567119057
)
)
)
)
)
),
Success(
Vector(
(
β(@a : { (@a β @a) },
0.5,
FiniteDistribution(
Vector(
Weighted((Unit , rec_{ Unit ; Unit }(Star)), 0.004946499273937881),
Weighted((Zero , (@a : Zero) β¦ @a), 0.004946499273937881),
Weighted((Zero , rec_{ Zero ; Zero }), 0.004946499273937881),
Weighted((Unit , (@a : Unit) β¦ @a), 0.0031241048045923467),
Weighted((Unit , (@a : Unit) β¦ Star), 0.0018223944693455355)
)
)
)
)
),
Success(
Vector(
(
β(@a : { ((π° β @a) β Zero) },
0.5,
FiniteDistribution(
Vector(
Weighted((Zero , (@a : (π° β Zero)) β¦ @a(Unit)), 0.00991158468854776),
Weighted((Zero , (@a : (π° β Zero)) β¦ @a(Zero)), 0.00991158468854776)
)
)
)
)
),
Success(Vector()),
Success(
Vector(
(
(Zero β UnitΓZero),
0.5,
FiniteDistribution(
Vector(
Weighted(rec_{ Zero ; UnitΓZero }, 0.017091576549434707),
Weighted((@a : Zero) β¦ (Star , @a), 0.0104964584462948)
)
)
)
)
),
Success(Vector()),
Success(
Vector(
(
(Zero β ZeroΓπ° ),
0.5,
FiniteDistribution(
Vector(
Weighted((@a : Zero) β¦ (@a , Zero), 0.005238463685229454),
Weighted(rec_{ Zero ; ZeroΓπ° }, 0.01709191390737606),
Weighted((@a : Zero) β¦ (@a , Unit), 0.005238463685229454)
)
)
)
)
),
Success(
Vector(
(
(Unit β UnitΓπ° ),
0.5,
FiniteDistribution(
Vector(
Weighted((@a : Unit) β¦ (@a , Zero), 0.003189116089034762),
Weighted(rec_{ Unit ; UnitΓπ° }((Star , Zero)), 0.004755330860038047),
Weighted((@a : Unit) β¦ (@a , Unit), 0.003189116089034762),
Weighted(rec_{ Unit ; UnitΓπ° }((Star , Unit)), 0.004755330860038047),
Weighted((@a : Unit) β¦ (Star , Unit), 0.001860317718603611),
Weighted((@a : Unit) β¦ (Star , Zero), 0.001860317718603611)
)
)
)
)
),
Success(
Vector(
(
(Zero β UnitΓπ° ),
0.5,
FiniteDistribution(
Vector(
Weighted((@a : Zero) β¦ (Star , Zero), 0.005238463685229454),
Weighted((@a : Zero) β¦ (Star , Unit), 0.005238463685229454),
Weighted(rec_{ Zero ; UnitΓπ° }, 0.01709191390737606)
)
)
)
)
),
Success(
Vector(
(
(Zero β ZeroΓZero),
0.5,
FiniteDistribution(
Vector(
Weighted(rec_{ Zero ; ZeroΓZero }, 0.017091576549434714),
Weighted((@a : Zero) β¦ (@a , @a), 0.010496458446294802)
)
)
)
)
)
)
While a very modest task, this has been a success in both workflow and results.