|
30 | 30 | # - Make a reasonably standard format (and exporter/importer) to exchange |
31 | 31 | # pregroup presentations so we can move them between GAP/other |
32 | 32 | # implementations for cross-checking |
| 33 | +# - some names are unfortunate: |
| 34 | +# |
| 35 | +# PregroupPlace should be PregroupPresentationPlace |
| 36 | +# PregroupRelator should be PregroupPresentationRelator |
| 37 | +# generally I would like to implement proper pregroup presentations, defining |
| 38 | +# the "unive rsal group over a pregroup" |
| 39 | +# and then quotients of that, in the same way as quotients of free groups are implemented |
33 | 40 |
|
34 | 41 | # |
35 | 42 | # TODO (mathematical/functional) |
@@ -484,3 +491,62 @@ InstallMethod(IsHyperbolic, "for a pregroup presentation, and a rational number" |
484 | 491 | [IsPregroupPresentation, IsRat], |
485 | 492 | {pres, eps} -> RSymTest(pres,eps)); |
486 | 493 |
|
| 494 | + |
| 495 | +InstallGlobalFunction("VerifySolverAtPlace", |
| 496 | +function(place) |
| 497 | + local n, L, places, psip, osrp, pp, i, pq, P, Q, Pq, np, chi; |
| 498 | + |
| 499 | + places := Places(PregroupPresentationOf(place)); |
| 500 | + |
| 501 | + if not IsPregroupPlace(place) then |
| 502 | + Error("<place> has to be a PregroupPlace"); |
| 503 | + fi; |
| 504 | + |
| 505 | + n := Length(Relator(place)); |
| 506 | + |
| 507 | + if IsTerminal(place) then |
| 508 | + Error("Terminal place in VerifySolverAtPlace"); |
| 509 | + elif Colour(place) = "green" then |
| 510 | + L := [(place, 0, 1, 3/4)]; |
| 511 | + elif Colour(place) = "red" then |
| 512 | + L := [(place, 0, 0, 1)]; |
| 513 | + for np in NextPlaces(place) do |
| 514 | + Add(L, [np, 1, 1, 1 + chi]); |
| 515 | + od; |
| 516 | + fi; |
| 517 | + |
| 518 | + for i in [1..3] do |
| 519 | + for pq in L do |
| 520 | + |
| 521 | + if pq[3] = i then |
| 522 | + P := pq[1]; |
| 523 | + osrp := OneStepReachablePlaces(P); |
| 524 | + for Q in Keys(osrp) do |
| 525 | + psip := pq[4] + Q[2]; |
| 526 | + |
| 527 | + if pq[2] + Q[2] < n/2 and |
| 528 | + not IsTerminal(places[Q[1]]) and |
| 529 | + psip > 0 then |
| 530 | + pp := PositionProperty(L, x -> (x[1] = osrp[1]) |
| 531 | + and (x[2] = Pq[2] + osrp[2])); |
| 532 | + if pp = fail then |
| 533 | + Add(L, Immutable([osrp[1], pq[2] + Q[2], i + 1, psip]) ); |
| 534 | + else |
| 535 | + if L[pp][4] < psip then |
| 536 | + L[pp] := Immutable([osrp[1], Pq[2] + Q[2], i + 1, psip]); |
| 537 | + fi; |
| 538 | + fi; |
| 539 | + fi; |
| 540 | + |
| 541 | + if pq[2] + Q[2] >= n/2 and |
| 542 | + IsTerminal(places[Q[1]]) and |
| 543 | + psip > 0 then |
| 544 | + return [fail, L]; |
| 545 | + fi; |
| 546 | + od; |
| 547 | + fi; |
| 548 | + od; |
| 549 | + od; |
| 550 | + return true; |
| 551 | +end); |
| 552 | + |
0 commit comments